diff --git a/ui/tests/acceptance/pageobjects/accountsPage.js b/ui/tests/acceptance/pageobjects/accountsPage.js index 52a7c98a3c..d521ee63a6 100644 --- a/ui/tests/acceptance/pageobjects/accountsPage.js +++ b/ui/tests/acceptance/pageobjects/accountsPage.js @@ -14,13 +14,14 @@ module.exports = { return this.waitForElementVisible('@accountsListTable') }, isUserListed: async function (username) { - let user const usernameInTable = util.format(this.elements.userInAccountsList.selector, username) await this.useXpath().waitForElementVisible(usernameInTable) - .getText(usernameInTable, (result) => { - user = result - }) - return user.value + return true + }, + isUserDeleted: async function (username) { + const usernameInTable = util.format(this.elements.userInAccountsList.selector, username) + await this.useXpath().waitForElementNotPresent(usernameInTable) + return true }, selectRole: function (username, role) { diff --git a/ui/tests/acceptance/stepDefinitions/accountsContext.js b/ui/tests/acceptance/stepDefinitions/accountsContext.js index 4cc4a199a1..ec4c25c283 100644 --- a/ui/tests/acceptance/stepDefinitions/accountsContext.js +++ b/ui/tests/acceptance/stepDefinitions/accountsContext.js @@ -7,9 +7,15 @@ When('the user browses to the accounts page', function () { }) Then('user {string} should be displayed in the accounts list on the WebUI', async function (username) { - await client.page.accountsPage().accountsList(username) + await client.page.accountsPage().accountsList() const userListed = await client.page.accountsPage().isUserListed(username) - return assert.strictEqual(userListed, username) + return assert.strictEqual(userListed, true) +}) + +Then('user {string} should not be displayed in the accounts list on the WebUI', async function (username) { + await client.page.accountsPage().accountsList() + const userDeleted = await client.page.accountsPage().isUserDeleted(username) + return assert.strictEqual(userDeleted, true) }) Given('the user has changed the role of user {string} to {string}', function (username, role) {