[ADF-4394]Add two more tests on copyContent (#4630)

* Add two more tests

* Update data-table-component.page.ts

* Fix lint issues
This commit is contained in:
cristinaj
2019-04-23 00:43:56 +03:00
committed by Eugenio Romano
parent 6e4adfb09a
commit b58e040d7e
11 changed files with 91 additions and 38 deletions

View File

@@ -102,13 +102,13 @@ export class DataTableComponentPage {
}
checkRowIsSelected(columnName, columnValue) {
const selectedRow = this.getRowElement(columnName, columnValue).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
const selectedRow = this.getCellElementByValue(columnName, columnValue).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
BrowserVisibility.waitUntilElementIsVisible(selectedRow);
return this;
}
checkRowIsNotSelected(columnName, columnValue) {
const selectedRow = this.getRowElement(columnName, columnValue).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
const selectedRow = this.getCellElementByValue(columnName, columnValue).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
BrowserVisibility.waitUntilElementIsNotOnPage(selectedRow);
return this;
}
@@ -155,7 +155,7 @@ export class DataTableComponentPage {
}
getTooltip(columnName, columnValue) {
return this.getRowElement(columnName, columnValue).getAttribute('title');
return this.getCellElementByValue(columnName, columnValue).getAttribute('title');
}
getFileHyperlink(filename) {
@@ -226,22 +226,17 @@ export class DataTableComponentPage {
}
checkContentIsDisplayed(columnName, columnValue) {
const row = this.getRowElement(columnName, columnValue);
const row = this.getCellElementByValue(columnName, columnValue);
BrowserVisibility.waitUntilElementIsVisible(row);
return this;
}
checkContentIsNotDisplayed(columnName, columnValue) {
const row = this.getRowElement(columnName, columnValue);
const row = this.getCellElementByValue(columnName, columnValue);
BrowserVisibility.waitUntilElementIsNotOnPage(row);
return this;
}
contentInPosition(position) {
BrowserVisibility.waitUntilElementIsVisible(this.contents);
return this.contents.get(position - 1).getText();
}
getRow(columnName, columnValue) {
const row = this.rootElement.all(by.css(`div[title="${columnName}"] div[data-automation-id="text_${columnValue}"]`)).first()
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]`));
@@ -249,7 +244,12 @@ export class DataTableComponentPage {
return row;
}
getRowElement(columnName, columnValue) {
contentInPosition(position) {
BrowserVisibility.waitUntilElementIsVisible(this.contents);
return this.contents.get(position - 1).getText();
}
getCellElementByValue(columnName, columnValue) {
return this.rootElement.all(by.css(`div[title="${columnName}"] div[data-automation-id="text_${columnValue}"] span`)).first();
}
@@ -281,7 +281,11 @@ export class DataTableComponentPage {
return this.list.count();
}
getCellByRowAndColumn(rowColumn, rowContent, columnName) {
getCellByRowNumberAndColumnName(rowNumber, columnName) {
return this.list.get(rowNumber).element(by.css(`div[title="${columnName}"] span`));
}
getCellByRowContentAndColumn(rowColumn, rowContent, columnName) {
return this.getRow(rowColumn, rowContent).element(by.css(`div[title='${columnName}']`));
}
@@ -320,17 +324,27 @@ export class DataTableComponentPage {
}
mouseOverColumn(columnName, columnValue) {
const column = this.getRowElement(columnName, columnValue);
BrowserVisibility.waitUntilElementIsVisible(column);
browser.actions().mouseMove(column).perform();
const column = this.getCellElementByValue(columnName, columnValue);
this.mouseOverElement(column);
return this;
}
mouseOverElement(elem) {
BrowserVisibility.waitUntilElementIsVisible(elem);
browser.actions().mouseMove(elem).perform();
return this;
}
clickColumn(columnName, columnValue) {
const column = this.getRowElement(columnName, columnValue);
BrowserVisibility.waitUntilElementIsVisible(column);
BrowserVisibility.waitUntilElementIsClickable(column);
column.click();
const column = this.getCellElementByValue(columnName, columnValue);
this.clickElement(column);
return this;
}
clickElement(elem) {
BrowserVisibility.waitUntilElementIsVisible(elem);
BrowserVisibility.waitUntilElementIsClickable(elem);
elem.click();
return this;
}
}

View File

@@ -67,7 +67,7 @@ export class TaskListCloudComponentPage {
}
getRow(taskName) {
return this.dataTable.getRowElement('Name', taskName);
return this.dataTable.getCellElementByValue('Name', taskName);
}
checkContentIsDisplayedByProcessInstanceId(taskName) {
@@ -105,7 +105,7 @@ export class TaskListCloudComponentPage {
}
getIdCellValue(rowName) {
const locator = new DataTableComponentPage().getCellByRowAndColumn('Name', rowName, column.id);
const locator = new DataTableComponentPage().getCellByRowContentAndColumn('Name', rowName, column.id);
BrowserVisibility.waitUntilElementIsVisible(locator);
return locator.getText();
}