mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-2989]Add doubleClickRow method (#5728)
* Add doubleClickRow method * Renamed the method to be in sync with the actions made * Modified the columns parameter from 'any' to 'Column[]' * no message * Make Column abstract again * Add locators snackbar action * Unblock Travis * no message
This commit is contained in:
@@ -18,10 +18,10 @@
|
|||||||
export abstract class Column {
|
export abstract class Column {
|
||||||
columnName: string;
|
columnName: string;
|
||||||
columnType: string;
|
columnType: string;
|
||||||
locator: string;
|
|
||||||
|
|
||||||
constructor(columnName: string) {
|
constructor(columnName: string, columnType: string ) {
|
||||||
this.columnName = columnName;
|
this.columnName = columnName;
|
||||||
|
this.columnType = columnType;
|
||||||
}
|
}
|
||||||
|
|
||||||
createLocator(columnValue: string): string {
|
createLocator(columnValue: string): string {
|
||||||
|
@@ -23,7 +23,7 @@ import { ElementFinder } from 'protractor';
|
|||||||
|
|
||||||
export class DataTableBuilder {
|
export class DataTableBuilder {
|
||||||
|
|
||||||
createDataTable(columns: Array<Column>, rootElement?: ElementFinder): DataTableItem {
|
createDataTable(columns: Column[], rootElement?: ElementFinder): DataTableItem {
|
||||||
const datatable: DataTableItem = new DataTableItem(rootElement);
|
const datatable: DataTableItem = new DataTableItem(rootElement);
|
||||||
for (const column of columns) {
|
for (const column of columns) {
|
||||||
switch (column.columnType) {
|
switch (column.columnType) {
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Column } from './column';
|
import { Column } from './column';
|
||||||
import { by, element, ElementFinder, Locator } from 'protractor';
|
import { by, element, ElementFinder, Locator, protractor, browser } from 'protractor';
|
||||||
import { BrowserActions } from '../../utils/browser-actions';
|
import { BrowserActions } from '../../utils/browser-actions';
|
||||||
import { BrowserVisibility } from '../../utils/browser-visibility';
|
import { BrowserVisibility } from '../../utils/browser-visibility';
|
||||||
|
|
||||||
@@ -59,4 +59,10 @@ export class DataTableItem {
|
|||||||
async waitForFirstRow(): Promise<void> {
|
async waitForFirstRow(): Promise<void> {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.all(this.rows).first());
|
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.all(this.rows).first());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async clickAndEnterOnRow(columnName: string, columnValue: string): Promise<void> {
|
||||||
|
const row = this.getRow(columnName, columnValue);
|
||||||
|
await BrowserActions.click(row);
|
||||||
|
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,10 +18,10 @@
|
|||||||
import { Column } from './column';
|
import { Column } from './column';
|
||||||
|
|
||||||
export class DateColumn extends Column {
|
export class DateColumn extends Column {
|
||||||
columnType: string = 'date';
|
columnType: string;
|
||||||
columnName: string;
|
columnName: string;
|
||||||
|
|
||||||
constructor(columnName: string) {
|
constructor(columnName: string) {
|
||||||
super(columnName);
|
super(columnName, 'date');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,10 +18,10 @@
|
|||||||
import { Column } from './column';
|
import { Column } from './column';
|
||||||
|
|
||||||
export class TextColumn extends Column {
|
export class TextColumn extends Column {
|
||||||
columnType: string = 'text';
|
columnType: string;
|
||||||
columnName: string;
|
columnName: string;
|
||||||
|
|
||||||
constructor(columnName: string) {
|
constructor(columnName: string) {
|
||||||
super(columnName);
|
super(columnName, 'text');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,10 +17,12 @@
|
|||||||
|
|
||||||
import { element, by, ElementFinder } from 'protractor';
|
import { element, by, ElementFinder } from 'protractor';
|
||||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||||
|
import { BrowserActions } from '../utils/browser-actions';
|
||||||
|
|
||||||
export class SnackbarPage {
|
export class SnackbarPage {
|
||||||
|
|
||||||
notificationSnackBar: ElementFinder = element.all(by.css('simple-snack-bar span')).first();
|
notificationSnackBar: ElementFinder = element.all(by.css('simple-snack-bar span')).first();
|
||||||
|
snackBarAction: ElementFinder = element(by.css('simple-snack-bar button span'));
|
||||||
snackBarContainerCss = by.css('.mat-snack-bar-container');
|
snackBarContainerCss = by.css('.mat-snack-bar-container');
|
||||||
|
|
||||||
async waitForSnackBarToAppear() {
|
async waitForSnackBarToAppear() {
|
||||||
@@ -38,6 +40,16 @@ export class SnackbarPage {
|
|||||||
return this.notificationSnackBar.getText();
|
return this.notificationSnackBar.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getSnackBarActionMessage(): Promise<string> {
|
||||||
|
await this.waitForSnackBarToAppear();
|
||||||
|
return this.snackBarAction.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
async clickSnackBarAction(): Promise<void> {
|
||||||
|
await this.waitForSnackBarToAppear();
|
||||||
|
await BrowserActions.click(this.snackBarAction);
|
||||||
|
}
|
||||||
|
|
||||||
async isNotificationSnackBarDisplayed(): Promise<boolean> {
|
async isNotificationSnackBarDisplayed(): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.notificationSnackBar, 2000);
|
await BrowserVisibility.waitUntilElementIsVisible(this.notificationSnackBar, 2000);
|
||||||
|
Reference in New Issue
Block a user