[ACA-1928] e2e improvements - part2 (#884)

* refactor Mark as favourite tests
rename method to be more clear
create separate methods for some checks and actions

* forgot some changes

* refactor delete-undo tests

* some more refactoring

* fix

* small improvements / refactoring
This commit is contained in:
Adina Parpalita
2018-12-21 17:04:13 +02:00
committed by Cilibiu Bogdan
parent b8ce533759
commit 24f5f01900
29 changed files with 511 additions and 493 deletions

View File

@@ -94,7 +94,7 @@ export class DataTable extends Component {
return this.head.all(locator);
}
async getHeaderText() {
async getColumnHeadersText() {
const el = this.getColumnHeaders();
return await el.getText();
}
@@ -319,4 +319,27 @@ export class DataTable extends Component {
async isItemPresent(name: string) {
return await this.getRowByName(name).isPresent();
}
async getEntireDataTableText() {
return this.getRows().map((row) => {
return row.all(this.cell).map(async cell => await cell.getText());
});
}
async getSitesNameAndVisibility() {
const data = await this.getEntireDataTableText();
return data.reduce((acc, cell) => {
acc[cell[1]] = cell[3].toUpperCase();
return acc;
}, {});
}
async getSitesNameAndRole() {
const data = await this.getEntireDataTableText();
return data.reduce((acc, cell) => {
acc[cell[1]] = cell[2];
return acc;
}, {});
}
}