Skip to content

Commit

Permalink
update login page object flow and text selector checking (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
dualcnhq authored Jan 17, 2025
1 parent c2b9e71 commit b3fd848
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const reportName = () => `${process.env.CATEGORY}/${formattedDateTime()}`;
export default defineConfig({
workers: 5,
// Timeout for each test
timeout: 3 * 60 * 1000, // 3 mins
timeout: 5 * 60 * 1000, // 5 mins
// Maximum time the whole test suite can run
globalTimeout: 20 * 60 * 1000, // 20 mins
testDir: './tests',
Expand Down
8 changes: 3 additions & 5 deletions tests/page-objects/login-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ export class LoginPage {
}

async assertAccountSettingsDisplayed() {
await this.page.waitForTimeout(3000);

await this.page.goto(accountSettings.url);
await this.page.waitForLoadState('networkidle', { timeout: 60000 });
await this.page.waitForURL(/settings=1/);

await expect(this.authTemplate).toBeVisible();

Expand All @@ -50,7 +48,7 @@ export class LoginPage {
).toBe('Account settings');

expect(await this.authTemplate.locator('form > p').innerText()).toBe(
'Please verify your password to access account settings.',
'To access your account settings, as an extra security measure, please enter your password.',
);

expect(
Expand All @@ -64,7 +62,7 @@ export class LoginPage {

async notLoggedIn() {
await this.page.goto(accountSettings.url);
await this.page.waitForLoadState('networkidle', { timeout: 60000 });
await this.page.waitForURL(/settings=1/);

await expect(this.authTemplate).not.toBeVisible();
expect(
Expand Down

0 comments on commit b3fd848

Please sign in to comment.