From ba822eb044bcc9606d3ab392c8337372193824e2 Mon Sep 17 00:00:00 2001 From: Vito Albano Date: Sat, 9 Mar 2024 02:09:58 +0000 Subject: [PATCH] [affected:*][ci:force] Fixed e2e with new notation --- .../components/material/material-locators.ts | 3 ++- .../components/material/validation.component.ts | 2 +- .../viewer-content-services-component.e2e.ts | 16 +++++++++++++++- e2e/core/login/login-sso/login-sso.e2e.ts | 3 +-- .../infinite-scroll-datasource.spec.ts | 4 ++-- .../card-view-selectitem.component.scss | 2 +- .../search-text/search-text-input.component.scss | 1 - .../core/pages/material/material-locators.ts | 4 ++-- 8 files changed, 24 insertions(+), 11 deletions(-) diff --git a/e2e-playwright/page-object/components/material/material-locators.ts b/e2e-playwright/page-object/components/material/material-locators.ts index c604bd7547..afe2bf711b 100644 --- a/e2e-playwright/page-object/components/material/material-locators.ts +++ b/e2e-playwright/page-object/components/material/material-locators.ts @@ -20,6 +20,7 @@ export const materialLocators = { root: 'mat-error' }, Tooltip: { - root: 'mat-tooltip-component' + root: 'mat-tooltip-component', + message: '.mdc-tooltip__surface' } }; diff --git a/e2e-playwright/page-object/components/material/validation.component.ts b/e2e-playwright/page-object/components/material/validation.component.ts index 8060fefbbc..bc521da4ec 100644 --- a/e2e-playwright/page-object/components/material/validation.component.ts +++ b/e2e-playwright/page-object/components/material/validation.component.ts @@ -21,7 +21,7 @@ import { materialLocators } from './material-locators'; export class TooltipComponent extends BaseComponent { private static rootElement = materialLocators.Tooltip.root; - public content = this.getChild('div'); + public content = this.getChild(materialLocators.Tooltip.message); constructor(page: Page) { super(page, TooltipComponent.rootElement); diff --git a/e2e/content-services/components/viewer-content-services-component.e2e.ts b/e2e/content-services/components/viewer-content-services-component.e2e.ts index 13c314891e..af1bb428b8 100644 --- a/e2e/content-services/components/viewer-content-services-component.e2e.ts +++ b/e2e/content-services/components/viewer-content-services-component.e2e.ts @@ -397,6 +397,11 @@ describe('Content Services Viewer', () => { }); }); + /** + * + * @param originalFileName + * @param newVersionLocation + */ async function uploadNewVersion(originalFileName: string, newVersionLocation: string): Promise { await contentServicesPage.doubleClickRow(originalFileName); await viewerPage.waitTillContentLoaded(); @@ -410,14 +415,23 @@ describe('Content Services Viewer', () => { await browser.refresh(); } + /** + * + * @param unsupportedFileName + */ async function previewUnsupportedFile(unsupportedFileName: string): Promise { await contentServicesPage.doubleClickRow(unsupportedFileName); await viewerPage.waitTillContentLoaded(); await viewerPage.checkUnknownFormatIsDisplayed(); - await expect(await viewerPage.getUnknownFormatMessage()).toBe("Couldn't load preview. Unknown format."); + await expect(await viewerPage.getUnknownFormatMessage()).toBe('Couldn\'t load preview. Unknown format.'); await viewerPage.clickCloseButton(); } + /** + * + * @param fileName + * @param newName + */ async function changeFileNameInViewer(fileName: string, newName: string): Promise { await contentServicesPage.doubleClickRow(fileName); await viewerPage.waitTillContentLoaded(); diff --git a/e2e/core/login/login-sso/login-sso.e2e.ts b/e2e/core/login/login-sso/login-sso.e2e.ts index 1522e08b33..7612e40f51 100644 --- a/e2e/core/login/login-sso/login-sso.e2e.ts +++ b/e2e/core/login/login-sso/login-sso.e2e.ts @@ -69,8 +69,7 @@ describe('Login component - SSO', () => { false, false, browser.params.testConfig.appConfig.oauth2.clientId, - browser.params.testConfig.appConfig.oauth2.redirectUriLogout, - false); + browser.params.testConfig.appConfig.oauth2.redirectUriLogout); await loginPage.waitForElements(); diff --git a/lib/content-services/src/lib/infinite-scroll-datasource/infinite-scroll-datasource.spec.ts b/lib/content-services/src/lib/infinite-scroll-datasource/infinite-scroll-datasource.spec.ts index d98a181b96..966dfa978b 100644 --- a/lib/content-services/src/lib/infinite-scroll-datasource/infinite-scroll-datasource.spec.ts +++ b/lib/content-services/src/lib/infinite-scroll-datasource/infinite-scroll-datasource.spec.ts @@ -122,8 +122,8 @@ describe('InfiniteScrollDatasource', () => { expect(renderedItems[0].innerText).toBe('test1'); expect(renderedItems[2].innerText).toBe('test3'); }); - // eslint-disable-next-line - xit('should load next batch when user scrolls towards the end of the list', fakeAsync(() => { + + it('should load next batch when user scrolls towards the end of the list', fakeAsync(() => { fixture.autoDetectChanges(); const stable = fixture.whenStable(); const renderingDone = fixture.whenRenderingDone(); diff --git a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.scss b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.scss index 382853367e..d7c7c337cb 100644 --- a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.scss +++ b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.scss @@ -20,7 +20,7 @@ border-radius: 6px; /* TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version. */ - .mat-select-value { + .mat-mdc-select-value { color: var(--adf-metadata-action-button-clear-color); } } diff --git a/lib/core/src/lib/search-text/search-text-input.component.scss b/lib/core/src/lib/search-text/search-text-input.component.scss index 6202ebded2..bc1a72a173 100644 --- a/lib/core/src/lib/search-text/search-text-input.component.scss +++ b/lib/core/src/lib/search-text/search-text-input.component.scss @@ -20,7 +20,6 @@ } &-input-form-field-divider { - /* TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version. */ .mat-form-field-underline { background-color: var(--adf-theme-primary-50); diff --git a/lib/testing/src/lib/protractor/core/pages/material/material-locators.ts b/lib/testing/src/lib/protractor/core/pages/material/material-locators.ts index 2e52196352..578b7f22b9 100644 --- a/lib/testing/src/lib/protractor/core/pages/material/material-locators.ts +++ b/lib/testing/src/lib/protractor/core/pages/material/material-locators.ts @@ -391,12 +391,12 @@ export const materialLocators = { root: 'mat-tab-label-active' }, content: { - class: '.mat-mdc-tab-label-content', + class: '.mdc-tab__content', root: 'mat-tab-label-content' } }, labels: { - class: '.mat-mdc-tab-labels' + class: '.mdc-tab__text-label' }, list: '.mat-mdc-tab-list' },