From 0e7db2a8164887e80194c6f3cfdeb094dc3bc42b Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Sat, 24 Feb 2018 20:18:21 -0500 Subject: [PATCH] do searchability check last This fixes a small race condition that sometimes occurs when running locally by ensuring that the delayed paged scrolling that happens from using search doesn't put the password reset button out of view when the test runner is trying to find and click it. --- .../test-credentials-add-edit-machine.js | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/awx/ui/test/e2e/tests/test-credentials-add-edit-machine.js b/awx/ui/test/e2e/tests/test-credentials-add-edit-machine.js index e21e8c02f5..68507171b0 100644 --- a/awx/ui/test/e2e/tests/test-credentials-add-edit-machine.js +++ b/awx/ui/test/e2e/tests/test-credentials-add-edit-machine.js @@ -166,18 +166,6 @@ module.exports = { credentials.section.edit.expect.section('@details').visible; }, - 'credential is searchable after saving': client => { - const credentials = client.page.credentials(); - const row = '#credentials_table tbody tr'; - - credentials.section.list.section.search - .waitForElementVisible('@input', AWX_E2E_TIMEOUT_LONG) - .setValue('@input', `name:${store.credential.name}`) - .click('@searchButton'); - - credentials.waitForElementNotPresent(`${row}:nth-of-type(2)`); - credentials.expect.element(row).text.contain(store.credential.name); - }, 'change the password after saving': client => { const credentials = client.page.credentials(); const { edit } = credentials.section; @@ -190,6 +178,7 @@ module.exports = { machine.expect.element('@password').not.enabled; machine.section.password.click('@replace'); + machine.section.password.expect.element('@replace').not.present; machine.section.password.expect.element('@revert').visible; @@ -201,7 +190,19 @@ module.exports = { credentials .waitForElementVisible('div.spinny') .waitForElementNotVisible('div.spinny'); + }, + 'credential is searchable after saving': client => { + const credentials = client.page.credentials(); + const row = '#credentials_table tbody tr'; + + credentials.section.list.section.search + .waitForElementVisible('@input', AWX_E2E_TIMEOUT_LONG) + .setValue('@input', `name:${store.credential.name}`) + .click('@searchButton'); + + credentials.waitForElementNotPresent(`${row}:nth-of-type(2)`); + credentials.expect.element(row).text.contain(store.credential.name); client.end(); - } + }, };