mirror of
https://github.com/penpot/penpotqa.git
synced 2024-08-04 09:28:54 +00:00
26 lines
551 B
JavaScript
26 lines
551 B
JavaScript
exports.BasePage = class BasePage {
|
|
/**
|
|
* @param {import('@playwright/test').Page} page
|
|
*/
|
|
constructor(page) {
|
|
this.page = page;
|
|
this.header = page.locator('div[class="dashboard-title"] h1');
|
|
}
|
|
|
|
async clearInput(input) {
|
|
await input.click();
|
|
let text = await input.inputValue();
|
|
for (let i = 0; i <= text.length; i++) {
|
|
await this.page.keyboard.press("Backspace");
|
|
}
|
|
}
|
|
|
|
async reloadPage() {
|
|
await this.page.reload();
|
|
}
|
|
|
|
async clickOnEnter() {
|
|
await this.page.keyboard.press("Enter");
|
|
}
|
|
};
|