mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
* cleanup login (demo shell) * cleanup e2e from useless calls * [ci:force] cleanup e2e from useless calls * [ci:force] cleanup e2e from useless calls * [ci:force] improved uploader selectors * [ci:force] remove useless selectors when automation id provided * [ci:force] improved tests and selectors * [ci:force] improved tests and selectors * [ci:force] improved tests and selectors * [ci:force] improved tests and selectors * [ci:force] improved tests and selectors * [ci:force] improved tests and selectors * [ci:force] switch edit task filter to angular harness * [ci:force] switch edit process filter to angular harness * [ci:force] switch search chip list to angular harness * [ci:force] switch search panel to angular harness * [ci:force] switch search radio to angular harness * [ci:force] switch search text to angular harness * [ci:force] search logical filter * [ci:force] search form component * [ci:force] search filter container * [ci:force] fix viewer test * [ci:force] search facet chip harness * [ci:force] search facet chip harness * [ci:force] dropdown breadcrumb * [ci:force] search check list * [ci:force] folder dialog * [ci:force] search filter component * [ci:force] json cell * [ci:force] amount widget * [ci:force] checkbox widget * [ci:force] multiline-text widget * [ci:force] number widget * [ci:force] text widget * [ci:force] card view array item * add permission dialog * permission container component * permission list component * card view components * search widget chip * search facet chip * edit service task filter * card view components * sites dropdown * share dialog * header component * datetime widget * remove comments
95 lines
3.8 KiB
TypeScript
95 lines
3.8 KiB
TypeScript
/*!
|
|
* @license
|
|
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
|
*
|
|
* 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 { ElementFinder, protractor, $ } from 'protractor';
|
|
import { BrowserVisibility, BrowserActions, TestElement } from '@alfresco/adf-testing';
|
|
|
|
export class SearchBarPage {
|
|
searchIcon = $(`button[class*='adf-search-button']`);
|
|
searchBar = $(`adf-search-control input`);
|
|
searchBarExpanded: TestElement = TestElement.byCss(`adf-search-control mat-form-field[class*="mat-focused"] input`);
|
|
noResultMessage = $(`p[class*='adf-search-fixed-text']`);
|
|
rowsAuthor = `.mat-list-text p[class*='adf-search-fixed-text']`;
|
|
completeName = `h4[class*='adf-search-fixed-text']`;
|
|
highlightName = `.adf-highlight`;
|
|
searchBarPage = $(`mat-list[id='autocomplete-search-result-list']`);
|
|
|
|
getRowByRowName = (name: string): ElementFinder => $(`[data-automation-id='autocomplete_for_${name}']`);
|
|
|
|
async clickOnSearchIcon(): Promise<void> {
|
|
await BrowserActions.click(this.searchIcon);
|
|
}
|
|
|
|
async checkSearchIconIsVisible(): Promise<void> {
|
|
await BrowserVisibility.waitUntilElementIsVisible(this.searchIcon);
|
|
}
|
|
|
|
async checkSearchBarIsVisible(): Promise<void> {
|
|
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
|
}
|
|
|
|
async checkSearchBarIsNotVisible(): Promise<void> {
|
|
await this.searchBarExpanded.waitNotVisible();
|
|
}
|
|
|
|
async checkNoResultMessageIsDisplayed(): Promise<void> {
|
|
await BrowserVisibility.waitUntilElementIsVisible(this.noResultMessage);
|
|
}
|
|
|
|
async checkNoResultMessageIsNotDisplayed(): Promise<void> {
|
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.noResultMessage);
|
|
}
|
|
|
|
async enterText(text: string): Promise<void> {
|
|
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
|
await BrowserActions.clearSendKeys(this.searchBar, text);
|
|
}
|
|
|
|
async enterTextAndPressEnter(text: string): Promise<void> {
|
|
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
|
await BrowserActions.clearSendKeys(this.searchBar, text);
|
|
await this.searchBar.sendKeys(protractor.Key.ENTER);
|
|
}
|
|
|
|
async resultTableContainsRow(name: string): Promise<void> {
|
|
await BrowserVisibility.waitUntilElementIsVisible(this.searchBarPage);
|
|
await BrowserVisibility.waitUntilElementIsVisible(this.getRowByRowName(name));
|
|
}
|
|
|
|
async clickOnSpecificRow(fileName: string): Promise<void> {
|
|
await this.resultTableContainsRow(fileName);
|
|
await BrowserActions.click(this.getRowByRowName(fileName));
|
|
}
|
|
|
|
async getSpecificRowsHighlightName(fileName: string): Promise<string> {
|
|
return BrowserActions.getText(this.getRowByRowName(fileName).$(this.highlightName));
|
|
}
|
|
|
|
async getSpecificRowsCompleteName(fileName: string): Promise<string> {
|
|
return BrowserActions.getText(this.getRowByRowName(fileName).$(this.completeName));
|
|
}
|
|
|
|
async getSpecificRowsAuthor(fileName: string): Promise<string> {
|
|
return BrowserActions.getText(this.getRowByRowName(fileName).$(this.rowsAuthor));
|
|
}
|
|
|
|
async clearText(): Promise<void> {
|
|
await BrowserVisibility.waitUntilElementIsVisible(this.searchBar);
|
|
await this.searchBar.clear();
|
|
}
|
|
}
|