-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathWelcomeGuidePage.ts
More file actions
58 lines (52 loc) · 1.75 KB
/
Copy pathWelcomeGuidePage.ts
File metadata and controls
58 lines (52 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { Page, Locator } from '@playwright/test';
import { BasePage } from './BasePage';
/**
* Welcome Guide overlay page object
*/
export class WelcomeGuidePage extends BasePage {
readonly overlay: Locator;
readonly card: Locator;
readonly title: Locator;
readonly description: Locator;
readonly stepCount: Locator;
readonly stepIndicator: Locator;
readonly details: Locator;
readonly tip: Locator;
readonly icon: Locator;
readonly nextButton: Locator;
readonly backButton: Locator;
readonly skipButton: Locator;
constructor(page: Page) {
super(page);
this.overlay = page.getByTestId('welcome-guide-overlay');
this.card = page.getByTestId('welcome-guide-card');
this.title = page.getByTestId('welcome-guide-title');
this.description = page.getByTestId('welcome-guide-description');
this.stepCount = page.getByTestId('welcome-guide-step-count');
this.stepIndicator = page.getByTestId('welcome-guide-step-indicator');
this.details = page.getByTestId('welcome-guide-details');
this.tip = page.getByTestId('welcome-guide-tip');
this.icon = page.getByTestId('welcome-guide-icon');
this.nextButton = page.getByTestId('welcome-guide-next-btn');
this.backButton = page.getByTestId('welcome-guide-back-btn');
this.skipButton = page.getByTestId('welcome-guide-skip-btn');
}
async navigate() {
await this.goto('/');
await this.waitForLoad();
}
async goToStep(stepNumber: number) {
for (let i = 0; i < stepNumber - 1; i++) {
await this.nextButton.click();
}
}
async dismiss() {
await this.skipButton.click();
}
async completeAllSteps() {
// Navigate through all 5 steps and click Get Started
for (let i = 0; i < 5; i++) {
await this.nextButton.click();
}
}
}