|
|
@ -29,8 +29,8 @@ test('SSO login', async ({ page }) => { |
|
|
|
test('Non SSO login', async ({ page }) => { |
|
|
|
// Landing page
|
|
|
|
await page.goto('/'); |
|
|
|
await page.getByLabel(/Email address/).fill(users.user1.email); |
|
|
|
await page.getByRole('button', { name: 'Continue' }).click(); |
|
|
|
await page.locator("input[type=email].vw-email-sso").fill(users.user1.email); |
|
|
|
await page.getByRole('button', { name: 'Other' }).click(); |
|
|
|
|
|
|
|
// Unlock page
|
|
|
|
await page.getByLabel('Master password').fill(users.user1.password); |
|
|
@ -58,20 +58,12 @@ test('Non SSO login impossible', async ({ page, browser }, testInfo: TestInfo) = |
|
|
|
|
|
|
|
// Landing page
|
|
|
|
await page.goto('/'); |
|
|
|
await page.getByLabel(/Email address/).fill(users.user1.email); |
|
|
|
|
|
|
|
// Check that SSO login is available
|
|
|
|
await expect(page.getByRole('button', { name: /Use single sign-on/ })).toHaveCount(1); |
|
|
|
|
|
|
|
await page.getByLabel(/Email address/).fill(users.user1.email); |
|
|
|
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(); |
|
|
|
|
|
|
|
// An error should appear
|
|
|
|
await page.getByLabel('SSO sign-in is required') |
|
|
|
// No Continue/Other
|
|
|
|
await expect(page.getByRole('button', { name: 'Other' })).toHaveCount(0); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -82,13 +74,12 @@ test('No SSO login', async ({ page }, testInfo: TestInfo) => { |
|
|
|
|
|
|
|
// Landing page
|
|
|
|
await page.goto('/'); |
|
|
|
await page.getByLabel(/Email address/).fill(users.user1.email); |
|
|
|
|
|
|
|
// No SSO button (rely on a correct selector checked in previous test)
|
|
|
|
await page.getByLabel('Master password'); |
|
|
|
await expect(page.getByRole('button', { name: /Use single sign-on/ })).toHaveCount(0); |
|
|
|
|
|
|
|
// Can continue to Master password
|
|
|
|
await page.getByLabel(/Email address/).fill(users.user1.email); |
|
|
|
await page.getByRole('button', { name: 'Continue' }).click(); |
|
|
|
await expect(page.getByRole('button', { name: /Log in with master password/ })).toHaveCount(1); |
|
|
|
await expect(page.getByRole('button', { name: 'Log in with master password' })).toHaveCount(1); |
|
|
|
}); |
|
|
|