mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4799][ADF-4801] Automation tests for CardView clear date field and selectbox None option (#4993)
* [ADF-4799] Automation for clear date button * [ADF-4801] Automate test for selectbox None option
This commit is contained in:
committed by
Eugenio Romano
parent
329f8b21bf
commit
643510ed45
@@ -34,6 +34,8 @@ export class CardViewComponentPage {
|
||||
resetButton: ElementFinder = element(by.css(`#adf-reset-card-log`));
|
||||
listContent: ElementFinder = element(by.css('.mat-select-panel'));
|
||||
editableSwitch: ElementFinder = element(by.id('adf-toggle-editable'));
|
||||
clearDateSwitch: ElementFinder = element(by.id('adf-toggle-clear-date'));
|
||||
noneOptionSwitch: ElementFinder = element(by.id('adf-toggle-none-option'));
|
||||
|
||||
async clickOnAddButton(): Promise<void> {
|
||||
await BrowserActions.click(this.addButton);
|
||||
@@ -174,4 +176,46 @@ export class CardViewComponentPage {
|
||||
}
|
||||
}
|
||||
|
||||
async getDateValue(): Promise<string> {
|
||||
const dateValue = element(by.css('span[data-automation-id="card-date-value-date"]'));
|
||||
return dateValue.getText();
|
||||
}
|
||||
|
||||
async getDateTimeValue(): Promise<string> {
|
||||
const dateTimeValue = element(by.css('span[data-automation-id="card-datetime-value-datetime"]'));
|
||||
return dateTimeValue.getText();
|
||||
}
|
||||
|
||||
async clearDateField(): Promise<void> {
|
||||
const clearDateButton = element(by.css('mat-icon[data-automation-id="datepicker-date-clear-date"]'));
|
||||
await BrowserActions.click(clearDateButton);
|
||||
}
|
||||
|
||||
async clearDateTimeField(): Promise<void> {
|
||||
const clearDateButton = element(by.css('mat-icon[data-automation-id="datepicker-date-clear-datetime"]'));
|
||||
await BrowserActions.click(clearDateButton);
|
||||
}
|
||||
|
||||
async enableClearDate(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.clearDateSwitch);
|
||||
|
||||
const switchClass = await this.clearDateSwitch.getAttribute('class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.clearDateSwitch.click();
|
||||
const clearDateChecked = element(by.css('mat-slide-toggle[id="adf-toggle-clear-date"][class*="mat-checked"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(clearDateChecked);
|
||||
}
|
||||
}
|
||||
|
||||
async enableNoneOption(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.noneOptionSwitch);
|
||||
|
||||
const switchClass = await this.noneOptionSwitch.getAttribute('class');
|
||||
if (switchClass.indexOf('mat-checked') === -1) {
|
||||
await this.noneOptionSwitch.click();
|
||||
const noneOptionChecked = element(by.css('mat-slide-toggle[id="adf-toggle-none-option"][class*="mat-checked"]'));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(noneOptionChecked);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user