[ACS-5742] Fix Search e2e's (#8902)

* [ACS-5742] added People filter to demo-shell

* [ACS-5742] fixed search e2e's

* [ACS-5742] linter

* [ACS-5742] build fix

* [ACS-5742] fixed build

* [ACS-5742] removed duplicated unit test
This commit is contained in:
Mykyta Maliarchuk
2023-09-12 11:34:44 +02:00
committed by GitHub
parent 3aa55996bf
commit 0d5e70ebf7
17 changed files with 490 additions and 304 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { element, by, ElementFinder, browser } from 'protractor';
import { element, by, ElementFinder, browser, protractor, By } from 'protractor';
import { BrowserActions } from '../../../core/utils/browser-actions';
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
@@ -58,6 +58,17 @@ export class SearchCheckListPage {
return this;
}
async enterFilterInputValue(option: string): Promise<SearchCheckListPage> {
await this.checkSearchFilterInputIsDisplayed();
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
const inputElement = this.filter.$$(this.inputBy).first();
await BrowserVisibility.waitUntilElementIsClickable(inputElement);
await BrowserActions.clearSendKeys(inputElement, option);
await inputElement.sendKeys(protractor.Key.ENTER);
return this;
}
async checkSearchFilterInputIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter.$$(this.inputBy).first());
}
@@ -116,6 +127,12 @@ export class SearchCheckListPage {
await BrowserVisibility.waitUntilElementIsVisible(result);
}
async checkCheckListAutocompleteOptionIsDisplayed(option: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
const result = element(By.css(`mat-option[data-automation-id='option-${option}']`));
await BrowserVisibility.waitUntilElementIsVisible(result);
}
async checkCheckListOptionIsNotSelected(option: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
const result = this.filter.$(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`);