Use different way to parse tables for consuers
This commit is contained in:
parent
8960d19492
commit
870c66734b
|
@ -186,6 +186,24 @@ module.exports = class BasePage {
|
|||
return table_model
|
||||
}
|
||||
async getTable(tableLocator, firstNColumns, rowClass) {
|
||||
const table = await this.waitForDisplayed(tableLocator)
|
||||
const rows = await table.findElements(rowClass == undefined ?
|
||||
By.css('tbody tr') : By.css('tbody tr.' + rowClass))
|
||||
let table_model = []
|
||||
|
||||
for (let row of rows) {
|
||||
let columns = await row.findElements(By.css('td'))
|
||||
let table_row = []
|
||||
for (let column of columns) {
|
||||
if (firstNColumns == undefined || table_row.length < firstNColumns) {
|
||||
table_row.push(await column.getText())
|
||||
}
|
||||
}
|
||||
table_model.push(table_row)
|
||||
}
|
||||
return table_model
|
||||
}
|
||||
async getPlainTable(tableLocator, firstNColumns) {
|
||||
const table = await this.waitForDisplayed(tableLocator)
|
||||
let tbody = await table.findElement(By.css('tbody'))
|
||||
let rows = await tbody.findElements(By.xpath("./child::*"))
|
||||
|
|
|
@ -35,7 +35,7 @@ module.exports = class QueuePage extends BasePage {
|
|||
return this.click(CONSUMERS_SECTION)
|
||||
}
|
||||
async getConsumersTable() {
|
||||
return this.getTable(CONSUMERS_TABLE)
|
||||
return this.getPlainTable(CONSUMERS_TABLE)
|
||||
}
|
||||
async ensureDeleteQueueSectionIsVisible() {
|
||||
await this.click(DELETE_SECTION)
|
||||
|
|
Loading…
Reference in New Issue