Skip to content

Commit 4c90052

Browse files
committed
chore(update): 1244 - update e2e-tests scripts
1 parent fe4ea09 commit 4c90052

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

frontend/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,5 @@ yarn-error.log
6666

6767
scripts/download/*
6868
/cypress.local.config.ts
69+
/cypress.local.config-original.ts
70+
/cypress/downloads/Exported_Contracts.csv

frontend/cypress/support/step_definitions/login.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ Given('user logged in as {string}', function(userType) {
2525

2626
let redirectUri = encodeURIComponent(Cypress.env('REDIRECT_URI'));
2727

28-
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');
28+
cy.visit('https://centralidp.int.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth?client_id=app12&redirect_uri=' + redirectUri);
2929
cy.get('.search').click();
30-
cy.get('.search').type('CX-Test-Access');
31-
cy.get('.CX_Test_Access').click();
30+
cy.get('.search').type('BMW Trace-X');
31+
cy.get('.idp-card').contains('BMW Trace-X').click();
3232
cy.get('input[name="username"]').type(loginMail);
3333
cy.get('input[name="password"]').click().focus().type(loginPW, {log:false});
3434
cy.get('input[type="submit"]').click();

frontend/cypress/support/step_definitions/quality-investigations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Then('select part with id {string}', function(id: string) {
3939
Then('start notification creation with description {string}', function(notificationType: string, description: string) {
4040
const date = new Date().getTime();
4141
notificationDescription = description + '_' + date;
42-
cy.get('[data-testid="create-notification-button"]').click();
42+
cy.get('[data-testid="create-notification-button"]').click({force: true});
4343
cy.get('mat-label').contains(/^Description$/i).click().type(notificationDescription);
4444
});
4545

@@ -65,7 +65,7 @@ When('{string} deadline', function(deadline: string) {
6565

6666

6767
When('request the {string}', function(notificationType: string) {
68-
cy.get('[data-testid="save-button"]').click();
68+
cy.get('[data-testid="save-button"]').click({force: true});
6969
});
7070

7171

frontend/scripts/xray-download-feature-files.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@
1313
# under the License.
1414
#
1515
# * SPDX-License-Identifier: Apache-2.0
16-
1716
# https://docs.getxray.app/display/XRAY/Exporting+Cucumber+Tests+-+REST
18-
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
17+
18+
# Get the authentication token
19+
token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "", "client_secret": "" }' https://xray.cloud.getxray.app/api/v2/authenticate | tr -d '"')
20+
21+
# Set the output file name
22+
OUTPUT_FILE="features.zip"
23+
1924
unzip -o features.zip -d cypress/e2e
20-
rm -f features.zip
25+
26+
# Use the token to download the JSON file
27+
curl --request GET --header "Authorization: Bearer $token" "https://xray.cloud.getxray.app/api/v2/export/cucumber?filter=10005&fz=true" -o "$OUTPUT_FILE"

frontend/scripts/xray-push-test-results.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
# under the License.
1414
#
1515
# * SPDX-License-Identifier: Apache-2.0
16+
# Get the authentication token
17+
token=$(curl -H "Content-Type: application/json" -X POST --data '{ "client_id": "", "client_secret": "" }' https://xray.cloud.getxray.app/api/v2/authenticate | tr -d '"')
1618

17-
curl --request POST \
18-
-u $JIRA_USERNAME:$JIRA_PASSWORD \
19-
--header 'Content-Type: application/json' \
20-
--data-binary '@cypress/reports/cucumber-report.json' \
21-
"https://jira.catena-x.net/rest/raven/1.0/import/execution/cucumber"
19+
# Use the token to upload the JSON file
20+
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"

0 commit comments

Comments
 (0)