From 59a43801133dc858649629e6e022f4064a6db57e Mon Sep 17 00:00:00 2001 From: John Alling Date: Tue, 21 May 2024 11:55:48 -0400 Subject: [PATCH 01/26] add playwright tests to e2e workflow --- .github/workflows/e2e.yaml | 29 +++++++++++++++++++++++++- src/leapfrogai_ui/playwright.config.ts | 29 +++++++++++++++++++++++--- src/leapfrogai_ui/tests/auth.setup.ts | 4 ++-- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 4378dea90..28c9b9091 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -61,6 +61,14 @@ jobs: - name: Install Python Deps run: python -m pip install "." + - name: Setup Node + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version-file: 'src/leapfrogai_ui/package.json' + + - name: Install UI Dependencies + run: npm --prefix src/leapfrogai_ui ci + - name: Setup UDS Environment uses: defenseunicorns/uds-common/.github/actions/setup@05f42bb3117b66ebef8c72ae050b34bce19385f5 with: @@ -92,7 +100,26 @@ jobs: python -m pip install requests python -m pytest ./tests/e2e/test_supabase.py -v - # This cleanup may need to be moved/removed when other packages depend on Supabase + ########## + # UI + ########## + - name: Deploy LFAI-UI + run: | + make build-ui LOCAL_VERSION=e2e-test + docker image prune -af + uds zarf package deploy packages/ui/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst --confirm + rm packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst + + # Run the playwright UI tests using the deployed Supabase endpoint + - name: UI and Supabase test + run: | + TEST_ENV=e2e PUBLIC_SUPABASE_URL=http://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration + + - name: Cleanup UI + run: | + uds zarf package remove leapfrogai-ui --confirm + + # Supabase can now be removed since we're done testing it - name: Cleanup Supabase run: | uds zarf package remove supabase -l=trace --confirm diff --git a/src/leapfrogai_ui/playwright.config.ts b/src/leapfrogai_ui/playwright.config.ts index 7b90f311e..a42fabb0c 100644 --- a/src/leapfrogai_ui/playwright.config.ts +++ b/src/leapfrogai_ui/playwright.config.ts @@ -4,7 +4,7 @@ import dotenv from 'dotenv'; dotenv.config(); -const config: PlaywrightTestConfig = { +const defaultConfig: PlaywrightTestConfig = { projects: [ { name: 'setup', testMatch: /.*\.setup\.ts/ }, { name: 'clear_db', testMatch: /.*\clear_db\.ts/ }, @@ -41,13 +41,36 @@ const config: PlaywrightTestConfig = { dependencies: ['clear_db', 'setup'] } ], + testDir: 'tests', + testMatch: /(.+\.)?(test|spec)\.[jt]s/ +}; + +// when in dev, create a local webserver +const devConfig: PlaywrightTestConfig = { webServer: { command: 'npm run build && npm run preview', port: 4173, stderr: 'pipe' }, - testDir: 'tests', - testMatch: /(.+\.)?(test|spec)\.[jt]s/ + use: { + baseURL: 'http://localhost:4173' + } +}; + +// when e2e testing, use the deployed instance +const e2eConfig: PlaywrightTestConfig = { + use: { + baseURL: 'http://ai.uds.dev' + } +}; + +// get the environment type from command line. If none, set it to dev +const environment = process.env.TEST_ENV || 'dev'; + +// config object with default configuration and environment specific configuration +const config: PlaywrightTestConfig = { + ...defaultConfig, + ...(environment === 'e2e' ? e2eConfig : devConfig) }; export default config; diff --git a/src/leapfrogai_ui/tests/auth.setup.ts b/src/leapfrogai_ui/tests/auth.setup.ts index 899bc6d18..75239f438 100644 --- a/src/leapfrogai_ui/tests/auth.setup.ts +++ b/src/leapfrogai_ui/tests/auth.setup.ts @@ -5,7 +5,7 @@ import * as OTPAuth from 'otpauth'; setup('authenticate', async ({ page, clearDbData }) => { await clearDbData(); - await page.goto('http://localhost:4173'); + await page.goto('/'); // go to the home page if (process.env.PUBLIC_DISABLE_KEYCLOAK === 'true') { // uses local supabase test users, logs in directly with Supabase, no Keycloak await page.getByText('Already have an account? Sign In').click(); @@ -46,7 +46,7 @@ setup('authenticate', async ({ page, clearDbData }) => { // // Login flow sets cookies in the process of several redirects. // Wait for the final URL to ensure that the cookies are actually set. - await page.waitForURL('http://localhost:4173/chat'); + await page.waitForURL('/chat'); // Alternatively, you can wait until the page reaches a state where all cookies are set. // await expect(page.getByRole('button', { name: 'View profile and more' })).toBeVisible(); From df3724134a0d1b5be1281f7b8112609c3103c3a0 Mon Sep 17 00:00:00 2001 From: John Alling Date: Tue, 21 May 2024 12:24:24 -0400 Subject: [PATCH 02/26] fix rm typo --- .github/workflows/e2e.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 28c9b9091..40bb20a42 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -108,7 +108,7 @@ jobs: make build-ui LOCAL_VERSION=e2e-test docker image prune -af uds zarf package deploy packages/ui/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst --confirm - rm packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst + rm packages/api/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst # Run the playwright UI tests using the deployed Supabase endpoint - name: UI and Supabase test From b71cd3486760844a4dfb7779d3d16a9dff837625 Mon Sep 17 00:00:00 2001 From: John Alling Date: Tue, 21 May 2024 12:38:08 -0400 Subject: [PATCH 03/26] add env copy command --- .github/workflows/e2e.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 40bb20a42..00b1cdc8b 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -108,11 +108,12 @@ jobs: make build-ui LOCAL_VERSION=e2e-test docker image prune -af uds zarf package deploy packages/ui/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst --confirm - rm packages/api/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst + rm packages/uii/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst # Run the playwright UI tests using the deployed Supabase endpoint - name: UI and Supabase test run: | + cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env TEST_ENV=e2e PUBLIC_SUPABASE_URL=http://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration - name: Cleanup UI From ef3a2c843ff4fa8fe9a666e21194165172867c5d Mon Sep 17 00:00:00 2001 From: John Alling Date: Tue, 21 May 2024 12:49:58 -0400 Subject: [PATCH 04/26] fix typo --- .github/workflows/e2e.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 00b1cdc8b..36ac72aea 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -108,7 +108,7 @@ jobs: make build-ui LOCAL_VERSION=e2e-test docker image prune -af uds zarf package deploy packages/ui/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst --confirm - rm packages/uii/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst + rm packages/ui/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst # Run the playwright UI tests using the deployed Supabase endpoint - name: UI and Supabase test From 0ebf984b9ff8641b8d2783cf5e8636a9faa8b474 Mon Sep 17 00:00:00 2001 From: John Alling Date: Tue, 21 May 2024 13:16:22 -0400 Subject: [PATCH 05/26] add playwright install --- .github/workflows/e2e.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 36ac72aea..8b73b7e4f 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -66,8 +66,10 @@ jobs: with: node-version-file: 'src/leapfrogai_ui/package.json' - - name: Install UI Dependencies - run: npm --prefix src/leapfrogai_ui ci + - name: Install UI/Playwright Dependencies + run: | + npm --prefix src/leapfrogai_ui ci + npx playwright install - name: Setup UDS Environment uses: defenseunicorns/uds-common/.github/actions/setup@05f42bb3117b66ebef8c72ae050b34bce19385f5 From 340a00b565d6cecfcbce54fc25ffae10d72958b0 Mon Sep 17 00:00:00 2001 From: John Alling Date: Tue, 21 May 2024 13:40:49 -0400 Subject: [PATCH 06/26] add npx prefix --- .github/workflows/e2e.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 8b73b7e4f..0a5ac0b5b 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -69,7 +69,7 @@ jobs: - name: Install UI/Playwright Dependencies run: | npm --prefix src/leapfrogai_ui ci - npx playwright install + npx --prefix src/leapfrogai_ui playwright install - name: Setup UDS Environment uses: defenseunicorns/uds-common/.github/actions/setup@05f42bb3117b66ebef8c72ae050b34bce19385f5 From f512565a99a367648e2b01fce951b6c8ae95d695 Mon Sep 17 00:00:00 2001 From: John Alling Date: Tue, 21 May 2024 16:51:05 -0400 Subject: [PATCH 07/26] create new account in e2e test --- .github/workflows/e2e.yaml | 5 +++-- src/leapfrogai_ui/playwright.config.ts | 4 ++-- src/leapfrogai_ui/tests/auth.setup.ts | 23 ++++++++++++++++------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 0a5ac0b5b..180dda701 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -92,10 +92,11 @@ jobs: uds zarf package deploy packages/supabase/zarf-package-supabase-amd64-e2e-test.tar.zst --confirm rm packages/supabase/zarf-package-supabase-amd64-e2e-test.tar.zst - - name: Set environment variable + - name: Set environment variables id: set-env-var run: | echo "API_KEY=$(uds zarf tools kubectl get secret supabase-bootstrap-jwt -n leapfrogai -o jsonpath='{.data.anon-key}' | base64 -d)" >> "$GITHUB_ENV" + echo "SUPABASE_PASSWORD=$(uds zarf tools kubectl get secret supabase-dashboard-secret -n leapfrogai -o jsonpath='{.data.password}') >> "$GITHUB_ENV" - name: Test Supabase run: | @@ -116,7 +117,7 @@ jobs: - name: UI and Supabase test run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env - TEST_ENV=e2e PUBLIC_SUPABASE_URL=http://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration + TEST_ENV=e2e PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=http://supabase-kong.uds.dev USERNAME=supabase-admin PASSWORD=$SUPABASE_PASSWORD PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration - name: Cleanup UI run: | diff --git a/src/leapfrogai_ui/playwright.config.ts b/src/leapfrogai_ui/playwright.config.ts index a42fabb0c..3a4eb2abe 100644 --- a/src/leapfrogai_ui/playwright.config.ts +++ b/src/leapfrogai_ui/playwright.config.ts @@ -58,7 +58,7 @@ const devConfig: PlaywrightTestConfig = { }; // when e2e testing, use the deployed instance -const e2eConfig: PlaywrightTestConfig = { +const CI_Config: PlaywrightTestConfig = { use: { baseURL: 'http://ai.uds.dev' } @@ -70,7 +70,7 @@ const environment = process.env.TEST_ENV || 'dev'; // config object with default configuration and environment specific configuration const config: PlaywrightTestConfig = { ...defaultConfig, - ...(environment === 'e2e' ? e2eConfig : devConfig) + ...(environment === 'CI' ? CI_Config : devConfig) }; export default config; diff --git a/src/leapfrogai_ui/tests/auth.setup.ts b/src/leapfrogai_ui/tests/auth.setup.ts index 75239f438..89a9fffec 100644 --- a/src/leapfrogai_ui/tests/auth.setup.ts +++ b/src/leapfrogai_ui/tests/auth.setup.ts @@ -7,13 +7,22 @@ setup('authenticate', async ({ page, clearDbData }) => { await page.goto('/'); // go to the home page if (process.env.PUBLIC_DISABLE_KEYCLOAK === 'true') { - // uses local supabase test users, logs in directly with Supabase, no Keycloak - await page.getByText('Already have an account? Sign In').click(); - await page.getByPlaceholder('Your email address').click(); - await page.getByPlaceholder('Your email address').fill('user1@test.com'); - await page.getByPlaceholder('Your password').click(); - await page.getByPlaceholder('Your password').fill('password123'); - await page.getByRole('button', { name: 'Sign In' }).click(); + // when running in Github CI, create a new account because we don't have seed migrations + if (process.env.TEST_ENV === 'CI') { + await page.getByPlaceholder('Your email address').click(); + await page.getByPlaceholder('Your email address').fill('user1@test.com'); + await page.getByPlaceholder('Your password').click(); + await page.getByPlaceholder('Your password').fill('password123'); + await page.getByRole('button', { name: 'Sign Up' }).click(); + } else { + // uses local supabase test users, logs in directly with Supabase, no Keycloak + await page.getByText('Already have an account? Sign In').click(); + await page.getByPlaceholder('Your email address').click(); + await page.getByPlaceholder('Your email address').fill('user1@test.com'); + await page.getByPlaceholder('Your password').click(); + await page.getByPlaceholder('Your password').fill('password123'); + await page.getByRole('button', { name: 'Sign In' }).click(); + } } else { // With Keycloak await page.getByRole('button', { name: 'Log In' }).click(); From e8b726cddfa0a292e36a9336756ece6aabeafece Mon Sep 17 00:00:00 2001 From: John Alling Date: Tue, 21 May 2024 17:15:40 -0400 Subject: [PATCH 08/26] fix env var --- .github/workflows/e2e.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 180dda701..8520f0461 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -96,7 +96,6 @@ jobs: id: set-env-var run: | echo "API_KEY=$(uds zarf tools kubectl get secret supabase-bootstrap-jwt -n leapfrogai -o jsonpath='{.data.anon-key}' | base64 -d)" >> "$GITHUB_ENV" - echo "SUPABASE_PASSWORD=$(uds zarf tools kubectl get secret supabase-dashboard-secret -n leapfrogai -o jsonpath='{.data.password}') >> "$GITHUB_ENV" - name: Test Supabase run: | @@ -117,7 +116,7 @@ jobs: - name: UI and Supabase test run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env - TEST_ENV=e2e PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=http://supabase-kong.uds.dev USERNAME=supabase-admin PASSWORD=$SUPABASE_PASSWORD PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration + TEST_ENV=e2e PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=http://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration - name: Cleanup UI run: | From 795dad1dcb26e1cb4443db5fd9bf0d214ff2f784 Mon Sep 17 00:00:00 2001 From: John Alling Date: Tue, 21 May 2024 17:58:13 -0400 Subject: [PATCH 09/26] change env var to CI --- .github/workflows/e2e.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 8520f0461..4b9ccb2ba 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -116,7 +116,7 @@ jobs: - name: UI and Supabase test run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env - TEST_ENV=e2e PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=http://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration + TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=http://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration - name: Cleanup UI run: | From 67368e0c88b70b42930f7e791b8e1610e2236f38 Mon Sep 17 00:00:00 2001 From: John Alling Date: Wed, 22 May 2024 13:28:27 -0400 Subject: [PATCH 10/26] add chrome runtime fix --- src/leapfrogai_ui/tests/auth.setup.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/leapfrogai_ui/tests/auth.setup.ts b/src/leapfrogai_ui/tests/auth.setup.ts index 89a9fffec..121ec38e6 100644 --- a/src/leapfrogai_ui/tests/auth.setup.ts +++ b/src/leapfrogai_ui/tests/auth.setup.ts @@ -41,16 +41,16 @@ setup('authenticate', async ({ page, clearDbData }) => { const code = totp.generate(); await page.getByLabel('Six digit code').fill(code); await page.getByRole('button', { name: 'Log In' }).click(); - - // Chrome gets stuck here for an unknown reason, does not happen in real life - // This hack allows the test to continue - // ref: https://github.com/microsoft/playwright/issues/16160 - // I suspect it is an issue with the Supabase callback, but the output in the Playwright UI does not show the error page - // I was able to see the error when using a VSCode Playwright plugin that records your actions - await page.waitForLoadState('domcontentloaded'); - await page.reload(); } + // Chrome gets stuck here for an unknown reason, does not happen in real life + // This hack allows the test to continue + // ref: https://github.com/microsoft/playwright/issues/16160 + // I suspect it is an issue with the Supabase callback, but the output in the Playwright UI does not show the error page + // I was able to see the error when using a VSCode Playwright plugin that records your actions + await page.waitForLoadState('domcontentloaded'); + await page.reload(); + // Wait until the page receives the cookies. // // Login flow sets cookies in the process of several redirects. From 96e1ea17e2a724d60296005944de97331070eb0f Mon Sep 17 00:00:00 2001 From: John Alling Date: Wed, 22 May 2024 17:05:28 -0400 Subject: [PATCH 11/26] remove page refresh and add https --- src/leapfrogai_ui/playwright.config.ts | 2 +- src/leapfrogai_ui/tests/auth.setup.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/leapfrogai_ui/playwright.config.ts b/src/leapfrogai_ui/playwright.config.ts index 3a4eb2abe..ab4357cd2 100644 --- a/src/leapfrogai_ui/playwright.config.ts +++ b/src/leapfrogai_ui/playwright.config.ts @@ -60,7 +60,7 @@ const devConfig: PlaywrightTestConfig = { // when e2e testing, use the deployed instance const CI_Config: PlaywrightTestConfig = { use: { - baseURL: 'http://ai.uds.dev' + baseURL: 'https://ai.uds.dev' } }; diff --git a/src/leapfrogai_ui/tests/auth.setup.ts b/src/leapfrogai_ui/tests/auth.setup.ts index 121ec38e6..89a9fffec 100644 --- a/src/leapfrogai_ui/tests/auth.setup.ts +++ b/src/leapfrogai_ui/tests/auth.setup.ts @@ -41,15 +41,15 @@ setup('authenticate', async ({ page, clearDbData }) => { const code = totp.generate(); await page.getByLabel('Six digit code').fill(code); await page.getByRole('button', { name: 'Log In' }).click(); - } - // Chrome gets stuck here for an unknown reason, does not happen in real life - // This hack allows the test to continue - // ref: https://github.com/microsoft/playwright/issues/16160 - // I suspect it is an issue with the Supabase callback, but the output in the Playwright UI does not show the error page - // I was able to see the error when using a VSCode Playwright plugin that records your actions - await page.waitForLoadState('domcontentloaded'); - await page.reload(); + // Chrome gets stuck here for an unknown reason, does not happen in real life + // This hack allows the test to continue + // ref: https://github.com/microsoft/playwright/issues/16160 + // I suspect it is an issue with the Supabase callback, but the output in the Playwright UI does not show the error page + // I was able to see the error when using a VSCode Playwright plugin that records your actions + await page.waitForLoadState('domcontentloaded'); + await page.reload(); + } // Wait until the page receives the cookies. // From e1bc4bb8b927ffa7e3147e641b34ee2e8055e00f Mon Sep 17 00:00:00 2001 From: John Alling Date: Thu, 23 May 2024 11:03:50 -0400 Subject: [PATCH 12/26] change test username --- .github/workflows/e2e.yaml | 2 +- src/leapfrogai_ui/tests/auth.setup.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 4b9ccb2ba..a4d31b35c 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -116,7 +116,7 @@ jobs: - name: UI and Supabase test run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env - TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=http://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration + TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration - name: Cleanup UI run: | diff --git a/src/leapfrogai_ui/tests/auth.setup.ts b/src/leapfrogai_ui/tests/auth.setup.ts index 89a9fffec..81cfd84ee 100644 --- a/src/leapfrogai_ui/tests/auth.setup.ts +++ b/src/leapfrogai_ui/tests/auth.setup.ts @@ -10,7 +10,7 @@ setup('authenticate', async ({ page, clearDbData }) => { // when running in Github CI, create a new account because we don't have seed migrations if (process.env.TEST_ENV === 'CI') { await page.getByPlaceholder('Your email address').click(); - await page.getByPlaceholder('Your email address').fill('user1@test.com'); + await page.getByPlaceholder('Your email address').fill('ci_user@test.com'); await page.getByPlaceholder('Your password').click(); await page.getByPlaceholder('Your password').fill('password123'); await page.getByRole('button', { name: 'Sign Up' }).click(); From 728dd4151b517ba4edadc37ee257e756319db5a8 Mon Sep 17 00:00:00 2001 From: John Alling Date: Fri, 12 Jul 2024 16:16:43 -0400 Subject: [PATCH 13/26] add install steps --- .github/workflows/e2e.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 336731f0e..cff590c2a 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -81,9 +81,9 @@ jobs: run: | uds deploy k3d-core-slim-dev:0.22.2 --confirm - ########## - # Supabase - ########## + ########## + # Supabase + ########## - name: Deploy Supabase run: | make build-supabase LOCAL_VERSION=e2e-test @@ -116,7 +116,9 @@ jobs: - name: UI and Supabase test run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env - TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$API_KEY npm --prefix src/leapfrogai_ui run test:integration + npm --prefix src/leapfrogai_ui ci + npx --prefix src/leapfrogai_ui install + TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration - name: Cleanup UI run: | From 0ecda3b018058067e61795ae600415f9edf2c8c9 Mon Sep 17 00:00:00 2001 From: John Alling Date: Mon, 15 Jul 2024 09:50:37 -0400 Subject: [PATCH 14/26] remove npx install step --- .github/workflows/e2e.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index aa69de548..fa8a6cb4a 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -117,7 +117,6 @@ jobs: run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env npm --prefix src/leapfrogai_ui ci - npx --prefix src/leapfrogai_ui install TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration - name: Cleanup UI From 3063b5cb9cfb4f82b6dc1a24a2530cfaff60d62c Mon Sep 17 00:00:00 2001 From: John Alling Date: Mon, 15 Jul 2024 10:37:36 -0400 Subject: [PATCH 15/26] add run prepare to e2e workflow --- .github/workflows/e2e.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index fa8a6cb4a..190158ba2 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -117,6 +117,7 @@ jobs: run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env npm --prefix src/leapfrogai_ui ci + npm --prefix src/leapfrogai_ui run prepare TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration - name: Cleanup UI From de71975b5eaa673e9cae18a39b1ffe6901b34486 Mon Sep 17 00:00:00 2001 From: John Alling Date: Mon, 15 Jul 2024 11:13:36 -0400 Subject: [PATCH 16/26] add local ui build to CI env --- .github/workflows/e2e.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 190158ba2..f8d9cc8dc 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -117,7 +117,7 @@ jobs: run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env npm --prefix src/leapfrogai_ui ci - npm --prefix src/leapfrogai_ui run prepare + npm --prefix src/leapfrogai_ui run build TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration - name: Cleanup UI From 4ad2e72eb07150d3431eec16f389eeee1eb1d797 Mon Sep 17 00:00:00 2001 From: John Alling Date: Mon, 15 Jul 2024 12:04:49 -0400 Subject: [PATCH 17/26] switch to absolute imports in tests --- .github/workflows/e2e.yaml | 1 - src/leapfrogai_ui/testUtils/fakeData/index.ts | 4 ++-- src/leapfrogai_ui/tests/helpers/assistantHelpers.ts | 4 ++-- src/leapfrogai_ui/tests/rag.test.ts | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index f8d9cc8dc..fa8a6cb4a 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -117,7 +117,6 @@ jobs: run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env npm --prefix src/leapfrogai_ui ci - npm --prefix src/leapfrogai_ui run build TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration - name: Cleanup UI diff --git a/src/leapfrogai_ui/testUtils/fakeData/index.ts b/src/leapfrogai_ui/testUtils/fakeData/index.ts index 7760db90f..08f8ffb50 100644 --- a/src/leapfrogai_ui/testUtils/fakeData/index.ts +++ b/src/leapfrogai_ui/testUtils/fakeData/index.ts @@ -10,12 +10,12 @@ import type { } from 'openai/resources/beta/threads/messages'; import { getUnixSeconds } from '../../src/lib/helpers/dates'; import type { FileObject } from 'openai/resources/files'; -import type { Profile } from '$lib/types/profile'; +import type { Profile } from '../../src/lib/types/profile'; import type { Session } from '@supabase/supabase-js'; import type { Assistant } from 'openai/resources/beta/assistants'; import type { VectorStore } from 'openai/resources/beta/vector-stores/index'; import type { VectorStoreFile } from 'openai/resources/beta/vector-stores/files'; -import { type APIKeyRow, PERMISSIONS } from '$lib/types/apiKeys'; +import { type APIKeyRow, PERMISSIONS } from '../../src/lib/types/apiKeys'; const todayOverride = new Date('2024-03-20T00:00'); diff --git a/src/leapfrogai_ui/tests/helpers/assistantHelpers.ts b/src/leapfrogai_ui/tests/helpers/assistantHelpers.ts index 72ac51a96..51ac3ee6a 100644 --- a/src/leapfrogai_ui/tests/helpers/assistantHelpers.ts +++ b/src/leapfrogai_ui/tests/helpers/assistantHelpers.ts @@ -1,8 +1,8 @@ import OpenAI from 'openai'; import { expect, type Page } from '@playwright/test'; -import { getFakeAssistantInput } from '$testUtils/fakeData'; +import { getFakeAssistantInput } from '../../testUtils/fakeData'; import type { AssistantCreateParams } from 'openai/resources/beta/assistants'; -import type { AssistantInput, LFAssistant } from '$lib/types/assistants'; +import type { AssistantInput, LFAssistant } from '../../src/lib/types/assistants'; import { supabase } from './helpers'; // Note - this will not apply the temperature slider value provided, it only clicks on the 0.5 increment diff --git a/src/leapfrogai_ui/tests/rag.test.ts b/src/leapfrogai_ui/tests/rag.test.ts index 4c0e4fab5..0edeb9eca 100644 --- a/src/leapfrogai_ui/tests/rag.test.ts +++ b/src/leapfrogai_ui/tests/rag.test.ts @@ -1,5 +1,5 @@ import { expect, test } from './fixtures'; -import { getFakeAssistantInput } from '$testUtils/fakeData'; +import { getFakeAssistantInput } from '../testUtils/fakeData'; import { delay } from 'msw'; import { createPDF, From f9b72838a9c9f6e6846d616ee19f4bf22d87a3f7 Mon Sep 17 00:00:00 2001 From: John Alling Date: Wed, 17 Jul 2024 10:24:51 -0400 Subject: [PATCH 18/26] run subset of tests for ci --- .github/workflows/e2e.yaml | 2 +- src/leapfrogai_ui/package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index fa8a6cb4a..36fba8e84 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -117,7 +117,7 @@ jobs: run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env npm --prefix src/leapfrogai_ui ci - TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration + TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration:ci - name: Cleanup UI run: | diff --git a/src/leapfrogai_ui/package.json b/src/leapfrogai_ui/package.json index b7264b976..8e4ca167c 100644 --- a/src/leapfrogai_ui/package.json +++ b/src/leapfrogai_ui/package.json @@ -16,6 +16,7 @@ "format": "prettier --write . && eslint . --fix", "test:integration": "playwright test", "test:integration:ui": "playwright test --ui", + "test:integration:ci": "playwright test tests/global.setup.ts tests/api.test.ts tests/header.test.ts tests/logout.test.ts", "test:unit": "vitest run", "test:unit:watch": "vitest", "prepare": "husky", From 86c3419c64c47b5b7ea38dc13251fe5b26d15dc7 Mon Sep 17 00:00:00 2001 From: John Alling Date: Wed, 17 Jul 2024 10:40:39 -0400 Subject: [PATCH 19/26] change logout url --- src/leapfrogai_ui/tests/logout.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/leapfrogai_ui/tests/logout.test.ts b/src/leapfrogai_ui/tests/logout.test.ts index ba3ad5887..b53dfe99b 100644 --- a/src/leapfrogai_ui/tests/logout.test.ts +++ b/src/leapfrogai_ui/tests/logout.test.ts @@ -6,7 +6,7 @@ test('it can log out', async ({ page }) => { await page.getByLabel('User').click(); await page.getByLabel('Log Out').click(); - await page.waitForURL('http://localhost:4173'); + await page.waitForURL('/'); if (process.env.PUBLIC_DISABLE_KEYCLOAK === 'true') { await expect(page.getByText('Sign In')).toBeVisible(); From ba73a2b547c2f8d7c166f466e4a760880a762719 Mon Sep 17 00:00:00 2001 From: John Alling Date: Wed, 17 Jul 2024 11:21:18 -0400 Subject: [PATCH 20/26] remove deleteAssistants teardown --- src/leapfrogai_ui/tests/global.teardown.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/leapfrogai_ui/tests/global.teardown.ts b/src/leapfrogai_ui/tests/global.teardown.ts index 144612124..2aa44b5a1 100644 --- a/src/leapfrogai_ui/tests/global.teardown.ts +++ b/src/leapfrogai_ui/tests/global.teardown.ts @@ -1,6 +1,7 @@ import { test as teardown } from './fixtures'; import { deleteAllGeneratedFixtureFiles, deleteAllTestFilesWithApi } from './helpers/fileHelpers'; -import { deleteAllAssistants, deleteAssistantAvatars } from './helpers/assistantHelpers'; +//import { deleteAllAssistants, deleteAssistantAvatars } from './helpers/assistantHelpers'; +import { deleteAllAssistants } from './helpers/assistantHelpers'; import { deleteAllTestThreadsWithApi } from './helpers/threadHelpers'; import { deleteAllTestAPIKeys } from './helpers/apiHelpers'; @@ -10,7 +11,7 @@ teardown('teardown', async ({ openAIClient }) => { await deleteAllTestFilesWithApi(openAIClient); await deleteAllAssistants(openAIClient); await deleteAllTestThreadsWithApi(openAIClient); - await deleteAssistantAvatars(); + //await deleteAssistantAvatars(); await deleteAllTestAPIKeys(); console.log('clean up complete'); }); From c7f9c88ada4791631ede7bdc2e6e70673cc3fae3 Mon Sep 17 00:00:00 2001 From: John Alling Date: Wed, 17 Jul 2024 13:19:29 -0400 Subject: [PATCH 21/26] don't run teardown in CI --- src/leapfrogai_ui/tests/global.teardown.ts | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/leapfrogai_ui/tests/global.teardown.ts b/src/leapfrogai_ui/tests/global.teardown.ts index 2aa44b5a1..715079bf5 100644 --- a/src/leapfrogai_ui/tests/global.teardown.ts +++ b/src/leapfrogai_ui/tests/global.teardown.ts @@ -1,17 +1,19 @@ import { test as teardown } from './fixtures'; import { deleteAllGeneratedFixtureFiles, deleteAllTestFilesWithApi } from './helpers/fileHelpers'; -//import { deleteAllAssistants, deleteAssistantAvatars } from './helpers/assistantHelpers'; -import { deleteAllAssistants } from './helpers/assistantHelpers'; +import { deleteAllAssistants, deleteAssistantAvatars } from './helpers/assistantHelpers'; import { deleteAllTestThreadsWithApi } from './helpers/threadHelpers'; import { deleteAllTestAPIKeys } from './helpers/apiHelpers'; -teardown('teardown', async ({ openAIClient }) => { - console.log('cleaning up...'); - deleteAllGeneratedFixtureFiles(); - await deleteAllTestFilesWithApi(openAIClient); - await deleteAllAssistants(openAIClient); - await deleteAllTestThreadsWithApi(openAIClient); - //await deleteAssistantAvatars(); - await deleteAllTestAPIKeys(); - console.log('clean up complete'); -}); +// teardown not necessary in CI testing envs +if (process.env.TEST_ENV !== 'CI') { + teardown('teardown', async ({ openAIClient }) => { + console.log('cleaning up...'); + deleteAllGeneratedFixtureFiles(); + await deleteAllTestFilesWithApi(openAIClient); + await deleteAllAssistants(openAIClient); + await deleteAllTestThreadsWithApi(openAIClient); + await deleteAssistantAvatars(); + await deleteAllTestAPIKeys(); + console.log('clean up complete'); + }); +} From f6720383afd4bd2ff58fc3f541453016f86a16f8 Mon Sep 17 00:00:00 2001 From: John Alling Date: Wed, 17 Jul 2024 13:39:17 -0400 Subject: [PATCH 22/26] add API into playwright CI tests --- .github/workflows/e2e.yaml | 29 +++++++++++++++-------------- src/leapfrogai_ui/package.json | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 36fba8e84..254291612 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -112,6 +112,21 @@ jobs: uds zarf package deploy packages/ui/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst --confirm rm packages/ui/zarf-package-leapfrogai-ui-amd64-e2e-test.tar.zst + ########## + # API + ########## + - name: Deploy LFAI-API + run: | + make build-api LOCAL_VERSION=e2e-test + docker image prune -af + uds zarf package deploy packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst --confirm + rm packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst + + - name: Test API + run: | + python -m pip install requests + python -m pytest ./tests/e2e/test_api.py -v + # Run the playwright UI tests using the deployed Supabase endpoint - name: UI and Supabase test run: | @@ -128,20 +143,6 @@ jobs: run: | uds zarf package remove supabase -l=trace --confirm - ########## - # API - ########## - - name: Deploy LFAI-API - run: | - make build-api LOCAL_VERSION=e2e-test - docker image prune -af - uds zarf package deploy packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst --confirm - rm packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst - - - name: Test API - run: | - python -m pip install requests - python -m pytest ./tests/e2e/test_api.py -v ########## # llama diff --git a/src/leapfrogai_ui/package.json b/src/leapfrogai_ui/package.json index 8e4ca167c..a7c7446d8 100644 --- a/src/leapfrogai_ui/package.json +++ b/src/leapfrogai_ui/package.json @@ -16,7 +16,7 @@ "format": "prettier --write . && eslint . --fix", "test:integration": "playwright test", "test:integration:ui": "playwright test --ui", - "test:integration:ci": "playwright test tests/global.setup.ts tests/api.test.ts tests/header.test.ts tests/logout.test.ts", + "test:integration:ci": "playwright test tests/global.setup.ts tests/api.test.ts tests/api-keys.test.ts tests/header.test.ts tests/logout.test.ts", "test:unit": "vitest run", "test:unit:watch": "vitest", "prepare": "husky", From a67bf9fc76fd659752d7d5227eb7031eee331a39 Mon Sep 17 00:00:00 2001 From: John Alling Date: Wed, 17 Jul 2024 14:06:36 -0400 Subject: [PATCH 23/26] remove redundant supabase delete --- .github/workflows/e2e.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 254291612..5ee56e782 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -128,22 +128,17 @@ jobs: python -m pytest ./tests/e2e/test_api.py -v # Run the playwright UI tests using the deployed Supabase endpoint - - name: UI and Supabase test + - name: UI/API/Supabase E2E Playwright Tests run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env npm --prefix src/leapfrogai_ui ci TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration:ci + # The UI can be removed after the Playwright tests are finished - name: Cleanup UI run: | uds zarf package remove leapfrogai-ui --confirm - # Supabase can now be removed since we're done testing it - - name: Cleanup Supabase - run: | - uds zarf package remove supabase -l=trace --confirm - - ########## # llama ########## From c2f3a2d9c75c26df5b1fe833ead513f3afc205af Mon Sep 17 00:00:00 2001 From: John Alling Date: Wed, 17 Jul 2024 14:45:39 -0400 Subject: [PATCH 24/26] remove redundant npm install --- .github/workflows/e2e.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 5ee56e782..827a44500 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -131,8 +131,7 @@ jobs: - name: UI/API/Supabase E2E Playwright Tests run: | cp src/leapfrogai_ui/.env.example src/leapfrogai_ui/.env - npm --prefix src/leapfrogai_ui ci - TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_URL=https://supabase-kong.uds.dev PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration:ci + TEST_ENV=CI PUBLIC_DISABLE_KEYCLOAK=true PUBLIC_SUPABASE_ANON_KEY=$ANON_KEY npm --prefix src/leapfrogai_ui run test:integration:ci # The UI can be removed after the Playwright tests are finished - name: Cleanup UI From 0465f40b924637b84bbe1e4f57304828ab666246 Mon Sep 17 00:00:00 2001 From: John Alling Date: Wed, 17 Jul 2024 14:55:35 -0400 Subject: [PATCH 25/26] minor spelling fix --- .github/workflows/e2e.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 827a44500..7e9f1e8e1 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -92,7 +92,7 @@ jobs: uds zarf package deploy packages/supabase/zarf-package-supabase-amd64-e2e-test.tar.zst --confirm rm packages/supabase/zarf-package-supabase-amd64-e2e-test.tar.zst - - name: Set environment variables + - name: Set environment variable id: set-env-var run: | echo "ANON_KEY=$(uds zarf tools kubectl get secret supabase-bootstrap-jwt -n leapfrogai -o jsonpath='{.data.anon-key}' | base64 -d)" >> "$GITHUB_ENV" From 35ca3d566a9d40a3bac5136f5562dddf38410691 Mon Sep 17 00:00:00 2001 From: John Alling Date: Thu, 18 Jul 2024 09:53:18 -0400 Subject: [PATCH 26/26] remove default test params and slight name change --- src/leapfrogai_ui/playwright.config.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/leapfrogai_ui/playwright.config.ts b/src/leapfrogai_ui/playwright.config.ts index 652aacf49..eb599e436 100644 --- a/src/leapfrogai_ui/playwright.config.ts +++ b/src/leapfrogai_ui/playwright.config.ts @@ -52,9 +52,7 @@ const defaultConfig: PlaywrightTestConfig = { testMatch: /global\.teardown\.ts/ }, { ...chromeConfig } - ], - testDir: 'tests', - testMatch: /(.+\.)?(test|spec)\.[jt]s/ + ] }; // when in dev, create a local webserver @@ -77,7 +75,7 @@ const CI_Config: PlaywrightTestConfig = { }; // get the environment type from command line. If none, set it to dev -const environment = process.env.TEST_ENV || 'dev'; +const environment = process.env.TEST_ENV || 'development'; // config object with default configuration and environment specific configuration const config: PlaywrightTestConfig = {