69 lines
1.4 KiB
JavaScript
69 lines
1.4 KiB
JavaScript
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;
|