[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

@@ -651,7 +651,7 @@ export class ContentServicesPage {
}
checkRowIsDisplayed(rowName) {
const row = this.contentList.dataTablePage().getRowElement('Display name', rowName);
const row = this.contentList.dataTablePage().getCellElementByValue('Display name', rowName);
BrowserVisibility.waitUntilElementIsVisible(row);
}

View File

@@ -71,7 +71,7 @@ export class CustomSources {
}
getStatusCell(rowName) {
const cell = this.dataTable.getCellByRowAndColumn('Name', rowName, column.status);
const cell = this.dataTable.getCellByRowContentAndColumn('Name', rowName, column.status);
BrowserVisibility.waitUntilElementIsVisible(cell);
return cell.getText();
}

View File

@@ -24,7 +24,8 @@ export class DataTablePage {
columns = {
id: 'Id',
name: 'Name',
createdBy: 'Created By'
createdBy: 'Created By',
json: 'Json'
};
data = {
@@ -66,7 +67,7 @@ export class DataTablePage {
}
replaceRows(id) {
const rowID = this.dataTable.getRowElement(this.columns.id, id);
const rowID = this.dataTable.getCellElementByValue(this.columns.id, id);
BrowserVisibility.waitUntilElementIsVisible(rowID);
this.replaceRowsElement.click();
BrowserVisibility.waitUntilElementIsNotVisible(rowID);
@@ -89,7 +90,7 @@ export class DataTablePage {
}
checkRowIsNotSelected(rowNumber) {
const isRowSelected = this.dataTable.getRowElement(this.columns.id, rowNumber)
const isRowSelected = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`));
BrowserVisibility.waitUntilElementIsNotOnPage(isRowSelected);
}
@@ -116,13 +117,14 @@ export class DataTablePage {
}
clickCheckbox(rowNumber) {
const checkbox = this.dataTable.getRowElement(this.columns.id, rowNumber).element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
const checkbox = this.dataTable.getCellElementByValue(this.columns.id, rowNumber)
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
BrowserVisibility.waitUntilElementIsVisible(checkbox);
checkbox.click();
}
selectRow(rowNumber) {
const locator = this.dataTable.getRowElement(this.columns.id, rowNumber);
const locator = this.dataTable.getCellElementByValue(this.columns.id, rowNumber);
BrowserVisibility.waitUntilElementIsVisible(locator);
BrowserVisibility.waitUntilElementIsClickable(locator);
locator.click();
@@ -130,7 +132,7 @@ export class DataTablePage {
}
selectRowWithKeyboard(rowNumber) {
const row = this.dataTable.getRowElement(this.columns.id, rowNumber);
const row = this.dataTable.getCellElementByValue(this.columns.id, rowNumber);
browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform();
}
@@ -142,7 +144,7 @@ export class DataTablePage {
}
getRowCheckbox(rowNumber) {
return this.dataTable.getRowElement(this.columns.id, rowNumber).element(by.xpath(`ancestor::div/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]`));
return this.dataTable.getCellElementByValue(this.columns.id, rowNumber).element(by.xpath(`ancestor::div/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]`));
}
getCopyContentTooltip() {
@@ -161,10 +163,18 @@ export class DataTablePage {
return this.dataTable.mouseOverColumn(this.columns.id, name);
}
mouseOverJsonColumn(rowNumber) {
return this.dataTable.mouseOverElement(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
}
clickOnIdColumn(name) {
return this.dataTable.clickColumn(this.columns.id, name);
}
clickOnJsonColumn(rowNumber) {
return this.dataTable.clickElement(this.dataTable.getCellByRowNumberAndColumnName(rowNumber - 1, this.columns.json));
}
clickOnNameColumn(name) {
return this.dataTable.clickColumn(this.columns.name, name);
}

View File

@@ -119,7 +119,7 @@ export class PermissionsPage {
}
getRoleCellValue(rowName) {
const locator = new DataTableComponentPage().getCellByRowAndColumn('Authority ID', rowName, column.role);
const locator = new DataTableComponentPage().getCellByRowContentAndColumn('Authority ID', rowName, column.role);
BrowserVisibility.waitUntilElementIsVisible(locator);
return locator.getText();
}

View File

@@ -29,7 +29,7 @@ export class SearchResultsPage {
contentServices = new ContentServicesPage();
getNodeHighlight(content) {
return this.dataTable.getCellByRowAndColumn('Display name', content, 'Search');
return this.dataTable.getCellByRowContentAndColumn('Display name', content, 'Search');
}
tableIsLoaded() {