tests(fix): update start-server-and-test, update e2e tests, change build test command at ci

This commit is contained in:
yubathom
2020-02-01 18:36:51 -03:00
parent 7cf5345c5a
commit 85c5f16e93
8 changed files with 152 additions and 102 deletions

View File

@@ -0,0 +1,20 @@
describe('Proxy disabled - local request', () => {
it('Change default url with query and make a request to local cat api', () => {
cy.seedAndVisit('catapi', '/?url=https://api.thecatapi.com&path=')
.get('#url').then((el) => expect(el.val() === 'https://api.thecatapi.com').to.equal(true))
.get("#path").then((el) => expect(el.val() === '').to.equal(true))
.get('#response-details-wrapper').should($wrapper => {
expect($wrapper).to.contain('FAKE Cat API')
})
})
})
describe('Proxy enabled - external request', () => {
it('Enable the proxy and make a request to the real cat api', () => {
cy.enableProxy('/?url=https://api.thecatapi.com&path=')
.get('#send').click()
.get('#response-details-wrapper').should($wrapper => {
expect($wrapper).to.contain('Cat API')
})
})
})