Skip to content
Open
5 changes: 2 additions & 3 deletions .github/workflows/system-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
types: [opened, reopened, synchronize]
branches:
- main
- slu/e2eExternal

jobs:
trigger-system-tests:
Expand Down Expand Up @@ -89,7 +88,7 @@ jobs:
echo " PR URL: ${{ github.event.pull_request.html_url }}"
echo ""

# Trigger E2E tests in DOME-testing repository
# Trigger E2E tests in E2E-DOME-BAE repository
echo "Triggering E2E tests..."
curl -X POST \
-H "Authorization: token ${{ secrets.ADMIN }}" \
Expand All @@ -108,6 +107,6 @@ jobs:
\"pull_request_url\": \"${{ github.event.pull_request.html_url }}\"
}
}" \
https://api.github.com/repos/sluFicodes/DOME-testing/dispatches
https://api.github.com/repos/sluFicodes/E2E-DOME-BAE/dispatches

echo "E2E tests triggered successfully!"
4 changes: 2 additions & 2 deletions cypress/e2e/catalog.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('/my-offerings',{

cy.visit('/my-offerings')
cy.wait('@catalog')
cy.get('@catalog.all').should('have.length', 2)
cy.get('@catalog.all').should('have.length', 4)
cy.getBySel('newCatalog').click()
cy.getBySel('catalogName').type(name)
cy.getBySel('catalogDsc').type(description)
Expand Down Expand Up @@ -72,7 +72,7 @@ describe('/my-offerings',{

cy.visit('/my-offerings')
cy.wait('@catalog')
cy.get('@catalog.all').should('have.length', 2)
cy.get('@catalog.all').should('have.length', 4)
cy.getBySel('newCatalog').click()
cy.getBySel('catalogName').type(name)
cy.getBySel('catalogDsc').type(description)
Expand Down
26 changes: 24 additions & 2 deletions cypress/support/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export const init_config = {
'domeRegister': 'https://dome-marketplace.github.io/onboarding/',
'domePublish': 'https://knowledgebase.dome-marketplace.org/shelves/company-onboarding-process',
'purchaseEnabled': false,
'defaultId': 'urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6'
'defaultId': 'urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6',
"theme": "DOME"

}

Expand Down Expand Up @@ -109,6 +110,21 @@ export const login_token = () => {
}
}

export const default_catalog = {
"id": "urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6",
"href": "urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6",
"lifecycleStatus": "Launched",
"name": "default",
"version": "1.0",
"category": [
{
"id": "urn:ngsi-ld:category:26435cca-2707-4c89-8f0c-79464573c9e2",
"href": "urn:ngsi-ld:category:26435cca-2707-4c89-8f0c-79464573c9e2",
"name": "dft cat"
}
]
}

export const catalog_launched = [
{
"id": "urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6",
Expand Down Expand Up @@ -194,7 +210,9 @@ export const local_items = {
cy.intercept( {method:'GET', url: 'http://proxy.docker:8004/stats'}, init_stat).as('stats')
//cy.intercept( {method: 'GET', url: 'http://proxy.docker:8004/catalog/productOffering?*'}, product_offering).as('productOffering')
cy.intercept( {method: 'GET', url: 'http://proxy.docker:8004/config'}, init_config).as('config')
cy.intercept( {method:'GET', url: 'http://proxy.docker:8004/catalog/category?*'}, category_launched).as('category')
//cy.intercept('GET', '**/catalog/category/urn:ngsi-ld:category:*', category_dft).as('category');
cy.intercept({method: 'GET', url: 'catalog/catalog/?*'}, default_catalog).as('catalog')
cy.intercept( {method: 'GET', url: 'http://proxy.docker:8004/catalog/category/?*'}, category_dft).as('category')
// Verify mocks are called 1 time
cy.visit('/', {onBeforeLoad(win) {
win.localStorage.setItem('color-theme', 'dark');
Expand All @@ -205,6 +223,8 @@ export const local_items = {
cy.get('@config.all').should('have.length', 1)
//cy.wait('@productOffering')
//cy.get('@productOffering.all').should('have.length', 1)
cy.wait('@catalog')
cy.get('@catalog.all').should('have.length', 1)
cy.wait('@category')
cy.get('@category.all').should('have.length', 1)
// Verify header interactive elemements are displayed and work as expected
Expand Down Expand Up @@ -277,6 +297,8 @@ export const loginAcc = () => {
cy.get('@config.all').should('have.length', 2)
//cy.wait('@productOffering')
//cy.get('@productOffering.all').should('have.length', 2)
cy.wait('@catalog')
cy.get('@catalog.all').should('have.length', 2)
cy.wait('@category')
cy.get('@category.all').should('have.length', 2)
cy.wait('@login_token')
Expand Down
6 changes: 4 additions & 2 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ const routes: Routes = [
component: BlogEntryDetailComponent
},
{ path: 'blog-entry',
component: EntryFormComponent
component: EntryFormComponent,
canActivate: [AuthGuard], data: { roles: ['admin'] }
},
{ path: 'blog-entry/:id',
component: EntryFormComponent
component: EntryFormComponent,
canActivate: [AuthGuard], data: { roles: ['admin'] }
},
{ path: '**', redirectTo: 'dashboard', pathMatch: 'full' },
]
Expand Down
8 changes: 0 additions & 8 deletions src/app/app.component.css
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@


.bae-content {
width: 100%;
min-height: calc(100vh - 100px) !important;
padding-top: 75px !important;
padding-bottom: 25px !important;
}
8 changes: 5 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<bae-header class="fixed w-full z-50 top-0 start-0"></bae-header>
<main class="bg-fixed bg-no-repeat bg-right pb-[25px] pt-[75px]">
<main class="bg-no-repeat bg-right pb-[60px] pt-[75px]">
<router-outlet></router-outlet>
</main>
@if(providerThemeName=='DOME') {
<app-chatbot-widget class="relative"></app-chatbot-widget>
<app-chatbot-widget class="relative z-50"></app-chatbot-widget>
}
<bae-footer class="hidden md:block"></bae-footer>

<bae-footer class="fixed w-full z-50 bottom-0 start-0"></bae-footer>

@if(isProduction){
<script type="text/javascript"> _linkedin_partner_id = "8700705"; window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; window._linkedin_data_partner_ids.push(_linkedin_partner_id); </script><script type="text/javascript"> (function(l) { if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])}; window.lintrk.q=[]} var s = document.getElementsByTagName("script")[0]; var b = document.createElement("script"); b.type = "text/javascript";b.async = true; b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js"; s.parentNode.insertBefore(b, s);})(window.lintrk); </script> <noscript> <img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=8700705&fmt=gif" /> </noscript>
}
3 changes: 2 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class AppComponent implements OnInit {
console.log(((info.expire - moment().unix()) - 4))

this.refreshApi.startInterval(((info.expire - moment().unix())-4)*1000, ev);

initFlowbite();
//this.refreshApi.startInterval(3000, ev.value);
}
})
Expand All @@ -92,6 +92,7 @@ export class AppComponent implements OnInit {
this.refreshApi.startInterval(((aux.expire - moment().unix())-4)*1000, aux);
console.log('token')
console.log(aux.token)
initFlowbite();
}
this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/chatbot-widget/chatbot-widget.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h4 class="chatbox__heading--header">DOME support</h4>
}

<!-- Wrapper -->
<div class="fixed bottom-5 md:bottom-[55px] right-5 z-[999]" (click)="toggleState()">
<div class="fixed bottom-9 md:bottom-[55px] right-5 z-[999]" (click)="toggleState()">
<!-- Button -->
<button
class="w-[60px] h-[60px] bg-[var(--secondary-dark-blue)] border-none rounded-full shadow-[0_2px_10px_rgba(0,0,0,0.3)] cursor-pointer transition-transform duration-300 flex items-center justify-center hover:scale-105 p-0"
Expand Down
3 changes: 3 additions & 0 deletions src/app/guard/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export class AuthGuard implements CanActivate {
for(let i=0;i<loggedOrg.roles.length;i++){
userRoles.push(loggedOrg.roles[i].name)
}
if(aux.roles.some(role => role.name === 'admin')){
userRoles.push('admin')
}
}
} else {
this.router.navigate(['/dashboard']);
Expand Down
2 changes: 1 addition & 1 deletion src/app/offerings/featured/featured.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h5 class="text-xl font-semibold line-clamp-2 tracking-tight text-primary-100 da

<div class="flex sticky top-[100vh] items-center justify-center align-items-bottom rounded-lg mt-4">

<button type="button" (click)="searchByCategory(cat)" class="flex items-center align-items-bottom text-white 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 dark:bg-primary-100 dark:hover:bg-primary-50 dark:focus:ring-primary-100 mr-1">
<button data-cy="viewService" type="button" (click)="searchByCategory(cat)" class="flex items-center align-items-bottom text-white 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 dark:bg-primary-100 dark:hover:bg-primary-50 dark:focus:ring-primary-100 mr-1">
<svg class="w-[18px] h-[18px] text-white mr-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 14">
<g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
<path d="M10 10a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/>
Expand Down
2 changes: 1 addition & 1 deletion src/app/offerings/featured/featured.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class FeaturedComponent implements OnInit {
}

ngOnInit(): void {
this.api.getLaunchedCategories().then(data => {
this.api.getDefaultCategories().then(data => {
for(let i=0; i < data.length; i++){
if(data[i].isRoot==true){
this.categories.push(data[i])
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/catalogs/catalogs.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h5 class="text-2xl font-bold tracking-tight line-clamp-4 text-primary-100 dark:
@if (!loading_more) {
@if (page_check) {
<div class="flex pt-8 justify-center align-middle">
<button (click)="next()" class="flex cursor-pointer items-center justify-center px-3 h-8 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">
<button data-cy="loadMore" (click)="next()" class="flex cursor-pointer items-center justify-center px-3 h-8 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white">
Load more
<svg class="w-3.5 h-3.5 ms-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14m-7 7V5"/>
Expand Down
14 changes: 12 additions & 2 deletions src/app/pages/checkout/checkout.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h1 class="mb-4 pb-2 mt-4 text-4xl font-extrabold leading-none tracking-tight te
</div>
<div class="block">
<div>
<textarea id="large-input" name="orderNote"
<textarea id="large-input" name="orderNote" [(ngModel)]="orderNote"
class="flex w-full min-h-fit dark:text-white dark:bg-secondary-300 dark:border-secondary-200 dark:focus:border-primary-100 items-center rounded px-4 py-3 text-sm text-heading transition duration-300 ease-in-out focus:outline-0 focus:ring-0 border border-border-base focus:border-accent"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
rows="4">
Expand Down Expand Up @@ -185,7 +185,17 @@ <h1 class="mb-4 pb-2 mt-4 text-4xl font-extrabold leading-none tracking-tight te
class="text-sm text-body dark:text-gray-200">{{ 'SHOPPING_CART._calculated' | translate }}</span></div>
</div>
-->

@if(!validBillAddr){
<div class="flex items-center p-4 text-sm text-primary-50" role="alert">
<svg class="flex-shrink-0 inline w-4 h-4 me-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
</svg>
<span class="sr-only">Info</span>
<p class="text-center">
You need to create at least one valid billing address.
</p>
</div>
}
<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 }}
Expand Down
Loading