[ACA] Document List - e2e fix (#522)

* e2e fix

* fix name column as link

* fix 1
This commit is contained in:
Cilibiu Bogdan
2018-07-24 12:23:08 +03:00
committed by Denys Vuika
parent 537eeebaf9
commit 9dba35baed
21 changed files with 205 additions and 172 deletions

View File

@@ -141,18 +141,10 @@ export class DataTable extends Component {
return this.body.element(by.cssContainingText(`.adf-data-table-cell span`, name));
}
getRowLink(name: string): ElementFinder {
return this.body.element(by.cssContainingText(`.adf-data-table-cell a`, name));
}
getItemNameTooltip(name: string): promise.Promise<string> {
return this.getRowName(name).getAttribute('title');
}
getLinkCellTooltip(name: string): promise.Promise<string> {
return this.getRowLink(name).getAttribute('title');
}
countRows(): promise.Promise<number> {
return this.getRows().count();
}
@@ -172,12 +164,41 @@ export class DataTable extends Component {
return dblClick.perform();
}
// Navigation/selection methods
doubleClickOnItemNameRow(name: string): promise.Promise<any> {
const dblClick = browser.actions()
.mouseMove(this.getRowName(name).element(by.xpath(`./ancestor::div[contains(@class, 'adf-datatable-row')]`)))
.click()
.click();
return dblClick.perform();
}
clickOnItemName(name: string): promise.Promise<any> {
const item = this.getRowName(name);
return Utils.waitUntilElementClickable(item)
.then(() => this.getRowName(name).click());
}
clickOnItemNameRow(name: string): promise.Promise<any> {
const item = this.getRowName(name);
return Utils.waitUntilElementClickable(item)
.then(() => this.getRowName(name)
.element(by.xpath(`./ancestor::div[contains(@class, 'adf-datatable-row')]`))
.click());
}
selectMultipleItemsRow(names: string[]): promise.Promise<void> {
return this.clearSelection()
.then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform())
.then(() => {
names.forEach(name => {
this.clickOnItemNameRow(name);
});
})
.then(() => browser.actions().sendKeys(protractor.Key.NULL).perform());
}
selectMultipleItems(names: string[]): promise.Promise<void> {
return this.clearSelection()
.then(() => browser.actions().sendKeys(protractor.Key.COMMAND).perform())