restore content directive e2e tests (#4915)

* e2e tests for restore content directive

* e2e tests for restore content directive

* e2e tests for restore content directive

* changed the method for restore icon to check for display rather than enabled.

* test enhancements

* removed empty folder test as irrelevant.

* added test for restore of Site or Library

* test enhancements

* test enhancements
This commit is contained in:
Geeta Mandakini Ayyalasomayajula
2019-07-11 16:33:02 +01:00
committed by Eugenio Romano
parent 4185bf8083
commit ffd4413335
5 changed files with 372 additions and 1 deletions

View File

@@ -318,8 +318,14 @@ export class DataTableComponentPage {
return this;
}
checkRowByContentIsNotSelected(folderName) {
const selectedRow = this.getCellByContent(folderName).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
BrowserVisibility.waitUntilElementIsNotVisible(selectedRow);
return this;
}
getCellByContent(content) {
const cell = this.rootElement.element(by.cssContainingText(`div[class*='adf-datatable-row'] div[class*='adf-datatable-cell']`, content));
const cell = this.rootElement.all(by.cssContainingText(`div[class*='adf-datatable-row'] div[class*='adf-datatable-cell']`, content)).first();
BrowserVisibility.waitUntilElementIsVisible(cell);
return cell;
}
@@ -335,12 +341,23 @@ export class DataTableComponentPage {
BrowserActions.click(resultElement);
}
clickRowByContentCheckbox(name) {
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${name}']`)).first().element(by.xpath(`ancestor::div/div/mat-checkbox`));
BrowserActions.click(resultElement);
}
checkRowContentIsDisplayed(content) {
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}']`)).first();
BrowserVisibility.waitUntilElementIsVisible(resultElement);
return this;
}
checkRowContentIsNotDisplayed(content) {
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}']`)).first();
BrowserVisibility.waitUntilElementIsNotVisible(resultElement);
return this;
}
checkRowContentIsDisabled(content) {
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}'] div.adf-cell-value img[aria-label='disable']`)).first();
BrowserVisibility.waitUntilElementIsVisible(resultElement);

View File

@@ -76,4 +76,11 @@ export class BrowserActions {
BrowserActions.click(optionElement);
return this;
}
static clickOnSelectDropdownOption(option: string, dropDownElement: ElementFinder) {
this.click(dropDownElement);
const optionElement = element(by.cssContainingText('mat-option span.mat-option-text', option));
BrowserActions.click(optionElement);
return this;
}
}