From 4e897c198f2d67ff976a1042b8cb2b5efe6f263a Mon Sep 17 00:00:00 2001 From: Tallulah Kay <43218114+tallulahkay@users.noreply.github.com> Date: Thu, 21 Dec 2023 09:29:16 -0800 Subject: [PATCH] DAH 1936 fix e2e tests (#2042) * DAH-1936 fix endpoint being intercepted in machineTranslations e2e test * DAH-1936 use regex to capture either call * DAH-1936 extend timeout * DAH-1936 extend timeout * DAH-1936 increase timeout * DAH-1936 bump up default timeouts for cypress tests * DAH-1936 remove unneeded changes --- cypress.config.ts | 4 ++-- cypress/e2e/listingDetails/machineTranslations.e2e.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress.config.ts b/cypress.config.ts index c79ee8e3d7..8474241256 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -2,9 +2,9 @@ import 'dotenv/config' import { defineConfig } from 'cypress' export default defineConfig({ - defaultCommandTimeout: 10000, + defaultCommandTimeout: 120000, // 2 mins projectId: 'dahlia-housing-portal', - pageLoadTimeout: 10000, + pageLoadTimeout: 120000, // 2 mins reporterOptions: { mochaFile: 'cypress/results/tests-[hash].xml', toConsole: true, diff --git a/cypress/e2e/listingDetails/machineTranslations.e2e.ts b/cypress/e2e/listingDetails/machineTranslations.e2e.ts index 69a134a0b4..8be3121c3b 100644 --- a/cypress/e2e/listingDetails/machineTranslations.e2e.ts +++ b/cypress/e2e/listingDetails/machineTranslations.e2e.ts @@ -1,5 +1,5 @@ const verifyMachineTranslations = (language, id, translation) => { - cy.intercept("POST", "https://translate-pa.googleapis.com/v1/translateHtml").as("getTranslate") + cy.intercept("POST", /^https:\/\/translate/).as("getTranslate") cy.visit(`${language}/listings/${id}?react=true`) cy.wait("@getTranslate") return cy.contains(translation)