Files
2026-05-31 14:33:58 -04:00

48 lines
1.2 KiB
JavaScript

class BankComponent {
constructor(page) {
this.page = page;
}
bankContainer() {
return this.page.locator('.bankContainer');
}
displayValue(label) {
return this.bankContainer().locator('.displayContainer').filter({ hasText: label }).locator('.displayContent');
}
async getTime() {
return await this.displayValue('Time').textContent();
}
async getAlloy() {
return await this.displayValue('Alloy').textContent();
}
async getEther() {
return await this.displayValue('Ether').textContent();
}
async getPyre() {
return await this.displayValue('Pyre').textContent();
}
async getSupply() {
return await this.displayValue('Supply').textContent();
}
async getWorkerCount() {
return await this.bankContainer().locator('.workerText').locator('.displayContent').nth(0).textContent();
}
async getBusyWorkerCount() {
return await this.bankContainer().locator('.workerText').locator('.displayContent').nth(1).textContent();
}
async getCreatingWorkerCount() {
return await this.bankContainer().locator('.workerText').locator('.displayContent').nth(2).textContent();
}
}
module.exports = BankComponent;