[AAE-21083] Fix e2e Content: Metadata - C280560 - fix slide toggle click, in v15 toggle is handled with a button instead of input

This commit is contained in:
Amedeo Lepore 2024-03-12 16:45:54 +01:00 committed by VitoAlbano
parent 51e79de14b
commit f7fce699fe

View File

@ -30,9 +30,9 @@ export class TogglePage {
}
async disableToggle(toggle: ElementFinder): Promise<void> {
const check = await BrowserActions.getAttribute(toggle, 'class');
if (check.indexOf(materialLocators.Checked.root) >= 0) {
const elem = toggle.$$('input').first();
const slideToggle = await BrowserActions.getAttribute(toggle, 'class');
if (slideToggle.indexOf(materialLocators.Slide.toggle.checked) >= 0) {
const elem = toggle.$$('button').first();
await BrowserActions.clickScript(elem);
}
}