Files
IGP-Fan-Reference/Playwright/pages/harassCalculator.page.js
T
2026-05-31 14:33:58 -04:00

69 lines
1.9 KiB
JavaScript

const BasePage = require('./base.page');
class HarassCalculatorPage extends BasePage {
get url() { return 'harass-calculator'; }
async setWorkersLostToHarass(number) {
await this.website.enterInput(this.website.find('numberOfWorkersLostToHarass'), number);
return this;
}
async setNumberOfTownHallsExisting(number) {
await this.website.enterInput(this.website.find('numberOfTownHallsExisting'), number);
return this;
}
async setTownHallTravelTime(forTownHall, number) {
const inputs = this.website.findChildren('numberOfTownHallTravelTimes', 'input');
await this.website.enterInput(inputs.nth(forTownHall), number);
return this;
}
async getTotalAlloyHarassment() {
return await this.website.findInt('totalAlloyHarassment');
}
async getWorkerReplacementCost() {
return await this.website.findInt('workerReplacementCost');
}
async getDelayedMiningCost() {
return await this.website.findInt('delayedMiningCost');
}
async getAverageTravelTime() {
return await this.website.findInt('getAverageTravelTime');
}
async getExampleTotalAlloyLoss() {
return await this.website.findInt('exampleTotalAlloyLoss');
}
async getExampleWorkerCost() {
return await this.website.findInt('exampleWorkerCost');
}
async getExampleMiningTimeCost() {
return await this.website.findInt('exampleMiningTimeCost');
}
async getExampleTotalAlloyLossAccurate() {
return await this.website.findInt('exampleTotalAlloyLossAccurate');
}
async getExampleTotalAlloyLossDifference() {
return await this.website.findInt('exampleTotalAlloyLossDifference');
}
async getExampleTotalAlloyLossAccurateDifference() {
return await this.website.findInt('exampleTotalAlloyLossAccurateDifference');
}
async goto() {
await this.website.goto(this.url);
return this;
}
}
module.exports = HarassCalculatorPage;