From 7dcaae846547a48bf1cbe1fe4241ac661e20d71f Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Mon, 6 Nov 2023 10:25:08 -0600 Subject: [PATCH 1/2] Ensure e2e tests run in production mode --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f8644477900..3e23de10151 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "test:headless": "ng test --source-map=true --watch=false --configuration test --browsers=ChromeHeadless --code-coverage", "lint": "ng lint", "lint-fix": "ng lint --fix=true", - "e2e": "ng e2e", + "e2e": "cross-env NODE_ENV=production ng e2e", "clean:dev:config": "rimraf src/assets/config.json", "clean:coverage": "rimraf coverage", "clean:dist": "rimraf dist", From 72cda4173124c2d2b3125e4cfed106338dc70ad9 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 8 Nov 2023 10:08:49 -0600 Subject: [PATCH 2/2] Specify user agent to avoid being detected as a "bot" by backend --- cypress/support/commands.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index c70c4e37e12..92f0b1aeeb6 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -177,6 +177,8 @@ function generateViewEvent(uuid: string, dsoType: string): void { [XSRF_REQUEST_HEADER] : csrfToken, // use a known public IP address to avoid being seen as a "bot" 'X-Forwarded-For': '1.1.1.1', + // Use a user-agent of a Firefox browser on Windows. This again avoids being seen as a "bot" + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0', }, //form: true, // indicates the body should be form urlencoded body: { targetId: uuid, targetType: dsoType },