From 9d1f9b601878665c2054d3bde53ff9cdec224d09 Mon Sep 17 00:00:00 2001 From: Vito Albano Date: Fri, 8 Dec 2023 13:43:55 +0000 Subject: [PATCH] Fixing e2e - changing toggles --- .../core/pages/data-table-component.page.ts | 16 +++++++++++----- .../lib/protractor/core/pages/settings.page.ts | 5 +++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/testing/src/lib/protractor/core/pages/data-table-component.page.ts b/lib/testing/src/lib/protractor/core/pages/data-table-component.page.ts index 9ec7ad551c..4c3da921bb 100644 --- a/lib/testing/src/lib/protractor/core/pages/data-table-component.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/data-table-component.page.ts @@ -33,6 +33,7 @@ export class DataTableComponentPage { selectedRowNumber: ElementFinder; allSelectedRows: ElementArrayFinder; selectAll: ElementFinder; + selectAllChecked: ElementFinder; emptyList: ElementFinder; emptyListTitle: ElementFinder; emptyListSubtitle: ElementFinder; @@ -67,12 +68,12 @@ export class DataTableComponentPage { async checkAllRows(): Promise { await BrowserActions.click(this.selectAll); - await BrowserVisibility.waitUntilElementIsVisible(this.selectAll.$('input[aria-checked="true"]')); + await BrowserVisibility.waitUntilElementIsVisible(this.selectAllChecked); } async uncheckAllRows(): Promise { await BrowserActions.click(this.selectAll); - await BrowserVisibility.waitUntilElementIsNotVisible(this.selectAll.$('input[aria-checked="true"]')); + await BrowserVisibility.waitUntilElementIsNotVisible(this.selectAll.$('.mat-mdc-checkbox-checked')); } async clickCheckbox(columnName: string, columnValue: string): Promise { @@ -81,18 +82,23 @@ export class DataTableComponentPage { } async checkRowIsNotChecked(columnName: string, columnValue: string): Promise { - await BrowserVisibility.waitUntilElementIsNotVisible(this.getRowCheckbox(columnName, columnValue).$('input[aria-checked="true"]')); + const rowSelector = this.getRowCheckboxChecked(columnName, columnValue); + await BrowserVisibility.waitUntilElementIsNotVisible(rowSelector); } async checkRowIsChecked(columnName: string, columnValue: string): Promise { - const rowCheckbox = this.getRowCheckbox(columnName, columnValue); - await BrowserVisibility.waitUntilElementIsVisible(rowCheckbox.$('input[aria-checked="true"]')); + const rowCheckbox = this.getRowCheckboxChecked(columnName, columnValue); + await BrowserVisibility.waitUntilElementIsVisible(rowCheckbox); } getRowCheckbox(columnName: string, columnValue: string): ElementFinder { return this.getRow(columnName, columnValue).$(materialLocators.Checkbox.root); } + getRowCheckboxChecked(columnName: string, columnValue: string): ElementFinder { + return this.getRow(columnName, columnValue).$('mat-checkbox.mat-mdc-checkbox-checked'); + } + async checkNoRowIsSelected(): Promise { await BrowserVisibility.waitUntilElementIsNotVisible(this.selectedRowNumber); } diff --git a/lib/testing/src/lib/protractor/core/pages/settings.page.ts b/lib/testing/src/lib/protractor/core/pages/settings.page.ts index 8a0a83e934..7d6ca2e47c 100644 --- a/lib/testing/src/lib/protractor/core/pages/settings.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/settings.page.ts @@ -100,6 +100,7 @@ export class SettingsPage { await this.setSilentLogin(silentLogin); await this.setCodeFlow(false); await this.setImplicitFlow(implicitFlow); + await this.setCodeFlow(true); await this.setClientId(clientId); await this.setLogoutUrl(logoutUrl); await this.clickApply(); @@ -132,7 +133,7 @@ export class SettingsPage { } async setSilentLogin(enableToggle) { - await BrowserVisibility.waitUntilElementIsVisible(this.silentLoginToggleElement); + await BrowserVisibility.waitUntilElementIsVisible(this.silentLoginToggleButton); const isChecked = (await BrowserActions.getAttribute(this.silentLoginToggleElement, 'class')).includes(materialLocators.Checked.root); @@ -142,7 +143,7 @@ export class SettingsPage { } async setImplicitFlow(enableToggle) { - await BrowserVisibility.waitUntilElementIsVisible(this.implicitFlowElement); + await BrowserVisibility.waitUntilElementIsVisible(this.implicitFlowButton); const isChecked = (await BrowserActions.getAttribute(this.implicitFlowElement, 'class')).includes(materialLocators.Checked.root);