update e2e tests for disabled toggle switches

This commit is contained in:
Keith Grant
2019-08-19 13:10:48 -07:00
committed by Jim Ladd
parent d068fef767
commit 7a6e62c022
2 changed files with 11 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ const details = createFormSection({
'#notification_template_form input[type="radio"]', '#notification_template_form input[type="radio"]',
'#notification_template_form .ui-spinner-input', '#notification_template_form .ui-spinner-input',
'#notification_template_form .Form-textArea', '#notification_template_form .Form-textArea',
'#notification_template_form .atSwitch-inner', '#notification_template_form .atSwitch-outer',
'#notification_template_form .Form-lookupButton' '#notification_template_form .Form-lookupButton'
] ]
} }

View File

@@ -86,9 +86,16 @@ function checkAllFieldsDisabled () {
selectors.forEach(selector => { selectors.forEach(selector => {
client.elements('css selector', selector, inputs => { client.elements('css selector', selector, inputs => {
inputs.value.map(o => o.ELEMENT).forEach(id => { inputs.value.map(o => o.ELEMENT).forEach(id => {
client.elementIdAttribute(id, 'disabled', ({ value }) => { if (selector.includes('atSwitch')) {
client.assert.equal(value, 'true'); 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');
});
}
}); });
}); });
}); });