From 5e5cdb181d3156415a30cfcc9fa23697da5125b7 Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Thu, 12 Mar 2020 21:46:37 +0530 Subject: [PATCH 1/3] :white_check_mark: Updating tests --- tests/e2e/integration/proxy.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/integration/proxy.spec.js b/tests/e2e/integration/proxy.spec.js index 607936002..20f6e6865 100644 --- a/tests/e2e/integration/proxy.spec.js +++ b/tests/e2e/integration/proxy.spec.js @@ -13,13 +13,13 @@ describe("Proxy disabled - local request", () => { 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=") + cy.enableProxy("/?url=https://postwoman.io&path=/.netlify/functions/api") .get("#send") .click() .get("#response-details-wrapper", { timeout: 24000 }) .should("be.visible") .should($wrapper => { - expect($wrapper).to.contain("The Cat API") + expect($wrapper).to.contain("Hello World") }) }) }) From 7d5c246a1ffdd1c248b3edfd0d535962823843cb Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Thu, 12 Mar 2020 22:28:25 +0530 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=85=20Updating=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e/integration/proxy.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/integration/proxy.spec.js b/tests/e2e/integration/proxy.spec.js index 20f6e6865..58316dbda 100644 --- a/tests/e2e/integration/proxy.spec.js +++ b/tests/e2e/integration/proxy.spec.js @@ -3,7 +3,7 @@ describe("Proxy disabled - local request", () => { cy.seedAndVisit("catapi", "/?url=https://api.thecatapi.com&path=") .get("#url") .then(el => expect(el.val() === "https://api.thecatapi.com").to.equal(true)) - .get("#response-details-wrapper") + .get("#response-details-wrapper", { timeout: 24000 }) .should("be.visible") .should($wrapper => { expect($wrapper).to.contain("FAKE Cat API") From 564f65977801884e891ed665a693656ae663f8fa Mon Sep 17 00:00:00 2001 From: Liyas Thomas Date: Thu, 12 Mar 2020 22:49:43 +0530 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=85=20Updating=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e/integration/app.starter.spec.js | 2 +- .../integration/feature.url-queries.spec.js | 4 +-- tests/e2e/integration/proxy.spec.js | 28 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/e2e/integration/app.starter.spec.js b/tests/e2e/integration/app.starter.spec.js index 301176d8b..70c134f0a 100644 --- a/tests/e2e/integration/app.starter.spec.js +++ b/tests/e2e/integration/app.starter.spec.js @@ -1,4 +1,4 @@ -describe("Visit home", () => { +describe("Visit Home", () => { it('Have a page title with "Postwoman"', () => { cy.visit("/", { retryOnStatusCodeFailure: true }) .get("title") diff --git a/tests/e2e/integration/feature.url-queries.spec.js b/tests/e2e/integration/feature.url-queries.spec.js index 3481242b7..3ce949a4c 100644 --- a/tests/e2e/integration/feature.url-queries.spec.js +++ b/tests/e2e/integration/feature.url-queries.spec.js @@ -1,5 +1,5 @@ describe("Authentication", () => { - it(`Change default auth user and pass with url`, () => { + it(`Change default Auth username and password with URL`, () => { cy.visit(`?&auth=Basic Auth&httpUser=foo&httpPassword=bar`, { retryOnStatusCodeFailure: true }) .get('input[name="http_basic_user"]', { timeout: 500 }) .invoke("val") @@ -14,7 +14,7 @@ describe("Authentication", () => { }) }) - it("Enable user and pass at url with toggler", () => { + it("Enable username and password in URL with toggler", () => { cy.visit("/", { retryOnStatusCodeFailure: true }) .get("#auth") .select("Basic Auth") diff --git a/tests/e2e/integration/proxy.spec.js b/tests/e2e/integration/proxy.spec.js index 58316dbda..ea555b3bc 100644 --- a/tests/e2e/integration/proxy.spec.js +++ b/tests/e2e/integration/proxy.spec.js @@ -1,18 +1,5 @@ -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("#response-details-wrapper", { timeout: 24000 }) - .should("be.visible") - .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", () => { + it("Enable proxy and make a GET request to Postwoman API", () => { cy.enableProxy("/?url=https://postwoman.io&path=/.netlify/functions/api") .get("#send") .click() @@ -23,3 +10,16 @@ describe("Proxy enabled - external request", () => { }) }) }) + +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("#response-details-wrapper") + .should("be.visible") + .should($wrapper => { + expect($wrapper).to.contain("FAKE Cat API") + }) + }) +})