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 479a11acef..1f7fded6ea 100644 --- a/lib/testing/src/lib/protractor/core/pages/settings.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/settings.page.ts @@ -68,6 +68,7 @@ export class SettingsPage { await this.setIdentityHost(identityHost); await this.setSilentLogin(silentLogin); await this.setImplicitFlow(implicitFlow); + await this.setCodeFlow(true); await this.setClientId(clientId); await this.setLogoutUrl(logoutUrl); await this.clickApply(); @@ -100,22 +101,32 @@ 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); if (isChecked && !enableToggle || !isChecked && enableToggle) { - await BrowserActions.click(this.silentLoginToggleLabel); + await BrowserActions.click(this.silentLoginToggleButton); } } 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); if (isChecked && !enableToggle || !isChecked && enableToggle) { - await BrowserActions.click(this.implicitFlowLabel); + await BrowserActions.click(this.implicitFlowButton); + } + } + + async setCodeFlow(enableToggle) { + await BrowserVisibility.waitUntilElementIsVisible(this.codeFlowButton); + + const isChecked = (await BrowserActions.getAttribute(this.codeFlowButton, 'aria-checked')) === 'true'; + + if (isChecked && !enableToggle || !isChecked && enableToggle) { + await BrowserActions.click(this.codeFlowButton); } } }