add specific methods for single click on item name link (#618)

automate tests for Single click on item name
This commit is contained in:
Adina Parpalita
2018-09-07 16:17:07 +03:00
committed by Denys Vuika
parent 40a564dfc3
commit b550fe7f72
4 changed files with 228 additions and 22 deletions

View File

@@ -44,7 +44,7 @@ export class DataTable extends Component {
selectedRow: '.adf-datatable-row.is-selected',
cell: '.adf-data-table-cell',
locationLink: '.aca-location-link',
linkCell: '.adf-location-cell',
nameLink: '.dl-link',
selectedIcon: '.mat-icon',
@@ -60,7 +60,7 @@ export class DataTable extends Component {
body: ElementFinder = this.component.element(by.css(DataTable.selectors.body));
cell = by.css(DataTable.selectors.cell);
locationLink = by.css(DataTable.selectors.locationLink);
linkCell: ElementFinder = this.component.element(by.css(DataTable.selectors.linkCell));
nameLink: ElementFinder = browser.element(by.css(DataTable.selectors.nameLink));
emptyList: ElementFinder = this.component.element(by.css(DataTable.selectors.emptyListContainer));
emptyFolderDragAndDrop: ElementFinder = this.component.element(by.css(DataTable.selectors.emptyFolderDragAndDrop));
emptyListTitle: ElementFinder = this.component.element(by.css(DataTable.selectors.emptyListTitle));
@@ -165,6 +165,14 @@ export class DataTable extends Component {
return this.getRowByName(itemName).element(by.css(DataTable.selectors.selectedIcon)).isPresent();
}
getNameLink(itemName: string) {
return this.getRowNameCell(itemName).$(DataTable.selectors.nameLink);
}
hasLinkOnName(itemName: string) {
return this.getNameLink(itemName).isPresent();
}
// Navigation/selection methods
doubleClickOnRowByName(name: string): promise.Promise<any> {
const item = this.getRowFirstCell(name);
@@ -178,6 +186,10 @@ export class DataTable extends Component {
.then(() => item.click());
}
clickNameLink(itemName: string) {
return this.getNameLink(itemName).click();
}
selectMultipleItems(names: string[]): promise.Promise<void> {
return this.clearSelection()
.then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform())