[AAE-1729] Move task-process filters methods into adf-testing, refactor dropdowns to use dropdown material testing page (#5467)

* [AAE-1729] Move task-process filters methods into adf-testing

* [AAE-1729] Add default filters methods in testing package

* [AAE-1729] Refactor testing package and e2e to use Dropdown testing page

* [AAE-1729] Rename function

* [AAE-1729] Fix failing e2e, add click and select dropdown method

* [AAE-1729] Fix e2e

* [AAE-1729] fix e2e

* [AAE-1729] Add default filters methods in testing package

* [AAE-1729] Slow down upload speed, fix cancel upload e2e

* [AAE-1729] Undo slow down upload speed, fix cancel upload e2e
This commit is contained in:
arditdomi
2020-02-27 13:51:36 +00:00
committed by GitHub
parent d2ec8ccee7
commit 14529da097
58 changed files with 601 additions and 650 deletions

View File

@@ -19,17 +19,19 @@ import { by, element, ElementFinder } from 'protractor';
import { DocumentListPage } from '../pages/document-list.page';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
import { DropdownPage } from '../../material/pages/dropdown.page';
export class ContentNodeSelectorDialogPage {
dialog: ElementFinder = element(by.css(`adf-content-node-selector`));
header: ElementFinder = this.dialog.element(by.css(`header[data-automation-id='content-node-selector-title']`));
searchInputElement: ElementFinder = this.dialog.element(by.css(`input[data-automation-id='content-node-selector-search-input']`));
searchLabel: ElementFinder = this.searchInputElement.element(by.xpath("ancestor::div[@class='mat-form-field-infix']/span/label"));
siteListDropdown: ElementFinder = this.dialog.element(by.css(`mat-select[data-automation-id='site-my-files-option']`));
selectedRow: ElementFinder = this.dialog.element(by.css(`adf-datatable-row[class*="adf-is-selected"]`));
cancelButton: ElementFinder = element(by.css(`button[data-automation-id='content-node-selector-actions-cancel']`));
moveCopyButton: ElementFinder = element(by.css(`button[data-automation-id='content-node-selector-actions-choose']`));
contentList: DocumentListPage = new DocumentListPage(this.dialog);
siteListDropdown = new DropdownPage(this.dialog.element(by.css(`mat-select[data-automation-id='site-my-files-option']`)));
async checkDialogIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dialog);
@@ -52,7 +54,7 @@ export class ContentNodeSelectorDialogPage {
}
async checkSelectedSiteIsDisplayed(siteName): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.siteListDropdown.element(by.cssContainingText('.mat-select-value-text span', siteName)));
await this.siteListDropdown.checkOptionIsSelected(siteName);
}
async checkSelectedFolder(folderName: string): Promise<void> {

View File

@@ -18,15 +18,15 @@
import { browser, by, element, ElementFinder } from 'protractor';
import { BrowserActions } from '../../../core/utils/browser-actions';
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
import { DropdownPage } from '../../../material/pages/dropdown.page';
export class SearchSortingPickerPage {
sortingSelector: ElementFinder = element(by.css('adf-sorting-picker div[class="mat-select-arrow"]'));
sortingDropdown = new DropdownPage(element(by.css('adf-sorting-picker div[class="mat-select-arrow"]')));
orderArrow: ElementFinder = element(by.css('adf-sorting-picker button mat-icon'));
optionsDropdown: ElementFinder = element(by.css('div .mat-select-panel'));
async sortBy(sortOrder: string, sortType: string | RegExp): Promise<void> {
await BrowserActions.click(this.sortingSelector);
await this.sortingDropdown.clickDropdown();
const selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', sortType));
await BrowserActions.click(selectedSortingOption);
await this.sortByOrder(sortOrder);
@@ -52,31 +52,29 @@ export class SearchSortingPickerPage {
}
}
async clickSortingOption(option): Promise<void> {
async clickSortingOption(option: string): Promise<void> {
const selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', option));
await BrowserActions.click(selectedSortingOption);
}
async clickSortingSelector(): Promise<void> {
await BrowserActions.click(this.sortingSelector);
async checkOptionIsDisplayed(option: string): Promise<void> {
await this.sortingDropdown.checkOptionIsDisplayed(option);
}
async checkOptionIsDisplayed(option): Promise<void> {
const optionSelector = this.optionsDropdown.element(by.cssContainingText('span[class="mat-option-text"]', option));
await BrowserVisibility.waitUntilElementIsVisible(optionSelector);
}
async checkOptionIsNotDisplayed(option): Promise<void> {
const optionSelector = this.optionsDropdown.element(by.cssContainingText('span[class="mat-option-text"]', option));
await BrowserVisibility.waitUntilElementIsNotVisible(optionSelector);
async checkOptionIsNotDisplayed(option: string): Promise<void> {
await this.sortingDropdown.checkOptionIsNotDisplayed(option);
}
async checkOptionsDropdownIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.optionsDropdown);
await this.sortingDropdown.checkOptionsPanelIsDisplayed();
}
async checkSortingSelectorIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.sortingSelector);
async checkSortingDropdownIsDisplayed(): Promise<void> {
await this.sortingDropdown.checkDropdownIsVisible();
}
async clickSortingDropdown(): Promise<void> {
await this.sortingDropdown.clickDropdown();
}
async checkOrderArrowIsDownward(): Promise<boolean> {

View File

@@ -17,6 +17,7 @@
import { by, element, Locator, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '../../utils/public-api';
import { DropdownPage } from '../../../material/pages/dropdown.page';
export class FormFields {
@@ -28,11 +29,11 @@ export class FormFields {
noFormMessage: ElementFinder = element(by.css('span[id*="no-form-message"]'));
completedTaskNoFormMessage: ElementFinder = element(by.css('div[id*="completed-form-message"] p'));
attachFormButton: ElementFinder = element(by.id('adf-no-form-attach-form-button'));
selectFormDropDownArrow: ElementFinder = element.all(by.css('adf-attach-form div[class*="mat-select-arrow"]')).first();
selectFormContent: ElementFinder = element(by.css('div[class*="mat-select-panel"]'));
completeButton: ElementFinder = element(by.id('adf-form-complete'));
errorMessage: Locator = by.css('.adf-error-text-container .adf-error-text');
selectFormDropdown = new DropdownPage(element.all(by.css('adf-attach-form div[class*="mat-select-arrow"]')).first());
async setFieldValue(locator, field, value): Promise<void> {
const fieldElement = element(locator(field));
await BrowserActions.clearSendKeys(fieldElement, value);
@@ -124,9 +125,7 @@ export class FormFields {
}
async selectForm(formName): Promise<void> {
await BrowserActions.click(this.selectFormDropDownArrow);
await BrowserVisibility.waitUntilElementIsVisible(this.selectFormContent);
await this.selectFormFromDropDown(formName);
await this.selectFormDropdown.clickDropdownWithOption(formName);
}
async selectFormFromDropDown(formName): Promise<void> {

View File

@@ -18,28 +18,11 @@
import { browser, by, element, ElementFinder } from 'protractor';
import { BrowserVisibility } from '../utils/browser-visibility';
import { BrowserActions } from '../utils/browser-actions';
import { DropdownPage } from '../../material/pages/dropdown.page';
export class SettingsPage {
settingsURL: string = browser.baseUrl + '/settings';
providerDropdown = element(by.css('mat-select[id="adf-provider-selector"] div[class="mat-select-arrow-wrapper"]'));
ecmAndBpm = {
option: element(by.xpath('//SPAN[@class="mat-option-text"][contains(text(),"ALL")]')),
text: 'ALL'
};
bpm = {
option: element(by.xpath('//SPAN[@class="mat-option-text"][contains(text(),"BPM") and not (contains(text(),"and"))]')),
text: 'BPM'
};
ecm = {
option: element(by.xpath('//SPAN[@class="mat-option-text"][contains(text(),"ECM") and not (contains(text(),"and"))]')),
text: 'ECM'
};
oauth = {
option: element(by.xpath('//SPAN[@class="mat-option-text"][contains(text(),"OAUTH")]')),
text: 'OAUTH'
};
selectedOption: ElementFinder = element(by.css('span[class*="mat-select-value-text"]'));
ecmText: ElementFinder = element(by.css('input[data-automation-id*="ecmHost"]'));
bpmText: ElementFinder = element(by.css('input[data-automation-id*="bpmHost"]'));
clientIdText: ElementFinder = element(by.css('input[id="clientId"]'));
@@ -56,20 +39,20 @@ export class SettingsPage {
backButton: ElementFinder = element(by.cssContainingText('button span[class="mat-button-wrapper"]', 'Back'));
validationMessage: ElementFinder = element(by.cssContainingText('mat-error', 'This field is required'));
providerDropdown = new DropdownPage(element(by.css('mat-select[id="adf-provider-selector"]')));
async goToSettingsPage(): Promise<void> {
await browser.get(this.settingsURL);
await BrowserVisibility.waitUntilElementIsVisible(this.providerDropdown);
await this.providerDropdown.checkDropdownIsVisible();
}
async setProvider(option, selected): Promise<void> {
await BrowserActions.click(this.providerDropdown);
await BrowserActions.click(option);
const selectedOptionText = await BrowserActions.getText(this.selectedOption);
await expect(selectedOptionText).toEqual(selected);
async setProvider(option): Promise<void> {
await this.providerDropdown.clickDropdownWithOption(option);
await this.providerDropdown.checkOptionIsSelected(option);
}
async getSelectedOptionText(): Promise<string> {
return BrowserActions.getText(this.selectedOption);
return this.providerDropdown.getSelectedOptionText();
}
async getBpmHostUrl() {
@@ -80,36 +63,24 @@ export class SettingsPage {
return this.ecmText.getAttribute('value');
}
getBpmOption() {
return this.bpm.option;
}
getEcmOption() {
return this.ecm.option;
}
getEcmAndBpmOption() {
return this.ecmAndBpm.option;
}
async setProviderEcmBpm() {
await this.setProvider(this.ecmAndBpm.option, this.ecmAndBpm.text);
await this.setProvider('ALL');
await this.clickApply();
}
async setProviderBpm() {
await this.setProvider(this.bpm.option, this.bpm.text);
await this.setProvider('BPM');
await this.clickApply();
}
async setProviderEcm() {
await this.setProvider(this.ecm.option, this.ecm.text);
await this.setProvider('ECM');
await this.clickApply();
}
async setProviderOauth() {
await this.goToSettingsPage();
await this.setProvider(this.oauth.option, this.oauth.text);
await this.setProvider('OAUTH');
await this.clickApply();
}
@@ -123,7 +94,7 @@ export class SettingsPage {
async setProviderEcmSso(contentServiceURL, authHost, identityHost, silentLogin = true, implicitFlow = true, clientId?: string, logoutUrl: string = '/logout') {
await this.goToSettingsPage();
await this.setProvider(this.ecm.option, this.ecm.text);
await this.setProvider('ECM');
await this.clickSsoRadioButton();
await this.setContentServicesURL(contentServiceURL);
await this.setAuthHost(authHost);
@@ -138,7 +109,7 @@ export class SettingsPage {
async setProviderBpmSso(processServiceURL, authHost, identityHost, silentLogin = true, implicitFlow = true) {
await this.goToSettingsPage();
await this.setProvider(this.bpm.option, this.bpm.text);
await this.setProvider('BPM');
await BrowserVisibility.waitUntilElementIsVisible(this.bpmText);
await BrowserVisibility.waitUntilElementIsNotVisible(this.ecmText);
await this.clickSsoRadioButton();
@@ -154,7 +125,7 @@ export class SettingsPage {
async setProviderEcmBpmSso(contentServicesURL: string, processServiceURL, authHost, identityHost, clientId: string, silentLogin = true, implicitFlow = true) {
await this.goToSettingsPage();
await this.setProvider(this.ecmAndBpm.option, this.ecmAndBpm.text);
await this.setProvider('ALL');
await BrowserVisibility.waitUntilElementIsVisible(this.bpmText);
await BrowserVisibility.waitUntilElementIsVisible(this.ecmText);
await this.clickSsoRadioButton();
@@ -231,7 +202,7 @@ export class SettingsPage {
}
async checkProviderDropdownIsDisplayed() {
await BrowserVisibility.waitUntilElementIsVisible(this.providerDropdown);
await this.providerDropdown.checkDropdownIsVisible();
}
async checkValidationMessageIsDisplayed() {
@@ -239,10 +210,10 @@ export class SettingsPage {
}
async checkProviderOptions() {
await BrowserActions.click(this.providerDropdown);
await BrowserVisibility.waitUntilElementIsVisible(this.ecmAndBpm.option);
await BrowserVisibility.waitUntilElementIsVisible(this.ecm.option);
await BrowserVisibility.waitUntilElementIsVisible(this.bpm.option);
await this.providerDropdown.clickDropdown();
await this.providerDropdown.checkOptionIsDisplayed('ALL');
await this.providerDropdown.checkOptionIsDisplayed('ECM');
await this.providerDropdown.checkOptionIsDisplayed('BPM');
}
getBasicAuthRadioButton() {

View File

@@ -27,14 +27,6 @@ export class DropdownPage {
this.dropDownElement = dropDownElement;
}
async checkOptionIsVisibleInDropdown(option: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('mat-option span', option)), 5000);
}
async checkOptionIsNotVisible(option: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('mat-option span', option)), 5000);
}
async clickDropdown(): Promise<void> {
await BrowserActions.click(this.dropDownElement);
}
@@ -47,4 +39,49 @@ export class DropdownPage {
async getValue(): Promise<string> {
return BrowserActions.getText(element(by.css('mat-form-field span')));
}
async getNumberOfOptions(): Promise<number> {
const dropdownOptions = element.all(by.css('.mat-select-panel mat-option'));
return dropdownOptions.count();
}
async checkDropdownIsVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.dropDownElement);
}
async checkDropdownIsClickable(): Promise<void> {
await BrowserVisibility.waitUntilElementIsClickable(this.dropDownElement);
}
async checkOptionIsSelected(option: string): Promise<void> {
const selectedOption = this.dropDownElement.element(by.cssContainingText('.mat-select-value-text span', option));
await BrowserVisibility.waitUntilElementIsVisible(selectedOption);
}
async selectOptionFromIndex(index): Promise<void> {
const value: ElementFinder = element.all(by.className('mat-option')).get(index);
await BrowserActions.click(value);
}
async checkOptionsPanelIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element(by.css('.mat-select-panel')));
}
async getSelectedOptionText(): Promise<string> {
const selectedOption = this.dropDownElement.element(by.css('.mat-select-value-text span'));
return BrowserActions.getText(selectedOption);
}
async checkOptionIsDisplayed(option: string): Promise <void> {
await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('mat-option span.mat-option-text', option)));
}
async checkOptionIsNotDisplayed(option: string): Promise <void> {
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('mat-option span.mat-option-text', option)));
}
async clickDropdownWithOption(option: string): Promise<void> {
await this.clickDropdown();
await this.selectOption(option);
}
}

View File

@@ -18,16 +18,26 @@ import { browser, by, element, protractor, ElementFinder } from 'protractor';
import { EditProcessFilterDialogPage } from './dialog/edit-process-filter-dialog.page';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
import { DropdownPage } from '../../material/pages/dropdown.page';
export class EditProcessFilterCloudComponentPage {
customiseFilter: ElementFinder = element(by.id('adf-edit-process-filter-title-id'));
selectedOption: ElementFinder = element.all(by.css('mat-option[class*="mat-selected"]')).first();
saveButton: ElementFinder = element(by.css('button[data-automation-id="adf-filter-action-save"]'));
saveAsButton: ElementFinder = element(by.css('button[data-automation-id="adf-filter-action-saveAs"]'));
deleteButton: ElementFinder = element(by.css('button[data-automation-id="adf-filter-action-delete"]'));
filter: ElementFinder = element(by.css(`adf-cloud-edit-process-filter mat-expansion-panel-header`));
private locatorAppNameDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-process-property-appName']`));
private locatorStatusDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-process-property-status']`));
private locatorSortDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-process-property-sort']`));
private locatorOrderDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-process-property-order']`));
appNameDropdown = new DropdownPage(this.locatorAppNameDropdown);
statusDropdown = new DropdownPage(this.locatorStatusDropdown);
sortDropdown = new DropdownPage(this.locatorSortDropdown);
orderDropdown = new DropdownPage(this.locatorOrderDropdown);
editProcessFilterDialogPage = new EditProcessFilterDialogPage();
editProcessFilterDialog(): EditProcessFilterDialogPage {
@@ -51,10 +61,7 @@ export class EditProcessFilterCloudComponentPage {
}
async setStatusFilterDropDown(option: string): Promise<void> {
await this.clickOnDropDownArrow('status');
const statusElement = element.all(by.cssContainingText('mat-option span', option)).first();
await BrowserActions.click(statusElement);
await this.statusDropdown.clickDropdownWithOption(option);
}
async getStateFilterDropDownValue(): Promise<string> {
@@ -62,10 +69,7 @@ export class EditProcessFilterCloudComponentPage {
}
async setSortFilterDropDown(option): Promise<void> {
await this.clickOnDropDownArrow('sort');
const sortElement = element.all(by.cssContainingText('mat-option span', option)).first();
await BrowserActions.click(sortElement);
await this.sortDropdown.clickDropdownWithOption(option);
}
async getSortFilterDropDownValue(): Promise<string> {
@@ -74,10 +78,7 @@ export class EditProcessFilterCloudComponentPage {
}
async setOrderFilterDropDown(option): Promise<void> {
await this.clickOnDropDownArrow('order');
const orderElement = element.all(by.cssContainingText('mat-option span', option)).first();
await BrowserActions.click(orderElement);
await this.orderDropdown.clickDropdownWithOption(option);
await browser.sleep(1500);
}
@@ -85,16 +86,8 @@ export class EditProcessFilterCloudComponentPage {
return BrowserActions.getText(element(by.css("mat-form-field[data-automation-id='order'] span")));
}
async clickOnDropDownArrow(option): Promise<void> {
const dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class='mat-select-arrow-wrapper']")).first();
await BrowserActions.click(dropDownArrow);
}
async setAppNameDropDown(option: string): Promise<void> {
await this.clickOnDropDownArrow('appName');
const appNameElement = element.all(by.cssContainingText('mat-option span', option)).first();
await BrowserActions.click(appNameElement);
await this.appNameDropdown.clickDropdownWithOption(option);
}
async getApplicationSelected(): Promise<string> {
@@ -113,9 +106,8 @@ export class EditProcessFilterCloudComponentPage {
}
async getNumberOfAppNameOptions(): Promise<number> {
await this.clickOnDropDownArrow('appName');
const dropdownOptions = element.all(by.css('.mat-select-panel mat-option'));
return dropdownOptions.count();
await this.appNameDropdown.clickDropdown();
return this.appNameDropdown.getNumberOfOptions();
}
async isApplicationListLoaded(): Promise<boolean> {

View File

@@ -19,11 +19,11 @@ import { browser, by, element, protractor, ElementFinder } from 'protractor';
import { EditTaskFilterDialogPage } from './dialog/edit-task-filter-dialog.page';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
import { DropdownPage } from '../../material/pages/dropdown.page';
export class EditTaskFilterCloudComponentPage {
customiseFilter: ElementFinder = element(by.id('adf-edit-task-filter-title-id'));
selectedOption: ElementFinder = element.all(by.css('mat-option[class*="mat-selected"]')).first();
assignee: ElementFinder = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-assignee"]'));
priority: ElementFinder = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-priority"]'));
taskName: ElementFinder = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-taskName"]'));
@@ -39,6 +39,16 @@ export class EditTaskFilterCloudComponentPage {
deleteButton: ElementFinder = element(by.css('[data-automation-id="adf-filter-action-delete"]'));
filter: ElementFinder = element(by.css(`adf-cloud-edit-task-filter mat-expansion-panel-header`));
private locatorAppNameDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-task-property-appName']`));
private locatorStatusDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-task-property-status']`));
private locatorSortDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-task-property-sort']`));
private locatorOrderDropdown = element(by.css(`mat-select[data-automation-id='adf-cloud-edit-task-property-order']`));
appNameDropdown = new DropdownPage(this.locatorAppNameDropdown);
statusDropdown = new DropdownPage(this.locatorStatusDropdown);
sortDropdown = new DropdownPage(this.locatorSortDropdown);
orderDropdown = new DropdownPage(this.locatorOrderDropdown);
editTaskFilterDialogPage = new EditTaskFilterDialogPage();
editTaskFilterDialog(): EditTaskFilterDialogPage {
@@ -55,44 +65,28 @@ export class EditTaskFilterCloudComponentPage {
}
async setStatusFilterDropDown(option: string): Promise<void> {
await this.clickOnDropDownArrow('status');
const statusElement = element.all(by.cssContainingText('mat-option span', option)).first();
await BrowserActions.click(statusElement);
await this.statusDropdown.clickDropdownWithOption(option);
}
async getStatusFilterDropDownValue(): Promise<string> {
return BrowserActions.getText(element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-status'] span")).first());
return this.statusDropdown.getSelectedOptionText();
}
async setSortFilterDropDown(option): Promise<void> {
await this.clickOnDropDownArrow('sort');
const sortElement = element.all(by.cssContainingText('mat-option span', option)).first();
await BrowserActions.click(sortElement);
async setSortFilterDropDown(option: string): Promise<void> {
await this.sortDropdown.clickDropdownWithOption(option);
}
async getSortFilterDropDownValue(): Promise<string> {
const elementSort = element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-sort'] span")).first();
return BrowserActions.getText(elementSort);
return this.sortDropdown.getSelectedOptionText();
}
async setOrderFilterDropDown(option: string): Promise<void> {
await this.clickOnDropDownArrow('order');
const orderElement = element.all(by.cssContainingText('mat-option span', option)).first();
await BrowserActions.click(orderElement);
await this.orderDropdown.clickDropdownWithOption(option);
await browser.sleep(1500);
}
getOrderFilterDropDownValue(): Promise<string> {
return BrowserActions.getText(element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-order'] span")).first());
}
async clickOnDropDownArrow(option: string): Promise<void> {
const dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class*='arrow']")).first();
await BrowserActions.click(dropDownArrow);
await BrowserVisibility.waitUntilElementIsVisible(this.selectedOption);
async getOrderFilterDropDownValue(): Promise<string> {
return this.orderDropdown.getSelectedOptionText();
}
async setAssignee(option: string): Promise<void> {
@@ -199,15 +193,11 @@ export class EditTaskFilterCloudComponentPage {
}
async setAppNameDropDown(option: string): Promise<void> {
await this.clickOnDropDownArrow('appName');
const appNameElement = element.all(by.cssContainingText('mat-option span', option)).first();
await BrowserActions.click(appNameElement);
await this.appNameDropdown.clickDropdownWithOption(option);
}
async getAppNameDropDownValue(): Promise<string> {
const locator = element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-appName'] span")).first();
return BrowserActions.getText(locator);
return this.appNameDropdown.getSelectedOptionText();
}
async setId(option): Promise<void> {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { by, ElementFinder, Locator } from 'protractor';
import { by, element, ElementFinder, Locator } from 'protractor';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
@@ -24,32 +24,88 @@ export class ProcessFiltersCloudComponentPage {
filter: ElementFinder;
filterIcon: Locator = by.xpath("ancestor::div[@class='mat-list-item-content']/mat-icon");
constructor(filter: ElementFinder) {
this.filter = filter;
}
processFilters: ElementFinder = element(by.css("mat-expansion-panel[data-automation-id='Process Filters']"));
async checkProcessFilterIsDisplayed(): Promise<void> {
activeFilter: ElementFinder = element(by.css("mat-list-item[class*='active'] span"));
processFiltersList: ElementFinder = element(by.css('adf-cloud-process-filters'));
async checkProcessFilterIsDisplayed(filterName: string): Promise<void> {
this.filter = this.getProcessFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
}
async getProcessFilterIcon(): Promise<string> {
async getProcessFilterIcon(filterName: string): Promise<string> {
this.filter = this.getProcessFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
const icon = this.filter.element(this.filterIcon);
await BrowserVisibility.waitUntilElementIsVisible(icon);
return BrowserActions.getText(icon);
}
async checkProcessFilterHasNoIcon(): Promise<void> {
async checkProcessFilterHasNoIcon(filterName: string): Promise<void> {
this.filter = this.getProcessFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.filterIcon));
}
async clickProcessFilter(): Promise<void> {
async clickProcessFilter(filterName: string): Promise<void> {
this.filter = this.getProcessFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
await BrowserActions.click(this.filter);
}
async checkProcessFilterNotDisplayed(): Promise<void> {
async clickAllProcessesFilter(): Promise<void> {
this.filter = this.getProcessFilterLocatorByFilterName('all-processes');
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
await BrowserActions.click(this.filter);
}
async clickCompletedProcessesFilter(): Promise<void> {
this.filter = this.getProcessFilterLocatorByFilterName('completed-processes');
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
await BrowserActions.click(this.filter);
}
async clickRunningProcessesFilter(): Promise<void> {
this.filter = this.getProcessFilterLocatorByFilterName('running-processes');
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
await BrowserActions.click(this.filter);
}
async checkAllProcessesFilterIsDisplayed(): Promise<void> {
this.filter = this.getProcessFilterLocatorByFilterName('all-processes');
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
}
async checkCompletedProcessesFilterIsDisplayed(): Promise<void> {
this.filter = this.getProcessFilterLocatorByFilterName('completed-processes');
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
}
async checkRunningProcessesFilterIsDisplayed(): Promise<void> {
this.filter = this.getProcessFilterLocatorByFilterName('running-processes');
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
}
async checkProcessFilterNotDisplayed(filterName: string): Promise<void> {
this.filter = this.getProcessFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter);
}
async clickOnProcessFilters(): Promise<void> {
await BrowserActions.click(this.processFilters);
}
async getActiveFilterName(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.activeFilter);
return BrowserActions.getText(this.activeFilter);
}
async isProcessFiltersListVisible(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.processFiltersList);
}
getProcessFilterLocatorByFilterName(filterName: string): ElementFinder {
return element(by.css(`span[data-automation-id="${filterName}_filter"]`));
}
}

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { browser, by, ElementFinder, Locator } from 'protractor';
import { by, element, ElementFinder, Locator } from 'protractor';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
@@ -23,33 +23,77 @@ export class TaskFiltersCloudComponentPage {
filter: ElementFinder;
taskIcon: Locator = by.xpath("ancestor::div[@class='mat-list-item-content']/mat-icon");
taskFilters: ElementFinder = element(by.css(`mat-expansion-panel[data-automation-id='Task Filters']`));
constructor(filter: ElementFinder) {
this.filter = filter;
}
activeFilter: ElementFinder = element(by.css("mat-list-item[class*='active'] span"));
defaultActiveFilter: ElementFinder = element.all(by.css('.adf-filters__entry')).first();
async checkTaskFilterIsDisplayed(): Promise<void> {
async checkTaskFilterIsDisplayed(filterName: string): Promise<void> {
this.filter = this.getTaskFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
}
async getTaskFilterIcon(): Promise<string> {
async getTaskFilterIcon(filterName: string): Promise<string> {
this.filter = this.getTaskFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
const icon = this.filter.element(this.taskIcon);
return BrowserActions.getText(icon);
}
async checkTaskFilterHasNoIcon(): Promise<void> {
async checkTaskFilterHasNoIcon(filterName: string): Promise<void> {
this.filter = this.getTaskFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.element(this.taskIcon));
}
async clickTaskFilter(): Promise<void> {
async clickTaskFilter(filterName): Promise<void> {
this.filter = this.getTaskFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
await BrowserActions.click(this.filter);
await browser.driver.sleep(1000);
}
async checkTaskFilterNotDisplayed(): Promise<void> {
async clickMyTasksFilter(): Promise<void> {
this.filter = this.getTaskFilterLocatorByFilterName('my-tasks');
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
await BrowserActions.click(this.filter);
}
async clickCompletedTasksFilter(): Promise<void> {
this.filter = this.getTaskFilterLocatorByFilterName('completed-tasks');
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
await BrowserActions.click(this.filter);
}
async checkMyTasksFilterIsDisplayed(): Promise<void> {
this.filter = this.getTaskFilterLocatorByFilterName('my-tasks');
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
}
async checkCompletedTasksFilterIsDisplayed(): Promise<void> {
this.filter = this.getTaskFilterLocatorByFilterName('completed-tasks');
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
}
async checkTaskFilterNotDisplayed(filterName: string): Promise<void> {
this.filter = this.getTaskFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter);
}
async clickOnTaskFilters(): Promise<void> {
await BrowserActions.click(this.taskFilters);
}
async getActiveFilterName(): Promise<string> {
return BrowserActions.getText(this.activeFilter);
}
async firstFilterIsActive(): Promise<boolean> {
const value = await this.defaultActiveFilter.getAttribute('class');
return value.includes('adf-active');
}
getTaskFilterLocatorByFilterName(filterName: string): ElementFinder {
return element(by.css(`span[data-automation-id="${filterName}-filter"]`));
}
}

View File

@@ -19,6 +19,7 @@ import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { by, element, ElementFinder, Locator } from 'protractor';
import { BrowserActions } from '../../core/utils/browser-actions';
import { By } from 'selenium-webdriver';
import { DropdownPage } from '../../material/pages/dropdown.page';
export class FormFieldsPage {
@@ -30,11 +31,11 @@ export class FormFieldsPage {
noFormMessage: ElementFinder = element(by.css('span[id*="no-form-message"]'));
completedTaskNoFormMessage: ElementFinder = element(by.css('div[id*="completed-form-message"] p'));
attachFormButton: ElementFinder = element(by.id('adf-no-form-attach-form-button'));
selectFormDropDownArrow: ElementFinder = element.all(by.css('adf-attach-form div[class*="mat-select-arrow"]')).first();
selectFormContent: ElementFinder = element(by.css('div[class*="mat-select-panel"]'));
completeButton: ElementFinder = element(by.id('adf-form-complete'));
errorMessage: Locator = by.css('.adf-error-text-container .adf-error-text');
selectFormDropdown = new DropdownPage(element.all(by.css('adf-attach-form div[class*="mat-select-arrow"]')).first());
async setFieldValue(locator: (id: string) => By, field: string, value: string): Promise<void> {
const fieldElement = element(locator(field));
await BrowserVisibility.waitUntilElementIsVisible(fieldElement);
@@ -121,9 +122,9 @@ export class FormFieldsPage {
}
async selectForm(formName: string): Promise<void> {
await BrowserActions.click(this.selectFormDropDownArrow);
await BrowserVisibility.waitUntilElementIsVisible(this.selectFormContent);
await this.selectFormFromDropDown(formName);
await this.selectFormDropdown.clickDropdown();
await this.selectFormDropdown.checkOptionsPanelIsDisplayed();
await this.selectFormDropdown.selectOption(formName);
}
async selectFormFromDropDown(formName: string): Promise<void> {