From adbbb1abf1a85c9929a3ece3151d5fc2b9eeb7de Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Wed, 29 Jan 2025 15:18:27 +0100 Subject: [PATCH 1/2] e2e(me): apply label changes to the e2e tests --- apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts | 6 +++--- apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts index 025c8932a9..f2f5dff85a 100644 --- a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts @@ -398,7 +398,7 @@ describe('dashboard (authenticated)', () => { cy.get('gn-ui-search-filters-summary') .find('[data-cy="filterSummaryLabel"]') .invoke('text') - .should('eq', 'Modified by: ') + .should('eq', 'Editor: ') }) it('should display the badge for a selected user', () => { cy.get('gn-ui-search-filters-summary') @@ -442,7 +442,7 @@ describe('dashboard (authenticated)', () => { cy.get('gn-ui-search-filters-summary') .find('[data-cy="filterSummaryLabel"]') .invoke('text') - .should('eq', 'Modified on: ') + .should('eq', 'Updated: ') }) it('should display the badge for the selected date range', () => { cy.get('gn-ui-search-filters-summary') @@ -498,7 +498,7 @@ describe('dashboard (authenticated)', () => { cy.get('gn-ui-search-filters-summary') .find('[data-cy="filterSummaryLabel"]') .invoke('text') - .should('eq', 'Modified on: ') + .should('eq', 'Updated: ') }) it('should display the badge for the selected date range', () => { cy.get('gn-ui-search-filters-summary') diff --git a/apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts b/apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts index 0ad237fc08..aeb5fa7079 100644 --- a/apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/record-actions.cy.ts @@ -125,7 +125,7 @@ describe('record-actions', () => { .find('[data-test="disabled-message"]') .should( 'contain.text', - ' This field will be enabled once the data has been published ' + ' This field will be enabled once the dataset has been published ' ) // second page @@ -145,7 +145,7 @@ describe('record-actions', () => { .find('div') .should( 'contain.text', - ' This field will be enabled once the data has been published ' + ' This field will be enabled once the dataset has been published ' ) cy.get('gn-ui-form-field-online-link-resources') @@ -156,7 +156,7 @@ describe('record-actions', () => { .find('div') .should( 'contain.text', - ' This field will be enabled once the data has been published ' + ' This field will be enabled once the dataset has been published ' ) }) From ea5864a5df5ed4b2271240c8802d56f7a120aed2 Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Wed, 29 Jan 2025 15:32:46 +0100 Subject: [PATCH 2/2] chore: add missing extensions to have e2e tests work on node 22 Without these Node would complain with the following error: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/dev/gn-ui/tools/e2e/settings' imported from /dev/gn-ui/tools/e2e/plugins.js see https://nodejs.org/api/esm.html#esm_mandatory_file_extensions --- apps/datahub-e2e/cypress.config.js | 2 +- apps/metadata-editor-e2e/cypress.config.js | 4 ++-- tools/e2e/plugins.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/datahub-e2e/cypress.config.js b/apps/datahub-e2e/cypress.config.js index f59a6d1160..636d474f9e 100644 --- a/apps/datahub-e2e/cypress.config.js +++ b/apps/datahub-e2e/cypress.config.js @@ -1,5 +1,5 @@ import { defineConfig } from 'cypress' -import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset' +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset.js' import { cypressBrowserPermissionsPlugin } from 'cypress-browser-permissions' import { fileURLToPath } from 'url' import { configureCommonPlugins } from '../../tools/e2e/plugins.js' diff --git a/apps/metadata-editor-e2e/cypress.config.js b/apps/metadata-editor-e2e/cypress.config.js index 63146ebaa4..bc7639c15d 100644 --- a/apps/metadata-editor-e2e/cypress.config.js +++ b/apps/metadata-editor-e2e/cypress.config.js @@ -1,6 +1,6 @@ import { defineConfig } from 'cypress' -import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset' -import { configureCommonPlugins } from '../../tools/e2e/plugins' +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset.js' +import { configureCommonPlugins } from '../../tools/e2e/plugins.js' import { cypressBrowserPermissionsPlugin } from 'cypress-browser-permissions' import { fileURLToPath } from 'url' diff --git a/tools/e2e/plugins.js b/tools/e2e/plugins.js index c67eb03ab2..62dbab299e 100644 --- a/tools/e2e/plugins.js +++ b/tools/e2e/plugins.js @@ -1,4 +1,4 @@ -import { VIEWPORT_SIZE } from './settings' +import { VIEWPORT_SIZE } from './settings.js' export function configureCommonPlugins(on, config) { on('before:browser:launch', (browser, launchOptions) => {