diff --git a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts index 1a1a9626b2..0fa64a3f0b 100644 --- a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts @@ -94,7 +94,7 @@ describe('dataset pages', () => { describe('GENERAL : display & functions', () => { describe('no-link-error block', () => { - it("shouldn't be there until metadata is fully loaded", () => { + it("shouldn't be there if there are links", () => { cy.visit('/dataset/a3774ef6-809d-4dd1-984f-9254f49cbd0a') cy.get('[data-test=dataset-has-no-link-block]').should('not.exist') }) @@ -597,24 +597,15 @@ describe('dataset pages', () => { }) describe('When there is no link', () => { - it('display the error datasetHasNoLink error block', () => { - cy.login() - - cy.intercept( - 'GET', - '/geonetwork/srv/api/userfeedback?metadataUuid=a3774ef6-809d-4dd1-984f-9254f49cbd0a', - (req) => { - // Test if the error block is not shown before the metadata is fully loaded - cy.get('[data-test="dataset-has-no-link-block"]').should( - 'not.exist' - ) - } - ).as('getData') - + beforeEach(() => { cy.visit('/dataset/a3774ef6-809d-4dd1-984f-9254f49cbd0a') - - cy.wait('@getData') - + }) + it('do not display the no-link-error warning initially, only after loading', () => { + // wait for metadata info to show up + cy.get('gn-ui-metadata-info').should('exist') + // first, the block is not visible + cy.get('[data-test="dataset-has-no-link-block"]').should('not.exist') + // then the block shows up cy.get('[data-test="dataset-has-no-link-block"]').should('exist') }) }) diff --git a/apps/datahub-e2e/src/e2e/datasets.cy.ts b/apps/datahub-e2e/src/e2e/datasets.cy.ts index ae4fcd8811..f2f7518c9d 100644 --- a/apps/datahub-e2e/src/e2e/datasets.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasets.cy.ts @@ -6,7 +6,7 @@ describe('datasets', () => { // aliases cy.get('gn-ui-results-list-item').find('a').as('results') - cy.get('@results').first().as('firstResult') + cy.get('@results').eq(1).as('sampleResult') cy.get('@results') .then(($results) => $results.length) .as('resultsCount') @@ -54,12 +54,12 @@ describe('datasets', () => { describe('display of dataset previews', () => { it('should display a logo for first and a placeholder for second result', () => { cy.get('@sortBy').selectDropdownOption('desc,createDate') // this makes the order reliable - cy.get('@firstResult') + cy.get('@sampleResult') .find('gn-ui-thumbnail') .children('div') .invoke('attr', 'data-cy-is-placeholder') .should('equal', 'false') - cy.get('@firstResult') + cy.get('@sampleResult') .find('gn-ui-thumbnail') .find('img') .invoke('attr', 'src') @@ -68,45 +68,45 @@ describe('datasets', () => { 'https://geocat-dev.dev.bgdi.ch/geonetwork/srv/api/records/9e1ea778-d0ce-4b49-90b7-37bc0e448300/attachments/test.png' ) cy.get('@results') - .eq(1) + .first() .find('gn-ui-thumbnail') .children('div') .invoke('attr', 'data-cy-is-placeholder') .should('equal', 'true') }) it('should display the title', () => { - cy.get('@firstResult') + cy.get('@sampleResult') .find('[data-cy="recordTitle"]') .should('be.visible') }) it('should display the summary', () => { - cy.get('@firstResult') + cy.get('@sampleResult') .find('[data-cy="recordAbstract"]') .should('be.visible') }) it('should display the organization', () => { - cy.get('@firstResult').find('[data-cy="recordOrg"]').should('be.visible') + cy.get('@sampleResult').find('[data-cy="recordOrg"]').should('be.visible') }) it('should display the star and like count', () => { - cy.get('@firstResult').find('[data-cy="recordFav"]').should('be.visible') + cy.get('@sampleResult').find('[data-cy="recordFav"]').should('be.visible') }) }) describe('interactions with dataset', () => { beforeEach(() => { - cy.get('@firstResult') + cy.get('@sampleResult') .find('gn-ui-favorite-star') .eq(0) .as('favoriteStar') }) it('should open the dataset page in the same application on click', () => { - cy.get('@firstResult').click() + cy.get('@sampleResult').click() cy.url().should('match', /^http:\/\/localhost:[0-9]+\/dataset\/.+/) }) describe('not logged in', () => { it('should show a popover with login link when hovering the favorite star', () => { cy.get('@favoriteStar').trigger('mouseenter') - cy.get('[id="tippy-1"]') + cy.get('[id="tippy-2"]') .find('a') .invoke('attr', 'href') .should('include', 'catalog.signin') @@ -437,8 +437,6 @@ describe('datasets', () => { describe('multiple filters', () => { beforeEach(() => { - cy.get('datahub-search-filters').scrollIntoView() - // filter by org cy.get('@filters').eq(0).click() getFilterOptions() @@ -559,7 +557,7 @@ describe('datasets', () => { it('should display quality widget', () => { cy.get('@sortBy').selectDropdownOption('desc,createDate') cy.get('gn-ui-progress-bar') - .eq(0) + .eq(1) .should('have.attr', 'ng-reflect-value', 87) }) diff --git a/support-services/docker-entrypoint-initdb.d/dump b/support-services/docker-entrypoint-initdb.d/dump index 55bf76ca5e..a8db47c271 100644 Binary files a/support-services/docker-entrypoint-initdb.d/dump and b/support-services/docker-entrypoint-initdb.d/dump differ diff --git a/support-services/docker-entrypoint.d/04-upload-thesauri.sh b/support-services/docker-entrypoint.d/04-upload-thesauri.sh index ae898293be..a288bbb530 100755 --- a/support-services/docker-entrypoint.d/04-upload-thesauri.sh +++ b/support-services/docker-entrypoint.d/04-upload-thesauri.sh @@ -18,3 +18,12 @@ do echo "" done +curl "http://$host/geonetwork/srv/fre/thesaurus?_content_type=json" \ + -H 'Accept: application/json, text/plain, */*' \ + -H 'Content-Type: multipart/form-data' \ + -H 'Accept: application/json, text/plain, */*' \ + -H "Cookie: JSESSIONID=$jsessionid; XSRF-TOKEN=$xsrf_token" \ + -H "X-XSRF-TOKEN: $xsrf_token" + +echo "" +echo "Thesauri uploaded to GeoNetwork."