mirror of
https://github.com/bitwarden/browser
synced 2026-02-18 02:19:18 +00:00
Require password in singleUserScene
This commit is contained in:
@@ -11,10 +11,10 @@ test.skip("login and save session", async ({ auth }) => {
|
||||
await expectUnlockedAs(scene.mangle("test@example.com"), page);
|
||||
});
|
||||
|
||||
test.skip("As long as the previous test ran in this worker, this time it will reuse authentication", async ({
|
||||
test.only("As long as the previous test ran in this worker, this time it will reuse authentication", async ({
|
||||
auth,
|
||||
}) => {
|
||||
const { page, scene } = await auth.authenticate("test@example.com", "asdfasdfasdf");
|
||||
const { page, scene } = await auth.authenticate("test@example.com", "passwordpassword");
|
||||
|
||||
await expectUnlockedAs(scene.mangle("test@example.com"), page);
|
||||
});
|
||||
|
||||
@@ -46,7 +46,9 @@ type AuthenticatedContext = {
|
||||
scene: SingleUserScene;
|
||||
};
|
||||
|
||||
type SessionOptions = Simplify<Except<extractTUpType<SingleUserSceneTemplate>, "email">> & {
|
||||
type SessionOptions = Simplify<
|
||||
Except<extractTUpType<SingleUserSceneTemplate>, "email" | "password">
|
||||
> & {
|
||||
/** The page to use for authenticating */
|
||||
page?: Page;
|
||||
};
|
||||
@@ -158,7 +160,7 @@ export class AuthFixture {
|
||||
password: string,
|
||||
options: SessionOptions = {},
|
||||
): Promise<AuthenticatedContext> {
|
||||
const scene = await Play.scene(new SingleUserSceneTemplate({ ...options, email }));
|
||||
const scene = await Play.scene(new SingleUserSceneTemplate({ ...options, email, password }));
|
||||
|
||||
return await this.authenticateForScene(scene, password);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ type SceneResult = {
|
||||
};
|
||||
type UpParams = {
|
||||
email: string;
|
||||
password: string;
|
||||
emailVerified?: boolean;
|
||||
premium?: boolean;
|
||||
};
|
||||
|
||||
@@ -67,7 +67,7 @@ export async function cleanStage(): Promise<void> {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
"PLAYWRIGHT_SKIP_CLEAN_STAGE is set, run\n",
|
||||
`curl -X DELETE ${new URL(playId, webServerBaseUrl).toString()}\n`,
|
||||
`curl -X DELETE ${new URL(`/seed/${playId}`, webServerBaseUrl).toString()}\n`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user