38 lines
864 B
JavaScript
38 lines
864 B
JavaScript
class TimingComponent {
|
|
constructor(website) {
|
|
this.website = website;
|
|
}
|
|
|
|
attackTimeInput() {
|
|
return this.formNumberInput('Attack Time');
|
|
}
|
|
|
|
travelTimeInput() {
|
|
return this.formNumberInput('Travel Time');
|
|
}
|
|
|
|
formNumberInput(label) {
|
|
return this.website.locator(`.formNumberContainer`).filter({ hasText: label }).locator('input[type="number"]');
|
|
}
|
|
|
|
async setAttackTime(value) {
|
|
await this.attackTimeInput().fill(String(value));
|
|
await this.attackTimeInput().press('Enter');
|
|
}
|
|
|
|
async setTravelTime(value) {
|
|
await this.travelTimeInput().fill(String(value));
|
|
await this.travelTimeInput().press('Enter');
|
|
}
|
|
|
|
async getAttackTime() {
|
|
return await this.attackTimeInput().inputValue();
|
|
}
|
|
|
|
async getTravelTime() {
|
|
return await this.travelTimeInput().inputValue();
|
|
}
|
|
}
|
|
|
|
module.exports = TimingComponent;
|