Skip to content

Commit 870c667

Browse files
Use different way to parse tables for consuers
1 parent 8960d19 commit 870c667

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

selenium/test/pageobjects/BasePage.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,24 @@ module.exports = class BasePage {
186186
return table_model
187187
}
188188
async getTable(tableLocator, firstNColumns, rowClass) {
189+
const table = await this.waitForDisplayed(tableLocator)
190+
const rows = await table.findElements(rowClass == undefined ?
191+
By.css('tbody tr') : By.css('tbody tr.' + rowClass))
192+
let table_model = []
193+
194+
for (let row of rows) {
195+
let columns = await row.findElements(By.css('td'))
196+
let table_row = []
197+
for (let column of columns) {
198+
if (firstNColumns == undefined || table_row.length < firstNColumns) {
199+
table_row.push(await column.getText())
200+
}
201+
}
202+
table_model.push(table_row)
203+
}
204+
return table_model
205+
}
206+
async getPlainTable(tableLocator, firstNColumns) {
189207
const table = await this.waitForDisplayed(tableLocator)
190208
let tbody = await table.findElement(By.css('tbody'))
191209
let rows = await tbody.findElements(By.xpath("./child::*"))

selenium/test/pageobjects/QueuePage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = class QueuePage extends BasePage {
3535
return this.click(CONSUMERS_SECTION)
3636
}
3737
async getConsumersTable() {
38-
return this.getTable(CONSUMERS_TABLE)
38+
return this.getPlainTable(CONSUMERS_TABLE)
3939
}
4040
async ensureDeleteQueueSectionIsVisible() {
4141
await this.click(DELETE_SECTION)

0 commit comments

Comments
 (0)