[ACA-990] add tests for Recent Files, Shared Files and location redirect (#105)

* add tests for Recent Files and Shared Files list views
add tests for location redirect

* small fix
This commit is contained in:
Adina Parpalita
2017-12-04 06:10:23 +02:00
committed by Cilibiu Bogdan
parent 39458aa97a
commit 43b020ca51
8 changed files with 403 additions and 51 deletions

View File

@@ -34,6 +34,7 @@ export class DataTable extends Component {
row: 'tr',
selectedRow: 'tr.is-selected',
cell: 'td',
locationLink: 'app-location-link',
emptyListContainer: 'td.adf-no-content-container',
emptyFolderDragAndDrop: '.adf-empty-list_template .adf-empty-folder',
@@ -45,6 +46,7 @@ export class DataTable extends Component {
head: ElementFinder = this.component.element(by.css(DataTable.selectors.head));
body: ElementFinder = this.component.element(by.css(DataTable.selectors.body));
cell = by.css(DataTable.selectors.cell);
locationLink = by.css(DataTable.selectors.locationLink);
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));
@@ -142,6 +144,15 @@ export class DataTable extends Component {
});
}
getItemLocation(name: string) {
const rowLocator = by.cssContainingText(DataTable.selectors.row, name);
return this.body.element(rowLocator).element(this.locationLink);
}
clickItemLocation(name: string) {
return this.getItemLocation(name).click();
}
// empty state methods
isEmptyList(): promise.Promise<boolean> {
return this.emptyList.isPresent();