From ee4f03a041aed7234fe111d2e2c9e825e5a8ce45 Mon Sep 17 00:00:00 2001 From: Vito Albano Date: Tue, 28 Nov 2023 17:50:21 +0000 Subject: [PATCH] Fixing e2e part 2 --- lib/testing/package.json | 2 +- .../pages/search/search-sorting-picker.page.ts | 2 +- .../src/lib/protractor/core/pages/form/form-fields.ts | 2 +- .../core/pages/form/widgets/attach-file-widget.page.ts | 8 ++++---- .../lib/protractor/core/pages/form/widgets/tab.page.ts | 8 ++++---- .../lib/protractor/core/pages/material/dropdown.page.ts | 4 ++-- .../src/lib/protractor/core/pages/pagination.page.ts | 4 ++-- lib/testing/src/lib/protractor/core/pages/viewer.page.ts | 4 ++-- .../pages/edit-process-filter-cloud-component.page.ts | 2 +- .../pages/form-cloud-component.page.ts | 4 ++-- .../process-services/pages/start-process.page.ts | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/testing/package.json b/lib/testing/package.json index f56acd3074a..6c5aa0121fb 100644 --- a/lib/testing/package.json +++ b/lib/testing/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/Alfresco/alfresco-ng2-components/issues" }, "peerDependencies": { - "@alfresco/js-api": ">=7.3.0" + "@alfresco/js-api": ">=7.2.0" }, "keywords": [ "testing", diff --git a/lib/testing/src/lib/protractor/content-services/pages/search/search-sorting-picker.page.ts b/lib/testing/src/lib/protractor/content-services/pages/search/search-sorting-picker.page.ts index 58fc31b1c06..348f5522f91 100644 --- a/lib/testing/src/lib/protractor/content-services/pages/search/search-sorting-picker.page.ts +++ b/lib/testing/src/lib/protractor/content-services/pages/search/search-sorting-picker.page.ts @@ -22,7 +22,7 @@ import { DropdownPage } from '../../../core/pages/material/dropdown.page'; export class SearchSortingPickerPage { - sortingDropdown = new DropdownPage($('.adf-sorting-picker .mat-select-arrow')); + sortingDropdown = new DropdownPage($('.adf-sorting-picker .mat-mdc-select-arrow')); orderArrow = $('adf-sorting-picker button mat-icon'); async sortBy(sortOrder: string, sortType: string | RegExp): Promise { diff --git a/lib/testing/src/lib/protractor/core/pages/form/form-fields.ts b/lib/testing/src/lib/protractor/core/pages/form/form-fields.ts index 9a9ffafb187..2804e9dd34e 100644 --- a/lib/testing/src/lib/protractor/core/pages/form/form-fields.ts +++ b/lib/testing/src/lib/protractor/core/pages/form/form-fields.ts @@ -21,7 +21,7 @@ import { DropdownPage } from '../material/dropdown.page'; export class FormFields { - selectFormDropdown = new DropdownPage($$('.adf-attach-form .mat-select-arrow').first()); + selectFormDropdown = new DropdownPage($$('.adf-attach-form .mat-mdc-select-arrow').first()); formContent = $('adf-form-renderer'); refreshButton = $('div[class*="form-reload-button"] mat-icon'); saveButton = element(by.cssContainingText('mat-card-actions[class*="adf-for"] span', 'SAVE')); diff --git a/lib/testing/src/lib/protractor/core/pages/form/widgets/attach-file-widget.page.ts b/lib/testing/src/lib/protractor/core/pages/form/widgets/attach-file-widget.page.ts index 8c37cb89cd8..524bb31a2aa 100644 --- a/lib/testing/src/lib/protractor/core/pages/form/widgets/attach-file-widget.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/form/widgets/attach-file-widget.page.ts @@ -28,10 +28,10 @@ export class AttachFileWidgetPage { filesListLocator = 'div[data-automation-id="adf-attach-widget-readonly-list"]'; attachFileWidget = $('#attachfile'); attachedFileMenu = $('mat-list-item button'); - attachedFileOptions = $('.mat-menu-panel .mat-menu-content'); - viewFileOptionButton = $(`.mat-menu-panel .mat-menu-content button[id$="show-file"]`); - downloadFileOptionButton = $(`.mat-menu-panel .mat-menu-content button[id$="download-file"]`); - removeFileOptionButton = TestElement.byCss(`.mat-menu-panel .mat-menu-content button[id$="remove"]`); + attachedFileOptions = $('.mat-mdc-menu-content'); + viewFileOptionButton = $(`.mat-mdc-menu-content button[id$="show-file"]`); + downloadFileOptionButton = $(`.mat-mdc-menu-content button[id$="download-file"]`); + removeFileOptionButton = TestElement.byCss(`.mat-mdc-menu-content button[id$="remove"]`); async attachFile(fieldId: string, fileLocation: string): Promise { const widget = await this.formFields.getWidget(fieldId); diff --git a/lib/testing/src/lib/protractor/core/pages/form/widgets/tab.page.ts b/lib/testing/src/lib/protractor/core/pages/form/widgets/tab.page.ts index 4ca59ef3fba..618bd5fc600 100644 --- a/lib/testing/src/lib/protractor/core/pages/form/widgets/tab.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/form/widgets/tab.page.ts @@ -21,21 +21,21 @@ import { BrowserActions, BrowserVisibility } from '../../../utils/public-api'; export class TabPage { - changeTabAnimation = $('.mat-tab-labels div[class="mat-ripple-element"]'); + changeTabAnimation = $('.mat-mdc-tab-ripple div[class="mat-ripple-element"]'); public disabledContentNodeSelectorTabInfoIcon = TestElement.byCss('[data-automation-id="adf-content-node-selector-disabled-tab-info-icon"]'); async clickTabByLabel(tabLabel): Promise { - const user = element(by.cssContainingText('.mat-tab-label-content', tabLabel)); + const user = element(by.cssContainingText('.mdc-tab__text-label', tabLabel)); await BrowserActions.click(user); await BrowserVisibility.waitUntilElementIsNotVisible(this.changeTabAnimation); } async checkTabIsDisplayedByLabel(tabLabel): Promise { - await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('.mat-tab-label-content', tabLabel))); + await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('.mdc-tab__text-label', tabLabel))); } async checkTabIsNotDisplayedByLabel(tabLabel): Promise { - await BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('.mat-tab-label-content', tabLabel))); + await BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('.mdc-tab__text-label', tabLabel))); } } 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 71f21bc8754..183419c55df 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 @@ -66,7 +66,7 @@ export class DropdownPage { } async checkOptionIsSelected(option: string): Promise { - const selectedOption = this.dropDownElement.element(by.cssContainingText('.mat-select-value-text span', option)); + const selectedOption = this.dropDownElement.element(by.cssContainingText('.mdc-list-item__primary-text', option)); await BrowserVisibility.waitUntilElementIsVisible(selectedOption); } @@ -80,7 +80,7 @@ export class DropdownPage { } async getSelectedOptionText(): Promise { - const selectedOption = this.dropDownElement.$('.mat-select-value-text span'); + const selectedOption = this.dropDownElement.$('.mdc-list-item__primary-text'); return BrowserActions.getText(selectedOption); } 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 ddb086db5e9..f7cf3ee0ee1 100644 --- a/lib/testing/src/lib/protractor/core/pages/pagination.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/pagination.page.ts @@ -34,7 +34,7 @@ export class PaginationPage { nextButtonDisabled = $('button[class*="adf-pagination__next-button"][disabled]'); previousButtonDisabled = $('button[class*="adf-pagination__previous-button"][disabled]'); pageDropDown = $('div[class*="adf-pagination__actualinfo-block"] button'); - pageDropDownOptions = $$('div[class*="mat-menu-content"] button'); + pageDropDownOptions = $$('div[class*="mat-mdc-menu-content"] button'); paginationSection = $('adf-pagination'); paginationSectionEmpty = $('adf-pagination[class*="adf-pagination__empty"]'); totalFiles = $('.adf-pagination__range'); @@ -94,7 +94,7 @@ export class PaginationPage { async clickOnPageDropdownOption(numberOfItemPerPage: string): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.pageDropDownOptions.first()); - const option = element(by.cssContainingText('div[class*="mat-menu-content"] button', numberOfItemPerPage)); + const option = element(by.cssContainingText('div[class*="mat-mdc-menu-content"] button', numberOfItemPerPage)); await BrowserActions.click(option); } diff --git a/lib/testing/src/lib/protractor/core/pages/viewer.page.ts b/lib/testing/src/lib/protractor/core/pages/viewer.page.ts index 27c01ca1d50..6b3e34ed6f8 100644 --- a/lib/testing/src/lib/protractor/core/pages/viewer.page.ts +++ b/lib/testing/src/lib/protractor/core/pages/viewer.page.ts @@ -48,7 +48,7 @@ export class ViewerPage { infoSideBar = $('#adf-right-sidebar'); viewer = $('adf-viewer'); imgViewer = $('adf-img-viewer'); - activeTab = $('div[class*="mat-tab-label-active"]'); + activeTab = $('div[class*="mdc-tab--active"]'); toolbar = $('#adf-viewer-toolbar'); canvasLayer = $$('.canvasWrapper > canvas').first(); @@ -253,7 +253,7 @@ export class ViewerPage { async checkTabIsActive(tabName: string): Promise { const tab = element( - by.cssContainingText('.adf-info-drawer-layout-content div.mat-tab-labels div.mat-tab-label-active .mat-tab-label-content', tabName) + by.cssContainingText('.adf-info-drawer-layout-content div.mat-mdc-tab-label-container .mdc-tab-indicator--active .mdc-tab__text-label', tabName) ); await BrowserVisibility.waitUntilElementIsVisible(tab); } diff --git a/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-process-filter-cloud-component.page.ts b/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-process-filter-cloud-component.page.ts index a30b286df20..a913d75edf6 100644 --- a/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-process-filter-cloud-component.page.ts +++ b/lib/testing/src/lib/protractor/process-services-cloud/pages/edit-process-filter-cloud-component.page.ts @@ -168,7 +168,7 @@ export class EditProcessFilterCloudComponentPage { } isApplicationListLoaded(): Promise { - const emptyList = $(`[data-automation-id='adf-cloud-edit-process-property-appName'] .mat-select-placeholder`); + const emptyList = $(`[data-automation-id='adf-cloud-edit-process-property-appName'] .mat-mdc-select-placeholder`); return BrowserVisibility.waitUntilElementIsNotVisible(emptyList); } diff --git a/lib/testing/src/lib/protractor/process-services-cloud/pages/form-cloud-component.page.ts b/lib/testing/src/lib/protractor/process-services-cloud/pages/form-cloud-component.page.ts index 736714a55ac..0fb471049a1 100644 --- a/lib/testing/src/lib/protractor/process-services-cloud/pages/form-cloud-component.page.ts +++ b/lib/testing/src/lib/protractor/process-services-cloud/pages/form-cloud-component.page.ts @@ -22,8 +22,8 @@ import { ConfigEditorPage } from '../../core/pages/config-editor-page'; export class FormCloudComponentPage { - formCloudEditor = $$('.mat-tab-list .mat-tab-label').get(1); - formCloudRender = $$('.mat-tab-list .mat-tab-label').get(0); + formCloudEditor = $$('.mat-mdc-tab-group .mat-mdc-tab').get(1); + formCloudRender = $$('.mat-mdc-tab-group .mat-mdc-tab').get(0); configEditorPage = new ConfigEditorPage(); diff --git a/lib/testing/src/lib/protractor/process-services/pages/start-process.page.ts b/lib/testing/src/lib/protractor/process-services/pages/start-process.page.ts index 8484479538e..b1bb5bdc38c 100644 --- a/lib/testing/src/lib/protractor/process-services/pages/start-process.page.ts +++ b/lib/testing/src/lib/protractor/process-services/pages/start-process.page.ts @@ -37,7 +37,7 @@ export class StartProcessPage { processDefinitionOptionsPanel = $('div[class*="mat-autocomplete-panel"]'); processDefinitionDropdown = new DropdownPage($('#adf-select-process-dropdown')); - applicationDropdown = new DropdownPage($('[data-automation-id*="start-process-app"] .mat-select-arrow')); + applicationDropdown = new DropdownPage($('[data-automation-id*="start-process-app"] .mat-mdc-select-arrow')); async checkNoProcessMessage(): Promise { await BrowserVisibility.waitUntilElementIsVisible(this.noProcess);