mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-18 09:35:20 +02:00
26 lines
651 B
TypeScript
26 lines
651 B
TypeScript
|
|
import { Page, Locator } from '@playwright/test';
|
|
|
|
export default class SettingsScreen {
|
|
public readonly okayButton: Locator;
|
|
public readonly appearanceTabButton: Locator;
|
|
|
|
public constructor(private page: Page) {
|
|
this.okayButton = page.locator('button', { hasText: 'OK' });
|
|
this.appearanceTabButton = this.getTabLocator('Appearance');
|
|
}
|
|
|
|
public getTabLocator(tabName: string) {
|
|
return this.page.getByRole('tab', { name: tabName });
|
|
}
|
|
|
|
public getLastTab() {
|
|
return this.page.getByRole('tablist').getByRole('tab').last();
|
|
}
|
|
|
|
public async waitFor() {
|
|
await this.okayButton.waitFor();
|
|
await this.appearanceTabButton.waitFor();
|
|
}
|
|
}
|