[ACA-4511] search layout update (#2272)

* [ACA-4511] search layout update

* * separate description column

* * enable path and fix e2e

* * revert lock  changes
This commit is contained in:
Dharan
2021-08-26 15:04:26 +05:30
committed by GitHub
parent 63dc24494b
commit 5212a40278
17 changed files with 180 additions and 147 deletions

View File

@@ -24,7 +24,7 @@
*/
import { browser, by, ElementArrayFinder, ElementFinder, protractor } from 'protractor';
import { BrowserVisibility, Logger } from '@alfresco/adf-testing';
import { BrowserActions, BrowserVisibility, Logger } from '@alfresco/adf-testing';
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
import { Component } from '../component';
import { Menu } from '../menu/menu';
@@ -41,7 +41,7 @@ export class DataTable extends Component {
cell: '.adf-datatable-cell-container',
lockOwner: '.aca-locked-by',
searchResultsRow: 'aca-search-results-row',
searchResultsRowLine: '.line'
searchResultsRowLine: 'span'
};
head = this.byCss('.adf-datatable-header');
@@ -213,6 +213,14 @@ export class DataTable extends Component {
return '';
}
async getLockOwnerToolTip(itemName: string, location: string = ''): Promise<string> {
if (await this.hasLockIcon(itemName, location)) {
const row = this.getRowByName(itemName, location);
return BrowserActions.getAttribute(row.element(by.css('img[src*="lock"]')), 'alt');
}
return '';
}
private getNameLink(itemName: string): ElementFinder {
return this.getRowNameCell(itemName).$('.adf-datatable-link [role="link"]');
}
@@ -419,34 +427,6 @@ export class DataTable extends Component {
return this.body.element(by.cssContainingText(DataTable.selectors.searchResultsRow, name));
}
private getSearchResultRowLines(name: string, location: string = ''): ElementArrayFinder {
return this.getSearchResultsRowByName(name, location).all(by.css(DataTable.selectors.searchResultsRowLine));
}
async getSearchResultLinesCount(name: string, location: string = ''): Promise<number> {
return this.getSearchResultRowLines(name, location).count();
}
private getSearchResultNthLine(name: string, location: string = '', index: number): ElementFinder {
return this.getSearchResultRowLines(name, location).get(index);
}
async getSearchResultNameAndTitle(name: string, location: string = ''): Promise<string> {
return this.getSearchResultNthLine(name, location, 0).getText();
}
async getSearchResultDescription(name: string, location: string = ''): Promise<string> {
return this.getSearchResultNthLine(name, location, 1).getText();
}
async getSearchResultModified(name: string, location: string = ''): Promise<string> {
return this.getSearchResultNthLine(name, location, 2).getText();
}
async getSearchResultLocation(name: string, location: string = ''): Promise<string> {
return this.getSearchResultNthLine(name, location, 3).getText();
}
private getSearchResultNameLink(itemName: string, location: string = ''): ElementFinder {
return this.getSearchResultsRowByName(itemName, location).$('.link');
}

View File

@@ -45,6 +45,30 @@ export class SearchResultsPage extends BrowsingPage {
return this.infoText.getText();
}
async getName(name: string): Promise<string> {
return this.dataTable.getRowByName(name).element(by.css('[title="Name"] div.search-file-name')).getText();
}
async getDescription(name: string): Promise<string> {
return this.dataTable.getRowByName(name).element(by.css('[title="Description"]')).getText();
}
async getModified(name: string): Promise<string> {
return BrowserActions.getAttribute(this.dataTable.getRowByName(name).element(by.css('[title="Modified"] span')), 'title');
}
async getSize(name: string): Promise<string> {
return this.dataTable.getRowByName(name).element(by.css('[title="Size"]')).getText();
}
async getModifiedBy(name: string): Promise<string> {
return this.dataTable.getRowByName(name).element(by.css('[title="Modified by"]')).getText();
}
async getLocation(name: string): Promise<string> {
return this.dataTable.getRowByName(name).element(by.css('[title="Name"] a')).getText();
}
async getResultsChipsValues(): Promise<string[]> {
const chips = this.chipList.all(by.css('.mat-chip'));
return chips.map(async (elem) => {