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

40 lines
1.0 KiB
JavaScript

class HighlightsComponent {
constructor(page) {
this.page = page;
}
highlightsContainer() {
return this.page.locator('.highlightsContainer');
}
requestedColumn() {
return this.highlightsContainer().locator('div').filter({ hasText: 'Requested' }).locator('+ div');
}
finishedColumn() {
return this.highlightsContainer().locator('div').filter({ hasText: 'Finished' }).locator('+ div');
}
async getRequestedItems() {
const items = await this.highlightsContainer().locator('div').filter({ hasText: /^\d+\s*\|/ }).all();
const result = [];
for (const item of items) {
const text = (await item.textContent()) || '';
result.push(text.trim());
}
return result;
}
async getFinishedItems() {
const items = await this.highlightsContainer().locator('div').filter({ hasText: /^\d+\s*\|/ }).all();
const result = [];
for (const item of items) {
const text = (await item.textContent()) || '';
result.push(text.trim());
}
return result;
}
}
module.exports = HighlightsComponent;