From 52108b3e7184ef3e065f8a6363afeaa9dbd2491e Mon Sep 17 00:00:00 2001 From: Waldemar Mazurek Date: Fri, 20 Dec 2024 15:31:02 +0100 Subject: [PATCH 1/2] Fixes testCompatibility script --- scripts/testCompatibility.sh | 2 +- test/e2e-client-api-test-app/package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/testCompatibility.sh b/scripts/testCompatibility.sh index 120ef7257d..ab343908d4 100755 --- a/scripts/testCompatibility.sh +++ b/scripts/testCompatibility.sh @@ -261,7 +261,7 @@ verifyAndStartWebserver() { echoe "Stepping out" cd .. fi - if [ "${APP_FOLDERS[$i]}" != "/test/e2e-js-test-application" ]; then + if [ "${APP_FOLDERS[$i]}" != "/test/e2e-client-api-test-app" ] && [ "${APP_FOLDERS[$i]}" != "/test/e2e-js-test-application" ]; then runWebserver ${APP_PORTS[$i]} ${APP_PUBLIC_FOLDERS[$i]} ${APP_PATH_CHECK[$i]} else npm run dev & diff --git a/test/e2e-client-api-test-app/package.json b/test/e2e-client-api-test-app/package.json index c33445e944..5594af8b64 100644 --- a/test/e2e-client-api-test-app/package.json +++ b/test/e2e-client-api-test-app/package.json @@ -6,7 +6,8 @@ "scripts": { "copy": "rm -rf .\\public\\assets && mkdirp public/assets && cp node_modules/@luigi-project/container/bundle.js node_modules/@luigi-project/core/*.* node_modules/@luigi-project/client/*.js node_modules/@sap-theming/theming-base-content/content/Base/baseLib/sap_fiori_3/css_variables.css public/assets/", "serve": "live-server --port=3000 --mount=\"/node_modules\":\"./node_modules\" ./public --no-browser", - "start": "npm run copy && npm run serve", + "dev": "npm run copy && npm run serve", + "start": "npm run dev", "cypress-browser": "cypress open --e2e --browser chrome -c video=false", "cypress-headless": "cypress run -c video=false", "test": "echo \"Error: no test specified\" && exit 1" From ab2cf1975430cc990d2d6b904cbc06fa07e5309c Mon Sep 17 00:00:00 2001 From: Waldemar Mazurek Date: Mon, 23 Dec 2024 10:54:58 +0100 Subject: [PATCH 2/2] Fixes e2e test in container --- .../test-app/compound/wc-compound-container.cy.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js b/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js index efe5827644..0cc5b469cc 100644 --- a/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js +++ b/container/cypress/e2e/test-app/compound/wc-compound-container.cy.js @@ -4,7 +4,12 @@ describe('Compound Container Tests', () => { let stub; beforeEach(() => { - cy.visit('http://localhost:8080/compound/compoundClientAPI.html'); + cy.visit('http://localhost:8080/compound/compoundClientAPI.html', { + onBeforeLoad(win) { + // Set up a spy on console.log + cy.stub(win.console, 'log').as('consoleLogSpy'); + } + }); stub = cy.stub(); }); @@ -250,6 +255,7 @@ describe('Compound Container Tests', () => { cy.hash().should('eq', '#openAsModal-wc'); }); }); + it('openAsDrawer webcomponent container', () => { cy.on('window:alert', stub); @@ -261,6 +267,7 @@ describe('Compound Container Tests', () => { cy.hash().should('eq', '#openAsDrawer-wc'); }); }); + it('openAsSplitview webcomponent container', () => { cy.on('window:alert', stub); @@ -276,11 +283,6 @@ describe('Compound Container Tests', () => { it('LuigiClient API publishEvent', () => { cy.on('window:alert', stub); - // Set up a spy on console.log - cy.window().then((win) => { - cy.spy(win.console, 'log').as('consoleLogSpy'); - }); - cy.get(containerSelector) .shadow() .contains('Publish event')