diff --git a/selenium/test/pageobjects/BasePage.js b/selenium/test/pageobjects/BasePage.js index 8139cca949..36bad7c4e0 100644 --- a/selenium/test/pageobjects/BasePage.js +++ b/selenium/test/pageobjects/BasePage.js @@ -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::*")) diff --git a/selenium/test/pageobjects/QueuePage.js b/selenium/test/pageobjects/QueuePage.js index a087003907..642d6c79f3 100644 --- a/selenium/test/pageobjects/QueuePage.js +++ b/selenium/test/pageobjects/QueuePage.js @@ -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)