From 26c81894ccc56f48f3317ebdbe5964b527022ca9 Mon Sep 17 00:00:00 2001 From: SHENGXING LU Date: Fri, 10 Oct 2025 20:13:48 +0200 Subject: [PATCH 1/9] e2e workflow starting point --- .github/workflows/system-testing.yml | 110 +++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .github/workflows/system-testing.yml diff --git a/.github/workflows/system-testing.yml b/.github/workflows/system-testing.yml new file mode 100644 index 00000000..4ba5da64 --- /dev/null +++ b/.github/workflows/system-testing.yml @@ -0,0 +1,110 @@ +name: Trigger E2E Testing Workflow + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: + - main + +jobs: + trigger-system-tests: + runs-on: ubuntu-latest + steps: + - name: Check if system testing is activated + id: check_activation + run: | + ACTIVATE=$(echo -e '${{ github.event.pull_request.body }}' | grep '^SYSTEM_TESTING:' | sed 's/SYSTEM_TESTING: *//') + echo "System testing activation: $ACTIVATE" + if [[ "$ACTIVATE" == "ACTIVATE" ]]; then + echo "activated=true" >> $GITHUB_OUTPUT + echo "System testing is ACTIVATED" + else + echo "activated=false" >> $GITHUB_OUTPUT + echo "System testing NOT activated (add 'SYSTEM_TESTING: ACTIVATE' to PR body to enable)" + fi + + - name: Trigger Repository Dispatch + if: steps.check_activation.outputs.activated == 'true' + run: | + echo "Parsing PR body for dependencies..." + + # Parse PROXY dependency + PROXY_LOCATION=$(echo -e '${{ github.event.pull_request.body }}' | grep '^PROXY:' | sed 's/PROXY: *//') + echo "Proxy location: $PROXY_LOCATION" + + # Parse CHARGING dependency + CHARGING_LOCATION=$(echo -e '${{ github.event.pull_request.body }}' | grep '^CHARGING:' | sed 's/CHARGING: *//') + echo "Charging location: $CHARGING_LOCATION" + + # Parse TM_VERSION + TM_VERSION=$(echo -e '${{ github.event.pull_request.body }}' | grep '^TM_VERSION:' | sed 's/TM_VERSION: *//') + echo "TMForum API version: $TM_VERSION" + + # Default values (using upstream FIWARE-TMForum repos) + PROXY_REPO="FIWARE-TMForum/business-ecosystem-logic-proxy" + PROXY_BRANCH="master" + CHARGING_REPO="FIWARE-TMForum/business-ecosystem-charging-backend" + CHARGING_BRANCH="master" + TM_VERSION="${TM_VERSION:-1.3.18}" + + # Process PROXY location if specified + if [[ -n "$PROXY_LOCATION" ]]; then + echo "Validating proxy repository..." + STATUS=$(curl -o /dev/null -s -w "%{http_code}" "$PROXY_LOCATION") + if [[ "$STATUS" -eq 200 ]]; then + echo "Proxy repository found" + PROXY_REPO=$(echo -e "$PROXY_LOCATION" | awk -F "/" '{print $4 "/" $5}') + PROXY_BRANCH=$(echo -e "$PROXY_LOCATION" | awk -F "/tree/" '{print $2}') + PROXY_BRANCH="${PROXY_BRANCH:-master}" + else + echo "Proxy repository not found: $PROXY_LOCATION (HTTP $STATUS)" + exit 1 + fi + fi + + # Process CHARGING location if specified + if [[ -n "$CHARGING_LOCATION" ]]; then + echo "Validating charging repository..." + STATUS=$(curl -o /dev/null -s -w "%{http_code}" "$CHARGING_LOCATION") + if [[ "$STATUS" -eq 200 ]]; then + echo "Charging repository found" + CHARGING_REPO=$(echo -e "$CHARGING_LOCATION" | awk -F "/" '{print $4 "/" $5}') + CHARGING_BRANCH=$(echo -e "$CHARGING_LOCATION" | awk -F "/tree/" '{print $2}') + CHARGING_BRANCH="${CHARGING_BRANCH:-master}" + else + echo "Charging repository not found: $CHARGING_LOCATION (HTTP $STATUS)" + exit 1 + fi + fi + + echo "" + echo "E2E Test Configuration:" + echo " Proxy: $PROXY_REPO @ $PROXY_BRANCH" + echo " Charging: $CHARGING_REPO @ $CHARGING_BRANCH" + echo " Frontend: ${{ github.repository }} @ ${{ github.event.pull_request.head.ref }}" + echo " TM Version: $TM_VERSION" + echo " PR URL: ${{ github.event.pull_request.html_url }}" + echo "" + + # Trigger E2E tests in DOME-testing repository + echo "Triggering E2E tests..." + curl -X POST \ + -H "Authorization: token ${{ secrets.ADMIN }}" \ + -H "Accept: application/vnd.github.everest-preview+json" \ + -H "Content-Type: application/json" \ + -d "{ + \"event_type\": \"cross-repo-test\", + \"client_payload\": { + \"repository_A\": \"$PROXY_REPO\", + \"branch_A\": \"$PROXY_BRANCH\", + \"repository_B\": \"$CHARGING_REPO\", + \"branch_B\": \"$CHARGING_BRANCH\", + \"repository_frontend\": \"${{ github.repository }}\", + \"branch_frontend\": \"${{ github.event.pull_request.head.ref }}\", + \"tm_version\": \"$TM_VERSION\", + \"pull_request_url\": \"${{ github.event.pull_request.html_url }}\" + } + }" \ + https://api.github.com/repos/sluFicodes/DOME-testing/dispatches + + echo "E2E tests triggered successfully!" From f0f7a0497614d008b2b4acd623e9139c32e8b5ef Mon Sep 17 00:00:00 2001 From: SHENGXING LU Date: Fri, 10 Oct 2025 20:20:33 +0200 Subject: [PATCH 2/9] e2e testing --- .github/workflows/system-testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/system-testing.yml b/.github/workflows/system-testing.yml index 4ba5da64..c9da7fc6 100644 --- a/.github/workflows/system-testing.yml +++ b/.github/workflows/system-testing.yml @@ -5,6 +5,7 @@ on: types: [opened, reopened, synchronize] branches: - main + - slu/e2eExternal jobs: trigger-system-tests: From 25f5593c47b46827b1b216a54857be9507e39dba Mon Sep 17 00:00:00 2001 From: SHENGXING LU Date: Fri, 10 Oct 2025 20:25:57 +0200 Subject: [PATCH 3/9] bug fixed --- .github/workflows/system-testing.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/system-testing.yml b/.github/workflows/system-testing.yml index c9da7fc6..b707d228 100644 --- a/.github/workflows/system-testing.yml +++ b/.github/workflows/system-testing.yml @@ -14,8 +14,8 @@ jobs: - name: Check if system testing is activated id: check_activation run: | - ACTIVATE=$(echo -e '${{ github.event.pull_request.body }}' | grep '^SYSTEM_TESTING:' | sed 's/SYSTEM_TESTING: *//') - echo "System testing activation: $ACTIVATE" + ACTIVATE=$(echo '${{ github.event.pull_request.body }}' | grep '^SYSTEM_TESTING:' | sed 's/SYSTEM_TESTING: *//' | tr -d '[:space:]') + echo "System testing activation: '$ACTIVATE'" if [[ "$ACTIVATE" == "ACTIVATE" ]]; then echo "activated=true" >> $GITHUB_OUTPUT echo "System testing is ACTIVATED" @@ -30,15 +30,15 @@ jobs: echo "Parsing PR body for dependencies..." # Parse PROXY dependency - PROXY_LOCATION=$(echo -e '${{ github.event.pull_request.body }}' | grep '^PROXY:' | sed 's/PROXY: *//') + PROXY_LOCATION=$(echo '${{ github.event.pull_request.body }}' | grep '^PROXY:' | sed 's/PROXY: *//' | xargs) echo "Proxy location: $PROXY_LOCATION" # Parse CHARGING dependency - CHARGING_LOCATION=$(echo -e '${{ github.event.pull_request.body }}' | grep '^CHARGING:' | sed 's/CHARGING: *//') + CHARGING_LOCATION=$(echo '${{ github.event.pull_request.body }}' | grep '^CHARGING:' | sed 's/CHARGING: *//' | xargs) echo "Charging location: $CHARGING_LOCATION" # Parse TM_VERSION - TM_VERSION=$(echo -e '${{ github.event.pull_request.body }}' | grep '^TM_VERSION:' | sed 's/TM_VERSION: *//') + TM_VERSION=$(echo '${{ github.event.pull_request.body }}' | grep '^TM_VERSION:' | sed 's/TM_VERSION: *//' | xargs) echo "TMForum API version: $TM_VERSION" # Default values (using upstream FIWARE-TMForum repos) From 626e0610b0f1e428d6a34d59bba5ea6aad8665ad Mon Sep 17 00:00:00 2001 From: SHENGXING LU Date: Fri, 10 Oct 2025 20:27:43 +0200 Subject: [PATCH 4/9] more bugs fixed --- .github/workflows/system-testing.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/system-testing.yml b/.github/workflows/system-testing.yml index b707d228..cc41ccac 100644 --- a/.github/workflows/system-testing.yml +++ b/.github/workflows/system-testing.yml @@ -54,9 +54,10 @@ jobs: STATUS=$(curl -o /dev/null -s -w "%{http_code}" "$PROXY_LOCATION") if [[ "$STATUS" -eq 200 ]]; then echo "Proxy repository found" - PROXY_REPO=$(echo -e "$PROXY_LOCATION" | awk -F "/" '{print $4 "/" $5}') - PROXY_BRANCH=$(echo -e "$PROXY_LOCATION" | awk -F "/tree/" '{print $2}') + PROXY_REPO=$(echo "$PROXY_LOCATION" | awk -F "/" '{print $4 "/" $5}') + PROXY_BRANCH=$(echo "$PROXY_LOCATION" | awk -F "/tree/" '{print $2}') PROXY_BRANCH="${PROXY_BRANCH:-master}" + echo "Extracted - Repo: $PROXY_REPO, Branch: $PROXY_BRANCH" else echo "Proxy repository not found: $PROXY_LOCATION (HTTP $STATUS)" exit 1 @@ -69,9 +70,10 @@ jobs: STATUS=$(curl -o /dev/null -s -w "%{http_code}" "$CHARGING_LOCATION") if [[ "$STATUS" -eq 200 ]]; then echo "Charging repository found" - CHARGING_REPO=$(echo -e "$CHARGING_LOCATION" | awk -F "/" '{print $4 "/" $5}') - CHARGING_BRANCH=$(echo -e "$CHARGING_LOCATION" | awk -F "/tree/" '{print $2}') + CHARGING_REPO=$(echo "$CHARGING_LOCATION" | awk -F "/" '{print $4 "/" $5}') + CHARGING_BRANCH=$(echo "$CHARGING_LOCATION" | awk -F "/tree/" '{print $2}') CHARGING_BRANCH="${CHARGING_BRANCH:-master}" + echo "Extracted - Repo: $CHARGING_REPO, Branch: $CHARGING_BRANCH" else echo "Charging repository not found: $CHARGING_LOCATION (HTTP $STATUS)" exit 1 From 552f0f42fe8cb39b9af38486cf56f785c38e61c7 Mon Sep 17 00:00:00 2001 From: SHENGXING LU Date: Tue, 28 Oct 2025 19:47:57 +0100 Subject: [PATCH 5/9] tags for e2e testings --- .../pages/dashboard/dashboard.component.ts | 8 +++-- .../seller-catalogs.component.html | 6 ++-- .../update-catalog.component.html | 8 ++--- .../seller-offer/seller-offer.component.html | 2 +- .../create-product-spec.component.html | 36 +++++++++---------- .../seller-product-spec.component.html | 8 ++--- .../update-product-spec.component.html | 30 ++++++++-------- .../seller-offerings.component.html | 6 ++-- .../status-selector.component.html | 2 +- src/app/shared/header/header.component.html | 4 +-- 10 files changed, 57 insertions(+), 53 deletions(-) diff --git a/src/app/pages/dashboard/dashboard.component.ts b/src/app/pages/dashboard/dashboard.component.ts index 8098facc..560a611e 100644 --- a/src/app/pages/dashboard/dashboard.component.ts +++ b/src/app/pages/dashboard/dashboard.component.ts @@ -69,8 +69,12 @@ export class DashboardComponent implements OnInit, OnDestroy { startTagTransition() { setInterval(() => { - this.currentIndexServ = (this.currentIndexServ + 1) % this.services.length; - this.currentIndexPub = (this.currentIndexPub + 1) % this.publishers.length; + if (this.services?.length > 0) { + this.currentIndexServ = (this.currentIndexServ + 1) % this.services.length; + } + if (this.publishers?.length > 0) { + this.currentIndexPub = (this.currentIndexPub + 1) % this.publishers.length; + } }, this.delay); } diff --git a/src/app/pages/seller-offerings/offerings/seller-catalogs/seller-catalogs.component.html b/src/app/pages/seller-offerings/offerings/seller-catalogs/seller-catalogs.component.html index 1cadf443..0023d951 100644 --- a/src/app/pages/seller-offerings/offerings/seller-catalogs/seller-catalogs.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-catalogs/seller-catalogs.component.html @@ -148,9 +148,9 @@

{{ 'OFFERINGS._order_by' | translate }}

- + @for (cat of catalogs; track cat.id) { - + {{cat.name}} @@ -169,7 +169,7 @@

{{ 'OFFERINGS._order_by' | translate }}

{{cat.relatedParty?.at(0)?.role}} - --> - - +
- + }
@@ -215,7 +215,7 @@ - @@ -426,7 +426,7 @@

{{ 'PROFILE._country' | translate }} -
From bcfb148b28b19f60115049290ea3f38bf8407ac1 Mon Sep 17 00:00:00 2001 From: SHENGXING LU Date: Fri, 31 Oct 2025 12:37:42 +0100 Subject: [PATCH 9/9] more cypress tags --- .../offerings/gallery/gallery.component.html | 2 +- src/app/pages/checkout/checkout.component.html | 4 ++-- src/app/pages/checkout/checkout.component.ts | 5 ++++- .../product-details.component.html | 1 + .../order-info/order-info.component.html | 2 +- .../search-catalog.component.html | 2 +- src/app/pages/search/search.component.html | 2 +- .../billing-account-form.component.html | 18 +++++++++--------- src/app/shared/card/card.component.html | 1 + .../cart-drawer/cart-drawer.component.html | 2 +- .../price-plans/price-plans.component.html | 1 + .../procurement-mode.component.html | 2 +- src/app/shared/header/header.component.html | 2 +- .../price-plan-drawer.component.html | 1 + 14 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/app/offerings/gallery/gallery.component.html b/src/app/offerings/gallery/gallery.component.html index 256cd214..c467de39 100644 --- a/src/app/offerings/gallery/gallery.component.html +++ b/src/app/offerings/gallery/gallery.component.html @@ -5,7 +5,7 @@

{{ 'GALLERY._title' | translate }}

@for (prod of products; track prod.id; let index = $index) { - + } @empty { }
diff --git a/src/app/pages/checkout/checkout.component.html b/src/app/pages/checkout/checkout.component.html index 0ab4d5ff..acc757c7 100644 --- a/src/app/pages/checkout/checkout.component.html +++ b/src/app/pages/checkout/checkout.component.html @@ -114,7 +114,7 @@

{{ getPrice(item).text }} {{ formatter.format(getPrice(item).price) }}

--> -
+
diff --git a/src/app/pages/checkout/checkout.component.ts b/src/app/pages/checkout/checkout.component.ts index e82ba74b..a373171f 100644 --- a/src/app/pages/checkout/checkout.component.ts +++ b/src/app/pages/checkout/checkout.component.ts @@ -204,15 +204,18 @@ export class CheckoutComponent implements OnInit { try { const response = await firstValueFrom(this.orderService.postProductOrder(productOrder)); - const redirectUrl = response.headers.get('X-redirect-url'); + const redirectUrl = response.headers.get('X-Redirect-URL'); + console.log(response.headers) console.log(redirectUrl); console.log('PROD ORDER DONE'); if (redirectUrl) { + console.log('redirectURL') // Going to the payment gateway window.location.href = redirectUrl; } else { + console.log('non-redirectURL') // we clear the shopping cart only if no redirection is applied await this.emptyShoppingCart(); this.goToInventory(); diff --git a/src/app/pages/product-details/product-details.component.html b/src/app/pages/product-details/product-details.component.html index a226620a..79267c05 100644 --- a/src/app/pages/product-details/product-details.component.html +++ b/src/app/pages/product-details/product-details.component.html @@ -575,6 +575,7 @@

{{rel.name}}

- +