-
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Add test for guest to logged in user migration (#1544)
- Loading branch information
Showing
8 changed files
with
64 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
import { getCode } from "./utils"; | ||
|
||
export class LoginPage { | ||
constructor(private readonly page: Page) {} | ||
|
||
async goto() { | ||
await this.page.goto("/login"); | ||
await this.page.getByText("Welcome").waitFor(); | ||
} | ||
|
||
async login({ email }: { email: string }) { | ||
// Fill in registration form | ||
await this.page.getByPlaceholder("[email protected]").fill(email); | ||
|
||
await this.page | ||
.getByRole("button", { name: "Continue with Email", exact: true }) | ||
.click(); | ||
|
||
// Handle verification code | ||
const code = await getCode(email); | ||
await this.page.getByText("Finish Logging In").waitFor(); | ||
await this.page.getByPlaceholder("Enter your 6-digit code").fill(code); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ export class RegisterPage { | |
} | ||
|
||
async register({ name, email }: { name: string; email: string }) { | ||
await this.goto(); | ||
// Fill in registration form | ||
await this.page.getByPlaceholder("Jessie Smith").fill(name); | ||
await this.page.getByPlaceholder("[email protected]").fill(email); | ||
|
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