diff --git a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts index bb64524af4..66e7778235 100644 --- a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts @@ -10,15 +10,6 @@ describe('dashboard', () => { .then((text) => { pageOne = text }) - cy.get('gn-ui-pagination-buttons').find('gn-ui-button').last().click() - cy.get('gn-ui-record-table') - .find('.record-table-col') - .first() - .invoke('text') - .then((text) => { - expect(text).not.to.equal(pageOne) - cy.url().should('include', 'page=2') - }) }) it('should display different results on click on specific page and change url', () => { cy.visit('/records/search?_page=2') @@ -46,6 +37,9 @@ describe('dashboard', () => { .then((list) => { originalFirstItem = list.trim() cy.get('.record-table-header').first().click() + // Takes time to refresh results + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait(500) cy.get('gn-ui-record-table') .find('.record-table-col') .first() diff --git a/apps/metadata-editor-e2e/src/e2e/my-org.cy.ts b/apps/metadata-editor-e2e/src/e2e/my-org.cy.ts index 2362dbcc74..620a5b5fff 100644 --- a/apps/metadata-editor-e2e/src/e2e/my-org.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/my-org.cy.ts @@ -1,9 +1,14 @@ describe('my-org', () => { beforeEach(() => { cy.loginGN('barbie', 'p4ssworD_', false) + cy.intercept({ + method: 'GET', + url: 'http://localhost:4200/geonetwork/srv/api/userselections/0/101', + }).as('dataGetFirst') cy.visit(`/records/my-org`) cy.get('md-editor-dashboard-menu').find('a').first().click() - cy.get('main').children('div').first().children('div').eq(1).as('linkGroup') + cy.wait('@dataGetFirst').its('response.statusCode').should('equal', 200) + cy.get('main').children('div').first().as('linkGroup') }) describe('my-org display', () => { it('should show my-org name and logo', () => { @@ -28,8 +33,12 @@ describe('my-org', () => { }) describe('routing', () => { it('should access the datahub with a filter', () => { - cy.get('@linkGroup').find('a').click() - cy.url().should('include', 'search/publisher=') + cy.get('@linkGroup') + .find('a') + .should('have.attr', 'href') + .then((href) => { + expect(href).to.include('search?publisher=Barbie+Inc') + }) }) it('should access the user list page and show my-org users', () => { cy.visit(`/records/my-org`) diff --git a/apps/metadata-editor-e2e/src/support/commands.ts b/apps/metadata-editor-e2e/src/support/commands.ts index dc92994920..85cc534619 100644 --- a/apps/metadata-editor-e2e/src/support/commands.ts +++ b/apps/metadata-editor-e2e/src/support/commands.ts @@ -27,18 +27,14 @@ declare namespace Cypress { Cypress.Commands.add( 'loginGN', (username: string, password: string, redirect = true) => { - cy.visit('http://localhost:8080/geonetwork/srv/eng/catalog.search#/home') - cy.get('.cookie-warning-actions').then(($cookie) => { - if ($cookie.is(':visible')) { - $cookie.find('button').eq(0).click() - cy.scrollTo('top') - } + Cypress.on('uncaught:exception', (err) => { + if (err.message.includes('Jsonix')) return false + if (err.message.includes('postMessage')) return false }) - cy.wait(250) - cy.get('li.signin-dropdown').click() - cy.get('#inputUsername').type(username) - cy.get('#inputPassword').type(password) + cy.visit('/geonetwork/srv/eng/catalog.signin?debug') // this will point to a 404 + cy.get('#inputUsername').type(username, { force: true }) + cy.get('#inputPassword').type(password, { force: true }) cy.get('[name="gnSigninForm"]').submit() if (redirect) cy.visit('/') } diff --git a/conf/default.toml b/conf/default.toml index 20448ee63f..1d08208883 100644 --- a/conf/default.toml +++ b/conf/default.toml @@ -6,7 +6,7 @@ [global] # This URL (relative or absolute) must point to the API endpoint of a GeoNetwork4 instance geonetwork4_api_url = "/geonetwork/srv/api" -datahub_url = "/datahub" +datahub_url = "http://myhost/datahub" # This should point to a proxy to avoid CORS errors on some requests (data preview, OGC capabilities etc.) # The actual URL will be appended after this path, e.g. : https://my.proxy/?url=http%3A%2F%2Fencoded.url%2Fows` # This is an optional parameter: leave empty to disable proxy usage diff --git a/libs/feature/catalog/src/lib/my-org/my-org.service.ts b/libs/feature/catalog/src/lib/my-org/my-org.service.ts index b2250696fb..1161cfa0c8 100644 --- a/libs/feature/catalog/src/lib/my-org/my-org.service.ts +++ b/libs/feature/catalog/src/lib/my-org/my-org.service.ts @@ -42,7 +42,7 @@ export class MyOrgService { map(([user, allUsers, orgs]) => { const orgName = user.organisation const org = orgs.find((org) => org.name === orgName) - const logoUrl = org?.logoUrl?.href.toString() + const logoUrl = org?.logoUrl?.toString() const recordCount = org?.recordCount const userList = allUsers.filter( (user) => user.organisation === orgName diff --git a/support-services/docker-entrypoint-initdb.d/dump b/support-services/docker-entrypoint-initdb.d/dump index 2fa9e50ee7..1d0aec9b57 100644 Binary files a/support-services/docker-entrypoint-initdb.d/dump and b/support-services/docker-entrypoint-initdb.d/dump differ