mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fixing e2e - changing toggles
This commit is contained in:
@@ -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<void> {
|
||||
await BrowserActions.click(this.selectAll);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.selectAll.$('input[aria-checked="true"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.selectAllChecked);
|
||||
}
|
||||
|
||||
async uncheckAllRows(): Promise<void> {
|
||||
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<void> {
|
||||
@@ -81,18 +82,23 @@ export class DataTableComponentPage {
|
||||
}
|
||||
|
||||
async checkRowIsNotChecked(columnName: string, columnValue: string): Promise<void> {
|
||||
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<void> {
|
||||
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<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.selectedRowNumber);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user