mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-10-04 07:20:31 +00:00
Playwright tests improvements
This commit is contained in:
parent
cbdf403ef0
commit
a6c8fb742d
10 changed files with 105 additions and 119 deletions
|
@ -6,7 +6,15 @@ import * as utils from '../../global-utils';
|
|||
export async function createAccount(test, page: Page, user: { email: string, name: string, password: string }, mailBuffer?: MailBuffer) {
|
||||
await test.step('Create user', async () => {
|
||||
// Landing page
|
||||
await page.goto('/');
|
||||
await page.goto('/', { waitUntil: 'domcontentloaded' });
|
||||
await expect(page.getByRole('button').nth(0)).toBeVisible();
|
||||
|
||||
const logged = await page.getByRole('button', { name: 'Log out' }).count();
|
||||
if( logged > 0 ){
|
||||
await page.getByRole('button', { name: 'Log out' }).click();
|
||||
await page.getByRole('button', { name: 'Log out' }).click();
|
||||
}
|
||||
|
||||
await page.getByRole('link', { name: 'Create account' }).click();
|
||||
|
||||
// Back to Vault create account
|
||||
|
@ -33,7 +41,15 @@ export async function createAccount(test, page: Page, user: { email: string, nam
|
|||
export async function logUser(test, page: Page, user: { email: string, password: string }, mailBuffer?: MailBuffer) {
|
||||
await test.step('Log user', async () => {
|
||||
// Landing page
|
||||
await page.goto('/');
|
||||
await page.goto('/', { waitUntil: 'domcontentloaded' });
|
||||
await expect(page.getByRole('button').nth(0)).toBeVisible();
|
||||
|
||||
const logged = await page.getByRole('button', { name: 'Log out' }).count();
|
||||
if( logged > 0 ){
|
||||
await page.getByRole('button', { name: 'Log out' }).click();
|
||||
await page.getByRole('button', { name: 'Log out' }).click();
|
||||
}
|
||||
|
||||
await page.getByLabel(/Email address/).fill(user.email);
|
||||
await page.getByRole('button', { name: 'Continue' }).click();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue