Playwright start

This commit is contained in:
2026-05-30 10:04:12 -04:00
parent 73f29cea08
commit 1f7a0819fc
108 changed files with 37445 additions and 62 deletions
@@ -0,0 +1,68 @@
class OptionsComponent {
constructor(page) {
this.page = page;
}
buildingInputDelayInput() {
return this.formNumberInput('Building Input Delay');
}
waitTimeInput() {
return this.formNumberInput('Wait Time');
}
waitToInput() {
return this.formNumberInput('Wait To');
}
addWaitButton() {
return this.buttonWithLabel('Add Wait').first();
}
addWaitToButton() {
return this.buttonWithLabel('Add Wait').last();
}
formNumberInput(label) {
return this.page.locator(`.formNumberContainer`).filter({ hasText: label }).locator('input[type="number"]');
}
buttonWithLabel(label) {
return this.page.locator('button').filter({ hasText: label });
}
async setBuildingInputDelay(value) {
await this.buildingInputDelayInput().fill(String(value));
await this.buildingInputDelayInput().press('Enter');
}
async setWaitTime(value) {
await this.waitTimeInput().fill(String(value));
}
async setWaitTo(value) {
await this.waitToInput().fill(String(value));
}
async clickAddWait() {
await this.addWaitButton().click();
}
async clickAddWaitTo() {
await this.addWaitToButton().click();
}
async getBuildingInputDelay() {
return await this.buildingInputDelayInput().inputValue();
}
async getWaitTime() {
return await this.waitTimeInput().inputValue();
}
async getWaitTo() {
return await this.waitToInput().inputValue();
}
}
module.exports = OptionsComponent;