mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
fixig e2es
This commit is contained in:
@@ -22,17 +22,15 @@ export class TogglePage {
|
||||
|
||||
async enableToggle(toggle: ElementFinder): Promise<void> {
|
||||
const check = await BrowserActions.getAttribute(toggle, 'class');
|
||||
if (check.indexOf('mdc-switch--checked') < 0) {
|
||||
const elem = toggle.$$('input').first();
|
||||
await BrowserActions.clickScript(elem);
|
||||
if (check.indexOf('mdc-switch--unselected') < 0) {
|
||||
await BrowserActions.click(toggle);
|
||||
}
|
||||
}
|
||||
|
||||
async disableToggle(toggle: ElementFinder): Promise<void> {
|
||||
const check = await BrowserActions.getAttribute(toggle, 'class');
|
||||
if (check.indexOf('mdc-switch--checked') >= 0) {
|
||||
const elem = toggle.$$('input').first();
|
||||
await BrowserActions.clickScript(elem);
|
||||
if (check.indexOf('mat-mdc-slide-toggle-checked') >= 0) {
|
||||
await BrowserActions.click(toggle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user