Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/system-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Trigger E2E Testing Workflow

on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- main
- slu/e2eExternal

jobs:
trigger-system-tests:
runs-on: ubuntu-latest
steps:
- name: Check if system testing is activated
id: check_activation
run: |
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"
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 '${{ github.event.pull_request.body }}' | grep '^PROXY:' | sed 's/PROXY: *//' | xargs)
echo "Proxy location: $PROXY_LOCATION"

# Parse CHARGING dependency
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 '${{ 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)
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 "$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
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 "$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
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!"
2 changes: 1 addition & 1 deletion src/app/offerings/gallery/gallery.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h2 class="text-4xl mt-4 font-extrabold text-primary-100 text-center dark:text-primary-50">{{ 'GALLERY._title' | translate }}</h2>
<div id="featuredOfferings" class="pt-8 pb-2 px-4 mx-auto max-w-screen-xl w-full grid gap-2 grid-cols-1 place-items-center sm:grid-cols-2 xl:grid-cols-4">
@for (prod of products; track prod.id; let index = $index) {
<bae-off-card id="featuredOfferCard" [productOff]=prod [cardId]="index" class="w-full h-full"></bae-off-card>
<bae-off-card data-cy="baeCard" id="featuredOfferCard" [productOff]=prod [cardId]="index" class="w-full h-full"></bae-off-card>
} @empty {
}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/checkout/checkout.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h1 class="mb-4 pb-2 mt-4 text-4xl font-extrabold leading-none tracking-tight te
</span>
</div>
<span class="text-sm text-body"> {{ getPrice(item).text }} {{ formatter.format(getPrice(item).price) }}</span></div> -->
<div class="flex justify-between w-full mt-2 mb-2 rounded-lg bg-white border-secondary-50 dark:bg-primary-100 dark:border-secondary-200 border shadow-lg">
<div data-cy="checkoutOffering" class="flex justify-between w-full mt-2 mb-2 rounded-lg bg-white border-secondary-50 dark:bg-primary-100 dark:border-secondary-200 border shadow-lg">
<div class="flex flex-col w-full">
<div class="flex justify-between w-full">
<button type="button" (click)="goToProdDetails(item)" class="flex p-2 box-decoration-clone">
Expand Down Expand Up @@ -186,7 +186,7 @@ <h1 class="mb-4 pb-2 mt-4 text-4xl font-extrabold leading-none tracking-tight te
</div>
-->

<button class="inline-flex items-center justify-center shrink-0 font-semibold leading-none rounded outline-none transition duration-300 ease-in-out focus:outline-0 focus:shadow focus:ring-1 focus:ring-accent-700 bg-primary-50 dark:bg-primary-100 text-white border border-transparent hover:bg-secondary-100 dark:hover:bg-primary-50 px-5 py-0 h-12 mt-5 w-full"
<button data-cy="checkout" class="inline-flex items-center justify-center shrink-0 font-semibold leading-none rounded outline-none transition duration-300 ease-in-out focus:outline-0 focus:shadow focus:ring-1 focus:ring-accent-700 bg-primary-50 dark:bg-primary-100 text-white border border-transparent hover:bg-secondary-100 dark:hover:bg-primary-50 px-5 py-0 h-12 mt-5 w-full"
(click)="orderProduct()" [disabled]="items.length==0 || !this.validBillAddr" [ngClass]="(items.length==0 || !this.validBillAddr)? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'">
{{ 'SHOPPING_CART._checkout' | translate }}
</button>
Expand Down
5 changes: 4 additions & 1 deletion src/app/pages/checkout/checkout.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export class DashboardComponent implements OnInit, OnDestroy {
});

this.statsService.getStats().then(data=> {
this.services=data?.services;
this.publishers=data?.organizations;
this.services=data?.services || [];
this.publishers=data?.organizations || [];
this.startTagTransition();
})
this.isFilterPanelShown = JSON.parse(this.localStorage.getItem('is_filter_panel_shown') as string);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ <h3 class="text-2xl font-bold mb-4 dark:text-white">{{rel.name}}</h3>
<!-- Drawer Reutilizable -->

<app-price-plan-drawer
data-cy="pricePlanDrawer"
[drawerId]="'drawer-product'"
[productOff]="productOff"
[prodSpec]="prodSpec"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h6 class="mb-3 text-sm font-bold text-gray-900 dark:text-white">
<!-- <h2 class="md:text-3xl lg:text-4xl font-bold text-primary-100 ml-4 dark:text-white m-4">{{ 'PROFILE._order_list' | translate }}</h2>
<hr class="h-px mr-4 ml-4 bg-primary-100 dark:bg-white border-0">-->
<div class="m-4 relative overflow-x-auto border border-primary-100 dark:border-secondary-50 sm:rounded-lg">
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-200">
<table data-cy="ordersTable" class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-200">
<thead class="text-xs text-gray-700 uppercase bg-secondary-50 dark:bg-primary-50 dark:text-secondary-100">
<tr>
<th scope="col" class="hidden md:table-cell px-6 py-3 text-center align-middle">
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/search-catalog/search-catalog.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h5 class="text-2xl font-bold tracking-tight line-clamp-4 text-primary-100 dark:
</div>
<div class="md:pl-5 grid grid-cols-1 place-items-center lg:grid-cols-2 xl:grid-cols-3">
@for (prod of products; track prod.id; let index = $index) {
<bae-off-card [productOff]=prod [cardId]="index" class="w-full h-full p-2"></bae-off-card>
<bae-off-card data-cy="baeCard" [productOff]=prod [cardId]="index" class="w-full h-full p-2"></bae-off-card>
} @empty {
<div class="min-h-19 dark:text-gray-600 text-center">{{ 'DASHBOARD._not_found' | translate }}</div>
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/search/search.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
} @else {
<div class="md:pl-5 grid grid-cols-1 place-items-center lg:grid-cols-2 xl:grid-cols-3">
@for (prod of products; track prod.id; let index = $index) {
<bae-off-card [productOff]=prod [cardId]="index" class="w-full h-full p-2"></bae-off-card>
<bae-off-card data-cy="baeCard" [productOff]=prod [cardId]="index" class="w-full h-full p-2"></bae-off-card>
} @empty {
<div class="min-h-19 dark:text-gray-600 text-center">{{ 'DASHBOARD._not_found' | translate }}</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ <h2 class="text-base font-bold">{{ 'OFFERINGS._order_by' | translate }}</h2>
</th>
</tr>
</thead>
<tbody>
<tbody data-cy="catalogTable">
@for (cat of catalogs; track cat.id) {
<tr class="border-b hover:bg-gray-200 dark:bg-secondary-300 dark:border-gray-700 dark:hover:bg-secondary-200">
<tr data-cy="catalogRow" class="border-b hover:bg-gray-200 dark:bg-secondary-300 dark:border-gray-700 dark:hover:bg-secondary-200">
<td class="px-6 py-4 text-wrap break-all">
{{cat.name}}
</td>
Expand All @@ -169,7 +169,7 @@ <h2 class="text-base font-bold">{{ 'OFFERINGS._order_by' | translate }}</h2>
{{cat.relatedParty?.at(0)?.role}}
</td>
<td class="px-6 py-4">
<button type="button" (click)="goToUpdate(cat)" class="text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center me-2">
<button data-cy="catalogEdit" type="button" (click)="goToUpdate(cat)" class="text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center me-2">
<svg class="w-[18px] h-[18px] text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
<path fill-rule="evenodd" d="M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z" clip-rule="evenodd"/>
</svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ <h2 class="text-3xl font-bold text-primary-100 dark:text-white ml-4">{{ 'UPDATE_
</span>
</li>
}@else{
<li (click)="setCatStatus('Launched')"
<li data-cy="catalogStatusLaunched" (click)="setCatStatus('Launched')"
class="cursor-pointer flex w-fit md:w-full items-center after:w-full after:h-1 after:border-b after:border-gray-700 dark:after:border-gray-400 after:border-1 after:mx-2 md:after:mx-6 xl:after:mx-10">
<span class="flex items-center">
<span class="flex items-center">
{{ 'UPDATE_CATALOG._launched' | translate }}
</span>
</li>
Expand Down Expand Up @@ -145,7 +145,7 @@ <h2 class="text-3xl font-bold text-primary-100 dark:text-white ml-4">{{ 'UPDATE_

</form>
<div class="flex w-full justify-items-end justify-end">
<button type="button" (click)="showFinish();generalDone=true;" [disabled]="!generalForm.valid" [ngClass]="!generalForm.valid ? 'opacity-50' : 'hover:bg-primary-50'" class="flex text-white justify-end bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
<button data-cy="catalogNext" type="button" (click)="showFinish();generalDone=true;" [disabled]="!generalForm.valid" [ngClass]="!generalForm.valid ? 'opacity-50' : 'hover:bg-primary-50'" class="flex text-white justify-end bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
{{ 'UPDATE_CATALOG._next' | translate }}
<svg class="rtl:rotate-180 w-3.5 h-3.5 ms-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>
Expand Down Expand Up @@ -195,7 +195,7 @@ <h2 class="text-3xl font-bold text-primary-100 dark:text-white ml-4">{{ 'UPDATE_

}
<div class="flex w-full justify-items-end justify-end ml-4">
<button type="button" [disabled]="loading" (click)="createCatalog();"
<button data-cy="catalogUpdate" type="button" [disabled]="loading" (click)="createCatalog();"
class="flex text-white justify-end bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center disabled:opacity-50 disabled:cursor-not-allowed">
{{ 'UPDATE_CATALOG._update' | translate }}
<svg class="rtl:rotate-180 w-3.5 h-3.5 ms-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ <h2 class="text-base font-bold">{{ 'OFFERINGS._order_by' | translate }}</h2>
</thead>
<tbody data-cy="offers">
@for (offer of offers; track offer.id) {
<tr class="border-b hover:bg-gray-200 dark:bg-secondary-300 dark:border-gray-700 dark:hover:bg-secondary-200">
<tr data-cy="offerRow" class="border-b hover:bg-gray-200 dark:bg-secondary-300 dark:border-gray-700 dark:hover:bg-secondary-200">
<td class="px-6 py-4 text-wrap break-all">
{{offer.name}}
</td>
Expand Down
Loading
Loading