diff --git a/playwright/tests/collection.spec.ts b/playwright/tests/collection.spec.ts index ef67e738..8e1991f5 100644 --- a/playwright/tests/collection.spec.ts +++ b/playwright/tests/collection.spec.ts @@ -15,7 +15,6 @@ test.afterAll('Teardown', async ({}) => { test('Create', async ({ page }) => { await createAccount(test, page, users.user1); - await logUser(test, page, users.user1); await test.step('Create Org', async () => { await page.getByRole('link', { name: 'New organisation' }).click(); diff --git a/playwright/tests/login.spec.ts b/playwright/tests/login.spec.ts index b21ab537..59c314b5 100644 --- a/playwright/tests/login.spec.ts +++ b/playwright/tests/login.spec.ts @@ -16,17 +16,7 @@ test.afterAll('Teardown', async ({}, testInfo: TestInfo) => { }); test('Account creation', async ({ page }) => { - // Landing page await createAccount(test, page, users.user1); - - await page.getByRole('button', { name: 'Continue' }).click(); - - // Unlock page - await page.getByLabel('Master password').fill(users.user1.password); - await page.getByRole('button', { name: 'Log in with master password' }).click(); - - // We are now in the default vault page - await expect(page).toHaveTitle(/Vaultwarden Web/); }); test('Master password login', async ({ page }) => { diff --git a/playwright/tests/organization.smtp.spec.ts b/playwright/tests/organization.smtp.spec.ts index f2e8c757..3f4c999b 100644 --- a/playwright/tests/organization.smtp.spec.ts +++ b/playwright/tests/organization.smtp.spec.ts @@ -38,7 +38,6 @@ test('Create user3', async ({ page }) => { test('Invite users', async ({ page }) => { await createAccount(test, page, users.user1, mail1Buffer); - await logUser(test, page, users.user1, mail1Buffer); await orgs.create(test, page, 'Test'); await orgs.members(test, page, 'Test'); @@ -57,25 +56,15 @@ test('invited with new account', async ({ page }) => { await page.goto(link); await expect(page).toHaveTitle(/Create account | Vaultwarden Web/); - await page.getByLabel('Name').fill(users.user2.name); - await page.getByLabel('Master password\n (required)', { exact: true }).fill(users.user2.password); - await page.getByLabel('Re-type master password').fill(users.user2.password); + //await page.getByLabel('Name').fill(users.user2.name); + await page.getByLabel('Master password (required)', { exact: true }).fill(users.user2.password); + await page.getByLabel('Confirm master password (').fill(users.user2.password); await page.getByRole('button', { name: 'Create account' }).click(); - - // Back to the login page await utils.checkNotification(page, 'Your new account has been created'); - }); - await test.step('Login', async () => { - await page.getByLabel(/Email address/).fill(users.user2.email); - await page.getByRole('button', { name: 'Continue' }).click(); - - // Unlock page - await page.getByLabel('Master password').fill(users.user2.password); - await page.getByRole('button', { name: 'Log in with master password' }).click(); - - // We are now in the default vault page - await expect(page).toHaveTitle(/Vaultwarden Web/); + // Redirected to the vault + await expect(page).toHaveTitle('Vaults | Vaultwarden Web'); + await utils.checkNotification(page, 'You have been logged in!'); await utils.checkNotification(page, 'Invitation accepted'); }); diff --git a/playwright/tests/organization.spec.ts b/playwright/tests/organization.spec.ts index 0267549b..2750257e 100644 --- a/playwright/tests/organization.spec.ts +++ b/playwright/tests/organization.spec.ts @@ -20,7 +20,6 @@ test('Create user3', async ({ page }) => { test('Invite users', async ({ page }) => { await createAccount(test, page, users.user1); - await logUser(test, page, users.user1); await test.step('Create Org', async () => { await page.getByRole('link', { name: 'New organisation' }).click(); diff --git a/playwright/tests/setups/sso.ts b/playwright/tests/setups/sso.ts index 8b0b43ff..52438bd2 100644 --- a/playwright/tests/setups/sso.ts +++ b/playwright/tests/setups/sso.ts @@ -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 () => { diff --git a/playwright/tests/setups/user.ts b/playwright/tests/setups/user.ts index db8db86a..b9f79eb9 100644 --- a/playwright/tests/setups/user.ts +++ b/playwright/tests/setups/user.ts @@ -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 ){ diff --git a/playwright/tests/sso_login.spec.ts b/playwright/tests/sso_login.spec.ts index efbe8c68..22cc23ad 100644 --- a/playwright/tests/sso_login.spec.ts +++ b/playwright/tests/sso_login.spec.ts @@ -55,9 +55,6 @@ test('Non SSO login impossible', async ({ page, browser }, testInfo: TestInfo) = // An error should appear await page.getByLabel('SSO sign-in is required') - - // Check the selector for the next test - await expect(page.getByRole('link', { name: /Enterprise single sign-on/ })).toHaveCount(1); }); diff --git a/playwright/tests/sso_organization.smtp.spec.ts b/playwright/tests/sso_organization.smtp.spec.ts index c3586fc4..03b08707 100644 --- a/playwright/tests/sso_organization.smtp.spec.ts +++ b/playwright/tests/sso_organization.smtp.spec.ts @@ -89,15 +89,17 @@ test('invited with new account', async ({ page }) => { }); await test.step('Create Vault account', async () => { - await expect(page.getByText('Set master password')).toBeVisible(); - await page.getByLabel('Master password', { exact: true }).fill(users.user2.password); - await page.getByLabel('Re-type master password').fill(users.user2.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(users.user2.password); + await page.getByLabel('Confirm master password (').fill(users.user2.password); + await page.getByRole('button', { name: 'Create account' }).click(); }); await test.step('Default vault page', async () => { await expect(page).toHaveTitle(/Vaultwarden Web/); - // await utils.checkNotification(page, 'Invitation accepted'); + + await utils.checkNotification(page, 'Account successfully created!'); + await utils.checkNotification(page, 'Invitation accepted'); }); await test.step('Check mails', async () => {