-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
182 additions
and
169 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules/ | |
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
temp |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,21 +1,54 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { test, expect, type TestInfo } from '@playwright/test'; | ||
const utils = require('../global-utils'); | ||
const { create_account, login } = require('./login-common'); | ||
|
||
utils.loadEnv(); | ||
|
||
var proc; | ||
|
||
test.beforeAll('Setup', async ({ browser }) => { | ||
proc = await utils.startVaultWarden(browser, { | ||
SSO_ENABLED: false | ||
}); | ||
test.beforeAll('Setup', async ({ browser }, testInfo: TestInfo) => { | ||
proc = await utils.startVaultwarden(browser, testInfo, {}); | ||
}); | ||
|
||
test.afterAll('Teardown', async () => { | ||
utils.stopVaultWarden(proc); | ||
test.afterAll('Teardown', async ({}, testInfo: TestInfo) => { | ||
utils.stopVaultwarden(proc, testInfo); | ||
}); | ||
|
||
test('Account creation', create_account); | ||
test('Account creation', async ({ page }) => { | ||
// Landing page | ||
await page.goto('/'); | ||
await page.getByRole('link', { name: 'Create account' }).click(); | ||
|
||
test('Master password login', login); | ||
// Back to Vault create account | ||
await expect(page).toHaveTitle(/Create account | Vaultwarden Web/); | ||
await page.getByLabel(/Email address/).fill(process.env.TEST_USER_MAIL); | ||
await page.getByLabel('Name').fill(process.env.TEST_USER); | ||
await page.getByLabel('Master password\n (required)', { exact: true }).fill('Master password'); | ||
await page.getByLabel('Re-type master password').fill('Master password'); | ||
await page.getByRole('button', { name: 'Create account' }).click(); | ||
|
||
// Back to the login page | ||
await expect(page).toHaveTitle('Vaultwarden Web'); | ||
await page.getByLabel('Your new account has been created') | ||
await page.getByRole('button', { name: 'Continue' }).click(); | ||
|
||
// Unlock page | ||
await page.getByLabel('Master password').fill('Master password'); | ||
await page.getByRole('button', { name: 'Log in with master password' }).click(); | ||
|
||
// We are now in the default vault page | ||
await expect(page).toHaveTitle(/Vaults/); | ||
}); | ||
|
||
test('Master password login', async ({ page }) => { | ||
// Landing page | ||
await page.goto('/'); | ||
await page.getByLabel(/Email address/).fill(process.env.TEST_USER_MAIL); | ||
await page.getByRole('button', { name: 'Continue' }).click(); | ||
|
||
// Unlock page | ||
await page.getByLabel('Master password').fill('Master password'); | ||
await page.getByRole('button', { name: 'Log in with master password' }).click(); | ||
|
||
// We are now in the default vault page | ||
await expect(page).toHaveTitle(/Vaults/); | ||
}); |
Oops, something went wrong.