-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chore) Add UI Playwright Tests to E2E Workflow (#551)
* add playwright tests to e2e workflow * add UI zarf deployment to e2e workflow
- Loading branch information
Showing
9 changed files
with
97 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,24 @@ import * as OTPAuth from 'otpauth'; | |
const authFile = 'playwright/.auth/user.json'; | ||
|
||
setup('authenticate', async ({ page }) => { | ||
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(); | ||
await page.getByPlaceholder('Your email address').click(); | ||
await page.getByPlaceholder('Your email address').fill('[email protected]'); | ||
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('[email protected]'); | ||
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('[email protected]'); | ||
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(); | ||
|
@@ -37,7 +46,7 @@ setup('authenticate', async ({ page }) => { | |
// | ||
// 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(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters