1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-06-03 01:13:57 +00:00

Fix playwright tests

This commit is contained in:
Timshel 2025-03-19 19:48:00 +01:00
parent c680cfe6c9
commit ffff75add5
8 changed files with 26 additions and 55 deletions

View file

@ -18,11 +18,7 @@ export async function logNewUser(
await test.step('Landing page', async () => {
await page.goto('/');
await page.getByLabel(/Email address/).fill(user.email);
await page.getByRole('button', 'Continue').click();
});
await test.step('SSo start page', async () => {
await page.getByRole('link', { name: /Enterprise single sign-on/ }).click();
await page.getByRole('button', { name: /Use single sign-on/ }).click();
});
await test.step('Keycloak login', async () => {
@ -33,10 +29,10 @@ export async function logNewUser(
});
await test.step('Create Vault account', async () => {
await expect(page.getByText('Set master password')).toBeVisible();
await page.getByLabel('Master password', { exact: true }).fill(user.password);
await page.getByLabel('Re-type master password').fill(user.password);
await page.getByRole('button', { name: 'Submit' }).click();
await expect(page.getByRole('heading', { name: 'Join organisation' })).toBeVisible();
await page.getByLabel('Master password (required)', { exact: true }).fill(user.password);
await page.getByLabel('Confirm master password (').fill(user.password);
await page.getByRole('button', { name: 'Create account' }).click();
});
await test.step('Default vault page', async () => {
@ -73,11 +69,7 @@ export async function logUser(
await test.step('Landing page', async () => {
await page.goto('/');
await page.getByLabel(/Email address/).fill(user.email);
await page.getByRole('button', 'Continue').click();
});
await test.step('SSo start page', async () => {
await page.getByRole('link', { name: /Enterprise single sign-on/ }).click();
await page.getByRole('button', { name: /Use single sign-on/ }).click();
});
await test.step('Keycloak login', async () => {

View file

@ -13,12 +13,15 @@ export async function createAccount(test, page: Page, user: { email: string, nam
await expect(page).toHaveTitle(/Create account | Vaultwarden Web/);
await page.getByLabel(/Email address/).fill(user.email);
await page.getByLabel('Name').fill(user.name);
await page.getByLabel('Master password\n (required)', { exact: true }).fill(user.password);
await page.getByLabel('Re-type master password').fill(user.password);
await page.getByRole('button', { name: 'Continue' }).click();
// Vault finish Creation
await page.getByLabel('Master password (required)', { exact: true }).fill(user.password);
await page.getByLabel('Confirm master password (').fill(user.password);
await page.getByRole('button', { name: 'Create account' }).click();
// Back to the login page
await expect(page).toHaveTitle('Vaultwarden Web');
// We are now in the default vault page
await expect(page).toHaveTitle('Vaults | Vaultwarden Web');
await utils.checkNotification(page, 'Your new account has been created');
if( mailBuffer ){