[ADF-NO-ISSUE] Changing locators using arial-label (#4180)

This commit is contained in:
Marouan Bentaleb 2019-02-18 18:44:17 +00:00 committed by Eugenio Romano
parent 2a2708e5d6
commit f20a71438c
5 changed files with 5 additions and 13 deletions

View File

@ -20,7 +20,7 @@ import { element, by } from 'protractor';
export class LockFilePage {
cancelButton = element(by.css('button[aria-label="Close dialog"]'));
cancelButton = element(by.css('button[data-automation-id="lock-dialog-btn-cancel"]'));
saveButton = element(by.cssContainingText('button span', 'Save'));
lockFileCheckboxText = element(by.cssContainingText('mat-checkbox label span', ' Lock file '));
lockFileCheckbox = element(by.css('mat-checkbox[data-automation-id="adf-lock-node-checkbox"]'));

View File

@ -22,7 +22,7 @@ export class PaginationPage {
itemsPerPageDropdown = element(by.css('div[class*="adf-pagination__perpage-block"] button'));
pageSelectorDropDown = element(by.css('div[class*="adf-pagination__page-selector"]'));
pageSelectorArrow = element(by.css('button[aria-label="Current page selector"]'));
pageSelectorArrow = element(by.css('button[data-automation-id="page-selector"]'));
itemsPerPage = element(by.css('span[class="adf-pagination__max-items"]'));
currentPage = element(by.css('span[class="adf-pagination__current-page"]'));
totalPages = element(by.css('span[class="adf-pagination__total-pages"]'));

View File

@ -35,8 +35,7 @@ export class DynamicTableWidget {
calendarContent = element(by.css('div[class="mat-datetimepicker-calendar-content"]'));
saveButton = element(by.cssContainingText('button span', 'Save'));
errorMessage = element(by.css('div[class="adf-error-text"]'));
dateWidget = element.all(by.css('button[aria-label="Open calendar"]')).first();
calendarNumber = element.all(by.css('td div'));
dateWidget = element.all(by.css('mat-datepicker-toggle button')).first();
tableRow = element.all(by.css('tbody tr'));
dataTableInput = element(by.id('id'));
@ -134,18 +133,10 @@ export class DynamicTableWidget {
return this.dateWidget.click();
}
getDateCalendarNumber(date) {
return this.calendarNumber.get(date).click();
}
getTableRow(rowNumber) {
return Util.waitUntilElementIsVisible(this.tableRow.get(rowNumber));
}
waitForCalendarToDisappear() {
Util.waitUntilElementIsNotVisible(this.calendarNumber);
}
checkItemIsPresent(item) {
let row = element(by.cssContainingText('table tbody tr td span', item));
let present = Util.waitUntilElementIsVisible(row);

View File

@ -37,7 +37,7 @@
<mat-dialog-actions class="adf-dialog-buttons">
<span class="adf-fill-remaining-space"></span>
<button mat-button mat-dialog-close>
<button mat-button mat-dialog-close data-automation-id="lock-dialog-btn-cancel">
{{ 'CORE.FILE_DIALOG.CANCEL_BUTTON.LABEL' | translate }}
</button>

View File

@ -43,6 +43,7 @@
<button
mat-icon-button
data-automation-id="page-selector"
[attr.aria-label]="'CORE.PAGINATION.ARIA.CURRENT_PAGE' | translate"
[matMenuTriggerFor]="pagesMenu"
*ngIf="pages.length > 1">