diff --git a/apps/datahub-e2e/src/e2e/dataset.cy.ts b/apps/datahub-e2e/src/e2e/dataset.cy.ts index c9a18e6a..ebba49a6 100644 --- a/apps/datahub-e2e/src/e2e/dataset.cy.ts +++ b/apps/datahub-e2e/src/e2e/dataset.cy.ts @@ -211,13 +211,12 @@ describe('datasets', () => { .find('mel-datahub-api-card') .last() .click() - cy.get('mel-datahub-api-form') - .find('a') - .invoke('attr', 'href') - .should( - 'eq', - 'https://mel.integration.apps.gs-fr-prod.camptocamp.com/data/swagger-ui/index.html' - ) + cy.window().then((win) => { + cy.get('mel-datahub-api-form') + .find('a') + .invoke('attr', 'href') + .should('eq', `${win.location.origin}/data/swagger-ui/index.html`) + }) }) it('should open the api form', () => { cy.get('mel-datahub-dataset-apis') diff --git a/apps/datahub/src/app/dataset/dataset-apis/api-form/api-form.component.html b/apps/datahub/src/app/dataset/dataset-apis/api-form/api-form.component.html index 5f1e8c44..17095025 100644 --- a/apps/datahub/src/app/dataset/dataset-apis/api-form/api-form.component.html +++ b/apps/datahub/src/app/dataset/dataset-apis/api-form/api-form.component.html @@ -75,7 +75,7 @@ mel.dataset.api.access mel.dataset.api.swagger diff --git a/apps/datahub/src/app/dataset/dataset-apis/api-form/api-form.component.ts b/apps/datahub/src/app/dataset/dataset-apis/api-form/api-form.component.ts index cdc8db0a..c369bf46 100644 --- a/apps/datahub/src/app/dataset/dataset-apis/api-form/api-form.component.ts +++ b/apps/datahub/src/app/dataset/dataset-apis/api-form/api-form.component.ts @@ -7,4 +7,8 @@ import { RecordApiFormComponent } from 'geonetwork-ui' styles: ``, changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ApiFormComponent extends RecordApiFormComponent {} +export class ApiFormComponent extends RecordApiFormComponent { + get swaggerUrl() { + return `${window.location.origin}/data/swagger-ui/index.html` + } +}