Skip to content

Commit 3a58471

Browse files
committed
add _requiresAuth to page models
1 parent 2b06e77 commit 3a58471

4 files changed

Lines changed: 5 additions & 0 deletions

File tree

testing/e2e/src/pages/__root.page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import type { NavigateArgs, RouteTo } from '../helpers/types';
66
export abstract class RootPage {
77
readonly $ref: Page;
88

9+
abstract readonly _requiresAuth: boolean;
10+
911
constructor(page: Page) {
1012
this.$ref = page;
1113
}

testing/e2e/src/pages/_app.page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Locator, Page } from '@playwright/test';
33
import { RootPage } from './__root.page';
44

55
export abstract class AppPage extends RootPage {
6+
readonly _requiresAuth = true;
67
readonly sidebar: Locator;
78

89
constructor(page: Page) {

testing/e2e/src/pages/auth/login.page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Locator, Page } from '@playwright/test';
44
import { RootPage } from '../__root.page';
55

66
export class LoginPage extends RootPage {
7+
readonly _requiresAuth = false;
78
readonly loginForm: Locator;
89

910
constructor(page: Page) {

testing/e2e/src/pages/setup.page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Locator, Page } from '@playwright/test';
44
import { RootPage } from './__root.page';
55

66
export class SetupPage extends RootPage {
7+
readonly _requiresAuth = false;
78
readonly setupForm: Locator;
89

910
constructor(page: Page) {

0 commit comments

Comments
 (0)