[AAE-1933] Add dropdown testing page (#5491)

* [AAE-1933] Add process and task filters testing methods - check option is visible in dropdown

* [AAE-1933] Add dropdown page

* [AAE-1933] Remove methods replaced by dropdown page

* [AAE-1933] Fix dropdown methods not working

* [AAE-1933] Fix e2e

* [AAE-1933] Fix task-form-cloud e2e
This commit is contained in:
arditdomi
2020-02-23 14:02:15 +00:00
committed by GitHub
parent 9898ad4401
commit 9e0e2bdfa6
5 changed files with 63 additions and 18 deletions

View File

@@ -112,17 +112,4 @@ export class BrowserActions {
// if the opened menu has only disabled items, pressing escape to close it won't work
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
}
static async clickOnDropdownOption(option: string, dropDownElement: ElementFinder): Promise<void> {
await this.click(dropDownElement);
await BrowserVisibility.waitUntilElementIsVisible(element('div[class*="mat-menu-content"] button'));
const optionElement = element(by.cssContainingText('div[class*="mat-menu-content"] button', option));
await this.click(optionElement);
}
static async clickOnSelectDropdownOption(option: string, dropDownElement: ElementFinder): Promise<void> {
await this.click(dropDownElement);
const optionElement = element(by.cssContainingText('mat-option span.mat-option-text', option));
await this.click(optionElement);
}
}

View File

@@ -0,0 +1,50 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { element, by, ElementFinder } from 'protractor';
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { BrowserActions } from '../../core/utils/browser-actions';
export class DropdownPage {
dropDownElement: ElementFinder;
constructor(dropDownElement: ElementFinder = element.all(by.css('div[class="mat-select-arrow-wrapper"]')).first()) {
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);
}
async selectOption(option: string): Promise<void> {
const optionElement = element(by.cssContainingText('mat-option span.mat-option-text', option));
await BrowserActions.click(optionElement);
}
async getValue(): Promise<string> {
return BrowserActions.getText(element(by.css('mat-form-field span')));
}
}

View File

@@ -17,3 +17,4 @@
export * from './tabs.page';
export * from './date-picker.page';
export * from './dropdown.page';