-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathProfilingUiHelper.ts
27 lines (22 loc) · 1008 Bytes
/
ProfilingUiHelper.ts
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
import {Page, Locator, expect} from "@playwright/test";
import {UiBaseLocators} from "./UiBaseLocators";
export class ProfilingUiHelper extends UiBaseLocators {
private readonly profilingTab: Locator;
private readonly activateProfilerByDefaultToggle: Locator;
private readonly activateProfilerByDefaultCheckbox: Locator;
constructor(page: Page) {
super(page);
this.profilingTab = page.getByRole('tab', {name: 'Profiling'});
this.activateProfilerByDefaultToggle = page.locator("[label='Activate the profiler by default'] #toggle");
this.activateProfilerByDefaultCheckbox = page.getByLabel('Activate the profiler by default');
}
async clickProfilingTab() {
await this.profilingTab.click();
}
async clickActivateProfilerByDefaultToggle() {
await this.activateProfilerByDefaultToggle.click();
}
async isActivateProfilerByDefaultToggleChecked(isChecked: boolean) {
return expect(this.activateProfilerByDefaultCheckbox).toBeChecked({checked: isChecked});
}
}