From 7a6e62c0226cc7e7635b19796be8a0e37e6603e4 Mon Sep 17 00:00:00 2001 From: Keith Grant Date: Mon, 19 Aug 2019 13:10:48 -0700 Subject: [PATCH] update e2e tests for disabled toggle switches --- awx/ui/test/e2e/objects/notificationTemplates.js | 2 +- .../test/e2e/objects/sections/createFormSection.js | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/awx/ui/test/e2e/objects/notificationTemplates.js b/awx/ui/test/e2e/objects/notificationTemplates.js index 1811eb20b1..8af6689359 100644 --- a/awx/ui/test/e2e/objects/notificationTemplates.js +++ b/awx/ui/test/e2e/objects/notificationTemplates.js @@ -19,7 +19,7 @@ const details = createFormSection({ '#notification_template_form input[type="radio"]', '#notification_template_form .ui-spinner-input', '#notification_template_form .Form-textArea', - '#notification_template_form .atSwitch-inner', + '#notification_template_form .atSwitch-outer', '#notification_template_form .Form-lookupButton' ] } diff --git a/awx/ui/test/e2e/objects/sections/createFormSection.js b/awx/ui/test/e2e/objects/sections/createFormSection.js index d1c40a0dd5..8d823b9237 100644 --- a/awx/ui/test/e2e/objects/sections/createFormSection.js +++ b/awx/ui/test/e2e/objects/sections/createFormSection.js @@ -86,9 +86,16 @@ function checkAllFieldsDisabled () { selectors.forEach(selector => { client.elements('css selector', selector, inputs => { inputs.value.map(o => o.ELEMENT).forEach(id => { - client.elementIdAttribute(id, 'disabled', ({ value }) => { - client.assert.equal(value, 'true'); - }); + if (selector.includes('atSwitch')) { + client.elementIdAttribute(id, 'class', ({ value }) => { + const isDisabled = value && value.includes('atSwitch-disabled'); + client.assert.equal(isDisabled, true); + }); + } else { + client.elementIdAttribute(id, 'disabled', ({ value }) => { + client.assert.equal(value, 'true'); + }); + } }); }); });