Skip to content

Commit

Permalink
Merge pull request #18 from nepalcodes/endpoints_branch
Browse files Browse the repository at this point in the history
init commit
  • Loading branch information
christikaes authored May 3, 2020
2 parents 53d3c6f + c7ad693 commit dbc3626
Show file tree
Hide file tree
Showing 6 changed files with 18,210 additions and 7,391 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,8 @@ npm run test
# To just run the e2e tests
npm run test-run
```

# FAQ

**I'm getting an error when I try to run an npm command**
Make sure you've run `npm install` and `npm run bootstrap`
24 changes: 24 additions & 0 deletions cypress/integration/eventCheck.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
describe('organizations', () =>{
Cypress.config('baseUrl','http://localhost/api')

it('Get- read', () => {
cy.request('/events').then((response) => {
expect(response).to.have.property('status',200)
expect(response.body).to.not.be.null
})
})

it('POST-Create', () => {
const item = {"success":1,"timestamp":"2020-03-25 16:52:19","results":{"0":{"event":"Teej","Location":"Hindu Sabha Mandir","Date":"9/01","Price":"$39"},"1":{"event":"Dashain","Location":"My House","Date":"6/20","Price":"$62"}}}
cy.request('events?id=0',item )
.its('body')
.its('results')
.should('include',{event:'Teej'})
})

it('PUT - Update', () => {
const item = {"event":"Holi"}
cy.request({method:'PUT',url:'events?id=0',body:item, failOnStatusCode: false})

})
})
23 changes: 23 additions & 0 deletions cypress/integration/organizationCheck.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('organizations', () =>{
Cypress.config('baseUrl','http://localhost/api/')

it('GET - read', () => {
cy.request('/organizations').then((response) => {
expect(response).to.have.property('status',200)
expect(response.body).to.not.be.null
})
})

it('POST-Create', () => {
const item = {"success":1,"timestamp":"2020-03-25 15:38:30","results":{"0":{"Name":"Nandu Business","Net Worth":"6 Billion","Business Type":"Real Estate Dealer"},"1":{"Name":"Sailesh Business","Net Worth":"20 Billion","Business Type":"Food Dealer"}}}
cy.request('organizations?id=0',item )
.its('body')
.its('results')
.should('include',{Name:'Nandu Business'})
})

it('PUT - update', () => {
const item = {"Name":"Saagr"}
cy.request({method:'PUT', url:'/organizations?',body:item, failOnStatusCode: false})
})
})
Loading

0 comments on commit dbc3626

Please sign in to comment.