mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACA-1088] add tests for search results page and actions on search results (#1051)
* add tests for search results page and actions on search results * fix selector and add more tests * split unshare tests * fix tests * add more tests and TestRail ids
This commit is contained in:
committed by
Denys Vuika
parent
b69ed7da28
commit
deea3465e0
@@ -25,6 +25,7 @@
|
||||
|
||||
import { browser, by, ElementFinder, ExpectedConditions as EC, until } from 'protractor';
|
||||
import { BROWSER_WAIT_TIMEOUT, USE_HASH_STRATEGY } from './../configs';
|
||||
import { Utils } from '../utilities/utils';
|
||||
|
||||
export abstract class Page {
|
||||
protected static locators = {
|
||||
@@ -81,6 +82,16 @@ export abstract class Page {
|
||||
await browser.wait(EC.visibilityOf(this.dialogContainer), BROWSER_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
async isDialogOpen() {
|
||||
return await browser.isElementPresent(this.dialogContainer);
|
||||
}
|
||||
|
||||
async closeOpenDialogs() {
|
||||
while (await this.isDialogOpen()) {
|
||||
await Utils.pressEscape();
|
||||
}
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
await browser.refresh();
|
||||
await this.waitForApp();
|
||||
|
||||
@@ -23,35 +23,37 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { browser, ElementFinder } from 'protractor';
|
||||
import { browser, by } from 'protractor';
|
||||
import { BrowsingPage } from './browsing-page';
|
||||
|
||||
export class SearchResultsPage extends BrowsingPage {
|
||||
|
||||
private static selectors = {
|
||||
root: 'aca-search-results',
|
||||
filter: 'adf-search-filter',
|
||||
expansionPanel: 'mat-expansion-panel',
|
||||
size: '#expansion-panel-SEARCH.CATEGORIES.SIZE',
|
||||
createdDate: '#expansion-panel-SEARCH.CATEGORIES.CREATED_DATE',
|
||||
modifiedDate: '#expansion-panel-SEARCH.CATEGORIES.MODIFIED_DATE',
|
||||
fileType: '#expansion-panel-SEARCH.FACET_FIELDS.FILE_TYPE',
|
||||
creator: '#expansion-panel-SEARCH.CATEGORIES.CREATOR',
|
||||
modifier: '#expansion-panel-SEARCH.CATEGORIES.MODIFIER',
|
||||
location: '#expansion-panel-SEARCH.CATEGORIES.LOCATION',
|
||||
root: 'aca-search-results',
|
||||
|
||||
resultsContent: 'adf-search-results__content',
|
||||
resultsContentHeader: 'adf-search-results__content-header',
|
||||
resultsInfoText: 'adf-search-results--info-text',
|
||||
resultsFacets: 'adf-search-results__facets',
|
||||
filter: 'adf-search-filter',
|
||||
expansionPanel: 'mat-expansion-panel',
|
||||
size: '#expansion-panel-SEARCH.CATEGORIES.SIZE',
|
||||
createdDate: '#expansion-panel-SEARCH.CATEGORIES.CREATED_DATE',
|
||||
modifiedDate: '#expansion-panel-SEARCH.CATEGORIES.MODIFIED_DATE',
|
||||
fileType: '#expansion-panel-SEARCH.FACET_FIELDS.FILE_TYPE',
|
||||
creator: '#expansion-panel-SEARCH.CATEGORIES.CREATOR',
|
||||
modifier: '#expansion-panel-SEARCH.CATEGORIES.MODIFIER',
|
||||
location: '#expansion-panel-SEARCH.CATEGORIES.LOCATION',
|
||||
|
||||
sortingPicker: 'adf-sorting-picker'
|
||||
resultsContent: 'adf-search-results__content',
|
||||
resultsContentHeader: '.adf-search-results__content-header',
|
||||
resultsInfoText: 'adf-search-results--info-text',
|
||||
resultsFacets: 'adf-search-results__facets',
|
||||
|
||||
sortingPicker: 'adf-sorting-picker'
|
||||
};
|
||||
|
||||
root: ElementFinder = browser.$(SearchResultsPage.selectors.root);
|
||||
|
||||
waitForResults() {
|
||||
return this.dataTable.waitForBody();
|
||||
async waitForResults() {
|
||||
return await this.dataTable.waitForBody();
|
||||
}
|
||||
|
||||
async getResultsHeader() {
|
||||
return await browser.element(by.css(SearchResultsPage.selectors.resultsContentHeader)).getText();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user