mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
Various code fixes (#1704)
* fix typings and missing lib * fix i18n typo, add typings * code improvements * fix missing awaits * more fixes * fix bug in the evaluators, simplify code * more fixes
This commit is contained in:
@@ -23,12 +23,12 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { ElementFinder, ElementArrayFinder, by, browser, protractor } from 'protractor';
|
||||
import { browser, by, ElementArrayFinder, ElementFinder, protractor } from 'protractor';
|
||||
import { Logger } from '@alfresco/adf-testing';
|
||||
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
|
||||
import { Component } from '../component';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Utils, waitForPresence, waitForClickable } from '../../utilities/utils';
|
||||
import { Utils, waitForClickable, waitForPresence } from '../../utilities/utils';
|
||||
|
||||
export class DataTable extends Component {
|
||||
private static selectors = {
|
||||
@@ -146,10 +146,9 @@ export class DataTable extends Component {
|
||||
}
|
||||
|
||||
async getSelectedRowsNames(): Promise<string[]> {
|
||||
const rowsText: string[] = await this.getSelectedRows().map((row) => {
|
||||
return this.getSelectedRows().map((row) => {
|
||||
return row.element(by.css('.adf-datatable-cell[title="Name"]')).getText();
|
||||
});
|
||||
return rowsText;
|
||||
}
|
||||
|
||||
async getSelectedRowsCount(): Promise<number> {
|
||||
@@ -358,10 +357,9 @@ export class DataTable extends Component {
|
||||
|
||||
async getCellsContainingName(name: string): Promise<string[]> {
|
||||
const rows = this.getRows().all(by.cssContainingText(DataTable.selectors.cell, name));
|
||||
const cellsText: string[] = await rows.map(async (cell) => {
|
||||
return rows.map(async (cell) => {
|
||||
return cell.getText();
|
||||
});
|
||||
return cellsText;
|
||||
}
|
||||
|
||||
async hasContextMenu(): Promise<boolean> {
|
||||
@@ -378,12 +376,11 @@ export class DataTable extends Component {
|
||||
}
|
||||
|
||||
private async getEntireDataTableText(): Promise<string[]> {
|
||||
const text: string[] = await this.getRows().map((row) => {
|
||||
return this.getRows().map((row) => {
|
||||
return row.all(by.css(DataTable.selectors.cell)).map(async (cell) => {
|
||||
return cell.getText();
|
||||
});
|
||||
});
|
||||
return text;
|
||||
}
|
||||
|
||||
async getSitesNameAndVisibility(): Promise<any> {
|
||||
|
Reference in New Issue
Block a user