From 4c9005251d4b744290dd6caa29c4baffdd8e0035 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 25 Jul 2024 15:04:39 +0200 Subject: [PATCH 1/6] chore(update): 1244 - update e2e-tests scripts --- frontend/.gitignore | 2 ++ frontend/cypress/support/step_definitions/login.ts | 6 +++--- .../step_definitions/quality-investigations.ts | 4 ++-- frontend/scripts/xray-download-feature-files.sh | 13 ++++++++++--- frontend/scripts/xray-push-test-results.sh | 9 ++++----- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/frontend/.gitignore b/frontend/.gitignore index 9b9cc9d00e..d717e89d7b 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -66,3 +66,5 @@ yarn-error.log scripts/download/* /cypress.local.config.ts +/cypress.local.config-original.ts +/cypress/downloads/Exported_Contracts.csv diff --git a/frontend/cypress/support/step_definitions/login.ts b/frontend/cypress/support/step_definitions/login.ts index 6511214343..18d5de0a77 100644 --- a/frontend/cypress/support/step_definitions/login.ts +++ b/frontend/cypress/support/step_definitions/login.ts @@ -25,10 +25,10 @@ Given('user logged in as {string}', function(userType) { let redirectUri = encodeURIComponent(Cypress.env('REDIRECT_URI')); - cy.visit('https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth?client_id=Cl17-CX-Part&redirect_uri=' + redirectUri + '&state=0aaee615-388e-400c-8b0c-81ac443a2cf3&response_mode=fragment&response_type=code&scope=openid&nonce=4104d5ab-b2bd-43a1-b6c2-7adf30543579&code_challenge=uXHR3gDRnSyjPEu8yWNdzm6Izsd7cKzEryfvRAtJTjU&code_challenge_method=S256'); + cy.visit('https://centralidp.int.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth?client_id=app12&redirect_uri=' + redirectUri); cy.get('.search').click(); - cy.get('.search').type('CX-Test-Access'); - cy.get('.CX_Test_Access').click(); + cy.get('.search').type('BMW Trace-X'); + cy.get('.idp-card').contains('BMW Trace-X').click(); cy.get('input[name="username"]').type(loginMail); cy.get('input[name="password"]').click().focus().type(loginPW, {log:false}); cy.get('input[type="submit"]').click(); diff --git a/frontend/cypress/support/step_definitions/quality-investigations.ts b/frontend/cypress/support/step_definitions/quality-investigations.ts index bc1b58bce4..bd7a2d233c 100644 --- a/frontend/cypress/support/step_definitions/quality-investigations.ts +++ b/frontend/cypress/support/step_definitions/quality-investigations.ts @@ -39,7 +39,7 @@ Then('select part with id {string}', function(id: string) { Then('start notification creation with description {string}', function(notificationType: string, description: string) { const date = new Date().getTime(); notificationDescription = description + '_' + date; - cy.get('[data-testid="create-notification-button"]').click(); + cy.get('[data-testid="create-notification-button"]').click({force: true}); cy.get('mat-label').contains(/^Description$/i).click().type(notificationDescription); }); @@ -65,7 +65,7 @@ When('{string} deadline', function(deadline: string) { When('request the {string}', function(notificationType: string) { - cy.get('[data-testid="save-button"]').click(); + cy.get('[data-testid="save-button"]').click({force: true}); }); diff --git a/frontend/scripts/xray-download-feature-files.sh b/frontend/scripts/xray-download-feature-files.sh index 3ae46023c5..f72e0c00b7 100755 --- a/frontend/scripts/xray-download-feature-files.sh +++ b/frontend/scripts/xray-download-feature-files.sh @@ -13,8 +13,15 @@ # under the License. # # * SPDX-License-Identifier: Apache-2.0 - # https://docs.getxray.app/display/XRAY/Exporting+Cucumber+Tests+-+REST -curl -u $JIRA_USERNAME:$JIRA_PASSWORD "https://jira.catena-x.net/rest/raven/1.0/export/test?filter=${JIRA_FILTER_ID:-11645}&fz=true" -o features.zip + +# Get the authentication token +token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "", "client_secret": "" }' https://xray.cloud.getxray.app/api/v2/authenticate | tr -d '"') + +# Set the output file name +OUTPUT_FILE="features.zip" + unzip -o features.zip -d cypress/e2e -rm -f features.zip + +# Use the token to download the JSON file +curl --request GET --header "Authorization: Bearer $token" "https://xray.cloud.getxray.app/api/v2/export/cucumber?filter=10005&fz=true" -o "$OUTPUT_FILE" diff --git a/frontend/scripts/xray-push-test-results.sh b/frontend/scripts/xray-push-test-results.sh index 5766a579ca..602b389512 100755 --- a/frontend/scripts/xray-push-test-results.sh +++ b/frontend/scripts/xray-push-test-results.sh @@ -13,9 +13,8 @@ # under the License. # # * SPDX-License-Identifier: Apache-2.0 +# Get the authentication token +token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "", "client_secret": "" }' https://xray.cloud.getxray.app/api/v2/authenticate | tr -d '"') -curl --request POST \ - -u $JIRA_USERNAME:$JIRA_PASSWORD \ - --header 'Content-Type: application/json' \ - --data-binary '@cypress/reports/cucumber-report.json' \ - "https://jira.catena-x.net/rest/raven/1.0/import/execution/cucumber" +# Use the token to upload the JSON file +curl --request POST --header "Content-Type: application/json" --header "Authorization: Bearer $token" --data-binary @cypress/reports/cucumber-report.json "https://xray.cloud.getxray.app/api/v2/import/execution/cucumber" From 7ef1bba566f6b6b0e4e547712ad9e20a12e71877 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 15:40:38 +0000 Subject: [PATCH 2/6] chore(deps): bump socket.io from 4.6.1 to 4.7.5 in /frontend Bumps [socket.io](https://github.com/socketio/socket.io) from 4.6.1 to 4.7.5. - [Release notes](https://github.com/socketio/socket.io/releases) - [Changelog](https://github.com/socketio/socket.io/blob/4.7.5/CHANGELOG.md) - [Commits](https://github.com/socketio/socket.io/compare/4.6.1...4.7.5) --- updated-dependencies: - dependency-name: socket.io dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/yarn.lock | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index a0ed6936dd..95e292b47d 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -6405,15 +6405,15 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" -engine.io-parser@~5.0.3: - version "5.0.6" - resolved "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.6.tgz" - integrity sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw== +engine.io-parser@~5.2.1: + version "5.2.3" + resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.2.3.tgz#00dc5b97b1f233a23c9398d0209504cf5f94d92f" + integrity sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q== -engine.io@~6.4.1: - version "6.4.2" - resolved "https://registry.npmjs.org/engine.io/-/engine.io-6.4.2.tgz" - integrity sha512-FKn/3oMiJjrOEOeUub2WCox6JhxBXq/Zn3fZOMCBxKnNYtsdKjxhl7yR3fZhM9PV+rdE75SU5SYMc+2PGzo+Tg== +engine.io@~6.5.2: + version "6.5.5" + resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-6.5.5.tgz#430b80d8840caab91a50e9e23cb551455195fc93" + integrity sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA== dependencies: "@types/cookie" "^0.4.1" "@types/cors" "^2.8.12" @@ -6423,8 +6423,8 @@ engine.io@~6.4.1: cookie "~0.4.1" cors "~2.8.5" debug "~4.3.1" - engine.io-parser "~5.0.3" - ws "~8.11.0" + engine.io-parser "~5.2.1" + ws "~8.17.1" enhanced-resolve@^5.0.0, enhanced-resolve@^5.10.0: version "5.12.0" @@ -11377,25 +11377,26 @@ socket.io-adapter@~2.5.2: dependencies: ws "~8.11.0" -socket.io-parser@~4.2.1: - version "4.2.3" - resolved "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.3.tgz" - integrity sha512-JMafRntWVO2DCJimKsRTh/wnqVvO4hrfwOqtO7f+uzwsQMuxO6VwImtYxaQ+ieoyshWOTJyV0fA21lccEXRPpQ== +socket.io-parser@~4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.2.4.tgz#c806966cf7270601e47469ddeec30fbdfda44c83" + integrity sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew== dependencies: "@socket.io/component-emitter" "~3.1.0" debug "~4.3.1" socket.io@^4.4.1: - version "4.6.1" - resolved "https://registry.npmjs.org/socket.io/-/socket.io-4.6.1.tgz" - integrity sha512-KMcaAi4l/8+xEjkRICl6ak8ySoxsYG+gG6/XfRCPJPQ/haCRIJBTL4wIl8YCsmtaBovcAXGLOShyVWQ/FG8GZA== + version "4.7.5" + resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-4.7.5.tgz#56eb2d976aef9d1445f373a62d781a41c7add8f8" + integrity sha512-DmeAkF6cwM9jSfmp6Dr/5/mfMwb5Z5qRrSXLpo3Fq5SqyU8CMF15jIN4ZhfSwu35ksM1qmHZDQ/DK5XTccSTvA== dependencies: accepts "~1.3.4" base64id "~2.0.0" + cors "~2.8.5" debug "~4.3.2" - engine.io "~6.4.1" + engine.io "~6.5.2" socket.io-adapter "~2.5.2" - socket.io-parser "~4.2.1" + socket.io-parser "~4.2.4" sockjs@^0.3.24: version "0.3.24" @@ -12917,6 +12918,11 @@ ws@~8.11.0: resolved "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz" integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg== +ws@~8.17.1: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== + xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz" From 49e75f0df234505c4274c4866eb5ca61e2ed82e6 Mon Sep 17 00:00:00 2001 From: Maximilian Wesener Date: Thu, 25 Jul 2024 17:01:43 +0200 Subject: [PATCH 3/6] chore(update): xxx - updated testdata. --- .../import-test-data-0DWF_v0.0.14.json | 34 +++++++++---------- .../import-test-data-0UKM_v0.0.14.json | 32 ++++++++--------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tx-backend/testdata/import-test-data-0DWF_v0.0.14.json b/tx-backend/testdata/import-test-data-0DWF_v0.0.14.json index 55a79ce60f..b3c7dbb365 100644 --- a/tx-backend/testdata/import-test-data-0DWF_v0.0.14.json +++ b/tx-backend/testdata/import-test-data-0DWF_v0.0.14.json @@ -62,7 +62,7 @@ "payload" : { "catenaXId" : "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd", "customers" : [ - "BPNL00000003CML1" + "BPNL000000000UKM" ], "parentItems" : [ { @@ -73,7 +73,7 @@ "catenaXId" : "urn:uuid:6b2296cc-26c0-4f38-8a22-092338c36e22", "createdOn" : "2023-05-29T14:48:54.709Z", "lastModifiedOn" : "2023-02-03T14:48:54.709Z", - "businessPartner" : "BPNL00000003CML1", + "businessPartner" : "BPNL000000000UKM", "isOnlyPotentialParent" : false } ] @@ -133,7 +133,7 @@ "createdOn" : "2020-05-02T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z", "catenaXId" : "urn:uuid:4e390dab-707f-446e-bfbe-653f6f5b1f37", - "businessPartner" : "BPNL00000003CML1" + "businessPartner" : "BPNL000000000UKM" } ] } @@ -143,7 +143,7 @@ "payload" : { "catenaXId" : "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", "customers" : [ - "BPNL00000003CML1" + "BPNL000000000UKM" ], "parentItems" : [ { @@ -154,7 +154,7 @@ "catenaXId" : "urn:uuid:d8030bbf-a874-49fb-b2e1-7610f0ccad12", "createdOn" : "2023-07-15T14:48:54.709Z", "lastModifiedOn" : "2023-02-03T14:48:54.709Z", - "businessPartner" : "BPNL00000003CML1", + "businessPartner" : "BPNL000000000UKM", "isOnlyPotentialParent" : false } ] @@ -214,7 +214,7 @@ "createdOn" : "2018-09-17T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z", "catenaXId" : "urn:uuid:4a5e9ff6-2d5c-4510-a90e-d55af3ba502f", - "businessPartner" : "BPNL00000003CML1" + "businessPartner" : "BPNL000000000UKM" } ] } @@ -224,7 +224,7 @@ "payload" : { "catenaXId" : "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd", "customers" : [ - "BPNL00000003CML1" + "BPNL000000000UKM" ], "parentItems" : [ { @@ -235,7 +235,7 @@ "catenaXId" : "urn:uuid:7c7d5aec-b15d-491c-8fbd-c61c6c02c69a", "createdOn" : "2023-02-16T14:48:54.709Z", "lastModifiedOn" : "2023-02-03T14:48:54.709Z", - "businessPartner" : "BPNL00000003CML1", + "businessPartner" : "BPNL000000000UKM", "isOnlyPotentialParent" : false } ] @@ -295,7 +295,7 @@ "createdOn" : "2022-06-28T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z", "catenaXId" : "urn:uuid:6ec3f1db-2798-454b-a73f-0d21a8966c74", - "businessPartner" : "BPNL00000003CML1" + "businessPartner" : "BPNL000000000UKM" } ] } @@ -365,7 +365,7 @@ "payload" : { "catenaXId" : "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fb01", "customers" : [ - "BPNL00000003CML1" + "BPNL000000000UKM" ], "parentItems" : [ { @@ -376,7 +376,7 @@ "catenaXId" : "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa02", "createdOn" : "2023-08-08T14:48:54.709Z", "lastModifiedOn" : "2023-02-03T14:48:54.709Z", - "businessPartner" : "BPNL00000003CML1", + "businessPartner" : "BPNL000000000UKM", "isOnlyPotentialParent" : false } ] @@ -434,7 +434,7 @@ "createdOn" : "2019-08-15T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z", "catenaXId" : "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa03", - "businessPartner" : "BPNL00000003CML1" + "businessPartner" : "BPNL000000000UKM" } ] } @@ -526,7 +526,7 @@ "createdOn" : "2022-09-03T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z", "catenaXId" : "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4da01", - "businessPartner" : "BPNL00000003CML1" + "businessPartner" : "BPNL000000000UKM" } ] } @@ -722,7 +722,7 @@ "value" : 1, "unit" : "unit:litre" }, - "businessPartner" : "BPNL00000003CML1", + "businessPartner" : "BPNL000000000UKM", "createdOn" : "2022-02-08T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z" } @@ -782,7 +782,7 @@ "value" : 1, "unit" : "unit:litre" }, - "businessPartner" : "BPNL00000003CML1", + "businessPartner" : "BPNL000000000UKM", "createdOn" : "2022-02-09T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z" }, @@ -796,7 +796,7 @@ "value" : 1, "unit" : "unit:litre" }, - "businessPartner" : "BPNL00000003CML1", + "businessPartner" : "BPNL000000000UKM", "createdOn" : "2022-02-10T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z" } @@ -856,7 +856,7 @@ "value" : 1, "unit" : "unit:litre" }, - "businessPartner" : "BPNL00000003CML1", + "businessPartner" : "BPNL000000000UKM", "createdOn" : "2022-02-13T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z" } diff --git a/tx-backend/testdata/import-test-data-0UKM_v0.0.14.json b/tx-backend/testdata/import-test-data-0UKM_v0.0.14.json index 023b5c8bf2..8d629f0e74 100644 --- a/tx-backend/testdata/import-test-data-0UKM_v0.0.14.json +++ b/tx-backend/testdata/import-test-data-0UKM_v0.0.14.json @@ -54,7 +54,7 @@ "createdOn" : "2022-02-03T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z", "catenaXId" : "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd", - "businessPartner" : "BPNL00000003CNKC" + "businessPartner" : "BPNL000000000DWF" } ] } @@ -115,7 +115,7 @@ "createdOn" : "2021-01-15T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z", "catenaXId" : "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", - "businessPartner" : "BPNL00000003CNKC" + "businessPartner" : "BPNL000000000DWF" } ] } @@ -165,7 +165,7 @@ "payload" : { "catenaXId" : "urn:uuid:4e390dab-707f-446e-bfbe-653f6f5b1f37", "customers" : [ - "BPNL00000003CNKC" + "BPNL000000000DWF" ], "parentItems" : [ { @@ -176,7 +176,7 @@ "catenaXId" : "urn:uuid:5205f736-8fc2-4585-b869-6bf36842369a", "createdOn" : "2023-12-05T14:48:54.709Z", "lastModifiedOn" : "2023-02-03T14:48:54.709Z", - "businessPartner" : "BPNL00000003CNKC", + "businessPartner" : "BPNL000000000DWF", "isOnlyPotentialParent" : false } ] @@ -238,7 +238,7 @@ "createdOn" : "2022-11-22T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z", "catenaXId" : "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd", - "businessPartner" : "BPNL00000003CNKC" + "businessPartner" : "BPNL000000000DWF" } ] } @@ -288,7 +288,7 @@ "payload" : { "catenaXId" : "urn:uuid:4a5e9ff6-2d5c-4510-a90e-d55af3ba502f", "customers" : [ - "BPNL00000003CNKC" + "BPNL000000000DWF" ], "parentItems" : [ { @@ -299,7 +299,7 @@ "catenaXId" : "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd", "createdOn" : "2023-04-13T14:48:54.709Z", "lastModifiedOn" : "2023-02-03T14:48:54.709Z", - "businessPartner" : "BPNL00000003CNKC", + "businessPartner" : "BPNL000000000DWF", "isOnlyPotentialParent" : false } ] @@ -350,7 +350,7 @@ "payload" : { "catenaXId" : "urn:uuid:6ec3f1db-2798-454b-a73f-0d21a8966c74", "customers" : [ - "BPNL00000003CNKC" + "BPNL000000000DWF" ], "parentItems" : [ { @@ -362,7 +362,7 @@ "createdOn" : "2023-08-21T14:48:54.709Z", "lastModifiedOn" : "2023-02-03T14:48:54.709Z", "isOnlyPotentialParent" : false, - "businessPartner" : "BPNL00000003CNKC" + "businessPartner" : "BPNL000000000DWF" } ] } @@ -457,7 +457,7 @@ "createdOn" : "2016-01-20T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z", "catenaXId" : "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fb01", - "businessPartner" : "BPNL00000003CNKC" + "businessPartner" : "BPNL000000000DWF" } ] } @@ -505,7 +505,7 @@ "payload" : { "catenaXId" : "urn:uuid:1be6ec59-40fb-4993-9836-acb0e284fa03", "customers" : [ - "BPNL00000003CNKC" + "BPNL000000000DWF" ], "parentItems" : [ { @@ -517,7 +517,7 @@ "createdOn" : "2022-07-03T14:48:54.709Z", "lastModifiedOn" : "2023-02-03T14:48:54.709Z", "isOnlyPotentialParent" : false, - "businessPartner" : "BPNL00000003CNKC" + "businessPartner" : "BPNL000000000DWF" } ] } @@ -571,7 +571,7 @@ "createdOn" : "2022-08-03T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z", "catenaXId" : "urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4eb01", - "businessPartner" : "BPNL00000003CNKC" + "businessPartner" : "BPNL000000000DWF" } ] } @@ -745,7 +745,7 @@ "value" : 1, "unit" : "unit:piece" }, - "businessPartner" : "BPNL00000003CNKC", + "businessPartner" : "BPNL000000000DWF", "createdOn" : "2022-01-03T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z" } @@ -905,7 +905,7 @@ "value" : 1, "unit" : "unit:litre" }, - "businessPartner" : "BPNL00000003CNKC", + "businessPartner" : "BPNL000000000DWF", "createdOn" : "2022-02-16T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z" } @@ -1019,7 +1019,7 @@ "value" : 1, "unit" : "unit:litre" }, - "businessPartner" : "BPNL00000003CNKC", + "businessPartner" : "BPNL000000000DWF", "createdOn" : "2022-02-16T14:48:54.709Z", "lastModifiedOn" : "2022-02-03T14:48:54.709Z" } From 63c294ed7b6c557746f858f353142dca6224f1e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 06:14:02 +0000 Subject: [PATCH 4/6] chore(deps): bump braces from 3.0.2 to 3.0.3 in /frontend Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 95e292b47d..bc6e87dabb 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -4981,11 +4981,11 @@ brace-expansion@^2.0.1: balanced-match "^1.0.0" braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: - fill-range "^7.0.1" + fill-range "^7.1.1" browser-process-hrtime@^1.0.0: version "1.0.0" @@ -7264,10 +7264,10 @@ filelist@^1.0.4: dependencies: minimatch "^5.0.1" -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" From a86fc4c919b38e0b75e3fd090143b1a98bcaceb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 06:15:44 +0000 Subject: [PATCH 5/6] chore(deps): bump ws from 7.5.7 to 7.5.10 in /frontend Bumps [ws](https://github.com/websockets/ws) from 7.5.7 to 7.5.10. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/7.5.7...7.5.10) --- updated-dependencies: - dependency-name: ws dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/yarn.lock | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index bc6e87dabb..b38559d0ad 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -12898,24 +12898,19 @@ write-file-atomic@^5.0.0: imurmurhash "^0.1.4" signal-exit "^3.0.7" -ws@^7.3.1: - version "7.5.7" - resolved "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz" - integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== - -ws@^7.4.6: - version "7.5.9" - resolved "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== +ws@^7.3.1, ws@^7.4.6: + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== ws@^8.13.0: - version "8.16.0" - resolved "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz" - integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== ws@~8.11.0: version "8.11.0" - resolved "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg== ws@~8.17.1: From 366bf747662b4d19a9854c1363bbdebfe77eebcf Mon Sep 17 00:00:00 2001 From: ds-lcapellino Date: Fri, 26 Jul 2024 09:55:18 +0200 Subject: [PATCH 6/6] chore: xxx update/refactor e2e-tests-xray_frontend.yml to association int environment --- .github/workflows/e2e-tests-xray_frontend.yml | 179 ++++-------------- CHANGELOG.md | 1 + .../scripts/xray-download-feature-files.sh | 27 --- frontend/scripts/xray-push-test-results.sh | 20 -- 4 files changed, 41 insertions(+), 186 deletions(-) delete mode 100755 frontend/scripts/xray-download-feature-files.sh delete mode 100755 frontend/scripts/xray-push-test-results.sh diff --git a/.github/workflows/e2e-tests-xray_frontend.yml b/.github/workflows/e2e-tests-xray_frontend.yml index db02b572ac..39a5e20b3f 100644 --- a/.github/workflows/e2e-tests-xray_frontend.yml +++ b/.github/workflows/e2e-tests-xray_frontend.yml @@ -16,22 +16,17 @@ # SPDX-License-Identifier: Apache-2.0 # Require to set secrets: -# - ORG_IRS_JIRA_USERNAME -# - ORG_IRS_JIRA_PASSWORD +# - ASSOCIATION_SUPERVISOR_CLIENT_ID +# - ASSOCIATION_SUPERVISOR_PASSWORD name: "[FE][TEST][E2E]- Cypress" on: # triggered manually by Test Manager workflow_dispatch: - inputs: - jira_filter_id: - description: 'Jira filter ID to fetch test scenarios' - required: false - # by default, we use this filter: https://jira.catena-x.net/issues/?filter=11645 - default: 11645 # or automatically by merge to main - #push: - branches: main + push: + branches: + - main paths: - 'frontend/**' @@ -56,14 +51,29 @@ jobs: with: cmd: install # will run `yarn install` command - # Fetch feature files + # Fetch feature files - name: Fetch .feature files from Jira Xray env: - JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }} - JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }} - JIRA_FILTER_ID: ${{ github.event.inputs.jira_filter_id }} + JIRA_USERNAME: ${{ secrets.ASSOCIATION_TX_JIRA_USERNAME }} + JIRA_PASSWORD: ${{ secrets.ASSOCIATION_TX_JIRA_PASSWORD }} working-directory: frontend - run: ./scripts/xray-download-feature-files.sh + run: | + token=$(curl -H "Content-Type: application/json" -X POST \ + --data "{ \"client_id\": \"$JIRA_USERNAME\",\"client_secret\": \"$JIRA_PASSWORD\" }" \ + https://xray.cloud.getxray.app/api/v2/authenticate | tr -d '"') + + export HTTP_RESULT=$(curl -s --show-error -w "%{http_code}" --header "Authorization: Bearer $token" \ + "https://xray.cloud.getxray.app/api/v2/export/cucumber?filter=10007&fz=true" -o features.zip) + + [[ $HTTP_RESULT == 200 || $HTTP_RESULT == 400 ]] + echo "::set-output name=http_response::$HTTP_RESULT" + + - name: Unzip feature files + if: ${{ steps.download.outputs.http_response == '200' }} + working-directory: frontend + run: | + unzip -o features.zip -d cypress/e2e + rm -f features.zip - name: Save cypress/e2e folder uses: actions/upload-artifact@v4 @@ -76,6 +86,7 @@ jobs: cypress-run-chrome: timeout-minutes: 15 runs-on: ubuntu-latest + if: ${{ steps.download.outputs.http_response == '200' }} defaults: run: working-directory: frontend @@ -125,22 +136,30 @@ jobs: working-directory: frontend # using wait-on parameter causes "Error: connect ECONNREFUSED 127.0.0.1:4200" env: - CYPRESS_SUPERVISOR_LOGIN: ${{ secrets.TRACE_X_SUPERVISOR_LOGIN }} - CYPRESS_SUPERVISOR_PW: ${{ secrets.TRACE_X_SUPERVISOR_PW }} + CYPRESS_SUPERVISOR_LOGIN: ${{ secrets.ASSOCIATION_SUPERVISOR_CLIENT_ID }} + CYPRESS_SUPERVISOR_PW: ${{ secrets.ASSOCIATION_SUPERVISOR_PASSWORD }} CYPRESS_ADMIN_LOGIN: ${{ secrets.TRACE_X_ADMIN_LOGIN }} CYPRESS_ADMIN_PW: ${{ secrets.TRACE_X_ADMIN_PW }} CYPRESS_USER_LOGIN: ${{ secrets.TRACE_X_USER_LOGIN }} CYPRESS_USER_PW: ${{ secrets.TRACE_X_USER_PW }} - CYPRESS_REDIRECT_URI: https://traceability-portal-e2e-a.dev.demo.catena-x.net/dashboard + CYPRESS_REDIRECT_URI: https://traceability-portal-int-a.int.catena-x.net/dashboard - name: Submit results to Xray # we don't want to submit results to xray when it was run by PR if: github.event_name != 'pull_request' && (success() || failure()) env: - JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }} - JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }} + JIRA_USERNAME: ${{ secrets.ASSOCIATION_TX_JIRA_USERNAME }} + JIRA_PASSWORD: ${{ secrets.ASSOCIATION_TX_JIRA_PASSWORD }} run: | - ./scripts/xray-push-test-results.sh + token=$(curl -H "Content-Type: application/json" -X POST \ + --data "{ \"client_id\": \"$JIRA_USERNAME\",\"client_secret\": \"$JIRA_PASSWORD\" }" \ + https://xray.cloud.getxray.app/api/v2/authenticate | tr -d '"') + + curl --request POST \ + --header 'Content-Type: application/json' \ + --header "Authorization: Bearer $token" \ + --data-binary '@cypress/reports/cucumber-report.json' \ + "https://xray.cloud.getxray.app/api/v2/import/execution/cucumber" - name: Archive cypress artifacts if: success() || failure() @@ -150,121 +169,3 @@ jobs: path: | frontend/cypress/videos/ frontend/cypress/screenshots/ - - # cypress-run-firefox: - # timeout-minutes: 15 - # runs-on: ubuntu-latest - # defaults: - # run: - # working-directory: frontend - # container: - # # if you need to change image please make sure use the same version in all places - # # (here and in cypress/Dockerfile) - # image: cypress/browsers:node16.16.0-chrome107-ff107-edge - # options: --user 1001 - # needs: install -# - # steps: - # - name: Checkout - # uses: actions/checkout@v4 -# - # - name: Download the cypress/e2e folder - # uses: actions/download-artifact@v4 - # with: - # name: cypress - e2e - # path: frontend/cypress/e2e -# - # - name: Use Node.js 18.x - # uses: actions/setup-node@v4 - # with: - # node-version: 18.x -# - # - name: Cypress run all tests - # uses: cypress-io/github-action@v6.7.1 # use the explicit version number - # with: - # start: npm start - # wait-on: "http://localhost:4200" - # wait-on-timeout: 120 - # browser: firefox - # working-directory: frontend -# - # - name: Submit results to Xray - # # we don't want to submit results to xray when it was run by PR - # if: github.event_name != 'pull_request' && (success() || failure()) - # env: - # JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }} - # JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }} - # run: | - # ./scripts/xray-push-test-results.sh -# - # - name: Archive cypress artifacts - # if: success() || failure() - # uses: actions/upload-artifact@v4 - # with: - # name: cypress generated files - firefox - # path: | - # frontend/cypress/videos/ - # frontend/cypress/screenshots/ -# - # cypress-run-webkit: - # timeout-minutes: 15 - # runs-on: ubuntu-latest - # defaults: - # run: - # working-directory: frontend - # needs: install -# - # steps: - # - name: Checkout - # uses: actions/checkout@v4 -# - # - name: Download the cypress/e2e folder - # uses: actions/download-artifact@v4 - # with: - # name: cypress - e2e - # path: frontend/cypress/e2e - -# commented because if we use it here, we face with that problem: -# "http://localhost:4200 timed out on retry 151 of 5, elapsed 150449ms, limit 150000ms -# Error: connect ECONNREFUSED 127.0.0.1:4200" - -# - name: Use Node.js 18.x - # uses: actions/setup-node@v4 -# with: -# node-version: 18.x - - # - name: Use Node.js 16.x - # uses: actions/setup-node@v4 - # with: - # node-version: 16.x -# - # # https://docs.cypress.io/guides/guides/launching-browsers#Linux-Dependencies - # - name: Install additional dependencies - # run: npx playwright install --with-deps webkit -# - # - name: Cypress run all tests - # uses: cypress-io/github-action@v6.7.1 # use the explicit version number - # with: - # start: npm start:auth:e2ea - # wait-on: "http://localhost:4200" - # wait-on-timeout: 120 - # browser: webkit - # working-directory: frontend -# - # - name: Submit results to Xray - # # we don't want to submit results to xray when it was run by PR - # if: github.event_name != 'pull_request' && (success() || failure()) - # env: - # JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }} - # JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }} - # run: | - # ./scripts/xray-push-test-results.sh -# - # - name: Archive cypress artifacts - # if: success() || failure() - # uses: actions/upload-artifact@v4 - # with: - # name: cypress generated files - webkit - # path: | - # frontend/cypress/videos/ - # frontend/cypress/screenshots/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 03358af972..62d9128fa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha - #XXX update springboot to 3.2.8 from 3.2.5 - #XXX define uid and gid of backend Dockerfile directly in user, instead of variables - #1244 upgraded registry from 0.4.1 to 0.5.0 +- #XXX update e2e-tests-xray_frontend.yml to support association int environment ## [13.0.0 - 19.07.2024] diff --git a/frontend/scripts/xray-download-feature-files.sh b/frontend/scripts/xray-download-feature-files.sh deleted file mode 100755 index f72e0c00b7..0000000000 --- a/frontend/scripts/xray-download-feature-files.sh +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2023 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. * -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# * SPDX-License-Identifier: Apache-2.0 -# https://docs.getxray.app/display/XRAY/Exporting+Cucumber+Tests+-+REST - -# Get the authentication token -token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "", "client_secret": "" }' https://xray.cloud.getxray.app/api/v2/authenticate | tr -d '"') - -# Set the output file name -OUTPUT_FILE="features.zip" - -unzip -o features.zip -d cypress/e2e - -# Use the token to download the JSON file -curl --request GET --header "Authorization: Bearer $token" "https://xray.cloud.getxray.app/api/v2/export/cucumber?filter=10005&fz=true" -o "$OUTPUT_FILE" diff --git a/frontend/scripts/xray-push-test-results.sh b/frontend/scripts/xray-push-test-results.sh deleted file mode 100755 index 602b389512..0000000000 --- a/frontend/scripts/xray-push-test-results.sh +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2023 Contributors to the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# This program and the accompanying materials are made available under the -# terms of the Apache License, Version 2.0 which is available at -# https://www.apache.org/licenses/LICENSE-2.0. * -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# * SPDX-License-Identifier: Apache-2.0 -# Get the authentication token -token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "", "client_secret": "" }' https://xray.cloud.getxray.app/api/v2/authenticate | tr -d '"') - -# Use the token to upload the JSON file -curl --request POST --header "Content-Type: application/json" --header "Authorization: Bearer $token" --data-binary @cypress/reports/cucumber-report.json "https://xray.cloud.getxray.app/api/v2/import/execution/cucumber"