From f846cf32fd6dafd368f8c910778052f4824c38af Mon Sep 17 00:00:00 2001 From: Dmitry Yankowski Date: Mon, 24 Feb 2020 21:51:36 -0500 Subject: [PATCH] Update proxy spec --- tests/e2e/integration/proxy.spec.js | 34 +++++++++++++---------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/tests/e2e/integration/proxy.spec.js b/tests/e2e/integration/proxy.spec.js index 455bc3f86..d2d202cb6 100644 --- a/tests/e2e/integration/proxy.spec.js +++ b/tests/e2e/integration/proxy.spec.js @@ -1,25 +1,21 @@ -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 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") +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() + .wait(500) + .get('#response-details-wrapper').should($wrapper => { + expect($wrapper).to.contain('Cat API') }) }) -}) +}) \ No newline at end of file