From 4ff16602a3e0354a938c339373f84cea135e9296 Mon Sep 17 00:00:00 2001 From: Vito Albano Date: Tue, 28 Nov 2023 01:01:39 +0000 Subject: [PATCH] Starting fixing e2e --- .../components/basic/validation.component.ts | 2 +- e2e/core/pages/metadata-view.page.ts | 2 +- .../pages/process-service-tab-bar.page.ts | 8 ++++---- .../protractor/core/pages/material/dropdown.page.ts | 12 ++++++------ .../src/lib/protractor/core/pages/pagination.page.ts | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/e2e-playwright/page-object/components/basic/validation.component.ts b/e2e-playwright/page-object/components/basic/validation.component.ts index e861871ee93..44fb5dede15 100644 --- a/e2e-playwright/page-object/components/basic/validation.component.ts +++ b/e2e-playwright/page-object/components/basic/validation.component.ts @@ -19,7 +19,7 @@ import { Page } from '@playwright/test'; import { BaseComponent } from '../base.component'; export class TooltipComponent extends BaseComponent { - private static rootElement = 'mat-tooltip-component'; + private static rootElement = '.mdc-tooltip'; public content = this.getChild('div'); constructor(page: Page) { diff --git a/e2e/core/pages/metadata-view.page.ts b/e2e/core/pages/metadata-view.page.ts index 03c67b4724b..4a9a6266704 100644 --- a/e2e/core/pages/metadata-view.page.ts +++ b/e2e/core/pages/metadata-view.page.ts @@ -128,7 +128,7 @@ export class MetadataViewPage { async clickOnPropertiesTab(): Promise { const propertiesTab = element( - by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`) + by.cssContainingText(`.adf-info-drawer-layout-content div.mat-mdc-tab-label-container .mdc-tab__text-label`, `Properties`) ); await BrowserActions.click(propertiesTab); } diff --git a/e2e/process-services/pages/process-service-tab-bar.page.ts b/e2e/process-services/pages/process-service-tab-bar.page.ts index b35a13c2155..5da42e13756 100644 --- a/e2e/process-services/pages/process-service-tab-bar.page.ts +++ b/e2e/process-services/pages/process-service-tab-bar.page.ts @@ -20,10 +20,10 @@ import { element, by, browser } from 'protractor'; export class ProcessServiceTabBarPage { - tasksButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Tasks')).first(); - processButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Process')).first(); - reportsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Reports')).first(); - reportsButtonSelected = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div[aria-selected="true"]', 'Reports')).first(); + tasksButton = element.all(by.cssContainingText('div.mat-mdc-tab-label-container .mdc-tab__text-label', 'Tasks')).first(); + processButton = element.all(by.cssContainingText('div.mat-mdc-tab-label-container .mdc-tab__text-label', 'Process')).first(); + reportsButton = element.all(by.cssContainingText('div.mat-mdc-tab-label-container .mdc-tab__text-label', 'Reports')).first(); + reportsButtonSelected = element.all(by.cssContainingText('div.mat-mdc-tab-label-container .mdc-tab-indicator--active .mdc-tab__text-label', 'Reports')).first(); async clickTasksButton(): Promise { await BrowserActions.click(this.tasksButton); diff --git a/lib/testing/src/lib/protractor/core/pages/material/dropdown.page.ts b/lib/testing/src/lib/protractor/core/pages/material/dropdown.page.ts index c7ff14464fc..71f21bc8754 100644 --- a/lib/testing/src/lib/protractor/core/pages/material/dropdown.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/material/dropdown.page.ts @@ -35,7 +35,7 @@ export class DropdownPage { async selectOption(option: string): Promise { Logger.log(`Select dropdown option ${option}`); - const optionElement = element.all(by.cssContainingText('mat-option span.mat-option-text', option)).first(); + const optionElement = element.all(by.cssContainingText('.mat-mdc-option .mdc-list-item__primary-text', option)).first(); await BrowserActions.click(optionElement); await browser.waitForAngular(); } @@ -49,7 +49,7 @@ export class DropdownPage { } async getNumberOfOptions(): Promise { - const dropdownOptions = $$('.mat-select-panel mat-option'); + const dropdownOptions = $$('.mat-mdc-select-panel .mat-mdc-option'); return dropdownOptions.count(); } @@ -71,12 +71,12 @@ export class DropdownPage { } async selectOptionFromIndex(index: number): Promise { - const value = element.all(by.className('mat-option')).get(index); + const value = element.all(by.className('mat-mdc-option')).get(index); await BrowserActions.click(value); } async checkOptionsPanelIsDisplayed(): Promise { - await BrowserVisibility.waitUntilElementIsVisible($$(`.mat-select-panel`).first()); + await BrowserVisibility.waitUntilElementIsVisible($$(`.mat-mdc-select-panel`).first()); } async getSelectedOptionText(): Promise { @@ -85,11 +85,11 @@ export class DropdownPage { } async checkOptionIsDisplayed(option: string): Promise { - await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('mat-option span.mat-option-text', option)).first()); + await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('.mat-mdc-option .mdc-list-item__primary-text', option)).first()); } async checkOptionIsNotDisplayed(option: string): Promise { - await BrowserVisibility.waitUntilElementIsNotVisible(element.all(by.cssContainingText('mat-option span.mat-option-text', option)).first()); + await BrowserVisibility.waitUntilElementIsNotVisible(element.all(by.cssContainingText('.mat-mdc-option .mdc-list-item__primary-text', option)).first()); } async selectDropdownOption(option: string): Promise { diff --git a/lib/testing/src/lib/protractor/core/pages/pagination.page.ts b/lib/testing/src/lib/protractor/core/pages/pagination.page.ts index 9f78890492b..ddb086db5e9 100644 --- a/lib/testing/src/lib/protractor/core/pages/pagination.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/pagination.page.ts @@ -26,7 +26,7 @@ export class PaginationPage { pageSelectorArrow = $('button[data-automation-id="page-selector"]'); itemsPerPage = $('.adf-pagination__max-items'); itemsPerPageOpenDropdown = $('.adf-pagination__perpage-block button'); - itemsPerPageOptions = $$('.adf-pagination__page-selector .mat-menu-item'); + itemsPerPageOptions = $$('.adf-pagination__page-selector .mat-mdc-menu-item'); currentPage = $('.adf-pagination__current-page'); totalPages = $('.adf-pagination__total-pages'); paginationRange = $('.adf-pagination__range'); @@ -42,7 +42,7 @@ export class PaginationPage { async selectItemsPerPage(numberOfItem: string): Promise { await BrowserActions.clickExecuteScript(`div[class*="adf-pagination__perpage-block"] button`); await BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorDropDown); - const itemsPerPage = element.all(by.cssContainingText('.mat-menu-item', numberOfItem)).first(); + const itemsPerPage = element.all(by.cssContainingText('.mat-mdc-menu-item', numberOfItem)).first(); await BrowserVisibility.waitUntilElementIsPresent(itemsPerPage); await BrowserActions.click(itemsPerPage); await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorDropDown);