diff --git a/cypress/e2e/admin-export-modals.cy.ts b/cypress/e2e/admin-export-modals.cy.ts index 9f69764d197..c5b0b0908f8 100644 --- a/cypress/e2e/admin-export-modals.cy.ts +++ b/cypress/e2e/admin-export-modals.cy.ts @@ -30,6 +30,6 @@ describe('Admin Export Modals', () => { cy.get('a[data-test="menu.section.export_batch"]').click(); // Analyze for accessibility - testA11y('ds-export-batch-selector'); + testA11y('ds-export-metadata-selector'); }); }); diff --git a/cypress/e2e/admin-notifications-publication-claim-page.cy.ts b/cypress/e2e/admin-notifications-publication-claim-page.cy.ts deleted file mode 100644 index 877a0542e25..00000000000 --- a/cypress/e2e/admin-notifications-publication-claim-page.cy.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { testA11y } from 'cypress/support/utils'; - -describe('Admin Notifications Publication Claim Page', () => { - beforeEach(() => { - // Must login as an Admin to see the page - cy.visit('/admin/notifications/publication-claim'); - cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); - }); - - it('should pass accessibility tests', () => { - - //Page must first be visible - cy.get('ds-admin-notifications-publication-claim-page').should('be.visible'); - // Analyze for accessibility issues - testA11y('ds-admin-notifications-publication-claim-page'); - }); -}); diff --git a/cypress/e2e/collection-edit.cy.ts b/cypress/e2e/collection-edit.cy.ts index 63d873db3ec..a1e25ecf70d 100644 --- a/cypress/e2e/collection-edit.cy.ts +++ b/cypress/e2e/collection-edit.cy.ts @@ -8,6 +8,8 @@ beforeEach(() => { // This page is restricted, so we will be shown the login form. Fill it out & submit. cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); + cy.intercept('/server/api/core/collections/'.concat(Cypress.env('DSPACE_TEST_COLLECTION'))).as('collection'); + cy.wait('@collection') }); describe('Edit Collection > Edit Metadata tab', () => { diff --git a/cypress/e2e/community-edit.cy.ts b/cypress/e2e/community-edit.cy.ts index 8fc1a7733e7..ed2dfc8f5ed 100644 --- a/cypress/e2e/community-edit.cy.ts +++ b/cypress/e2e/community-edit.cy.ts @@ -8,6 +8,8 @@ beforeEach(() => { // This page is restricted, so we will be shown the login form. Fill it out & submit. cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); + cy.intercept('/server/api/core/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY'))).as('community'); + cy.wait('@community') }); describe('Edit Community > Edit Metadata tab', () => { diff --git a/cypress/e2e/community-statistics.cy.ts b/cypress/e2e/community-statistics.cy.ts index 6cafed0350e..8122e68fbbf 100644 --- a/cypress/e2e/community-statistics.cy.ts +++ b/cypress/e2e/community-statistics.cy.ts @@ -6,7 +6,7 @@ describe('Community Statistics Page', () => { it('should load if you click on "Statistics" from a Community page', () => { cy.visit('/communities/'.concat(Cypress.env('DSPACE_TEST_COMMUNITY'))); - cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click(); + cy.get('a[data-test="link-menu-item.menu.section.statistics"]').click(); cy.location('pathname').should('eq', COMMUNITYSTATISTICSPAGE); }); diff --git a/cypress/e2e/homepage-statistics.cy.ts b/cypress/e2e/homepage-statistics.cy.ts index ece38686b93..88daeeb2b93 100644 --- a/cypress/e2e/homepage-statistics.cy.ts +++ b/cypress/e2e/homepage-statistics.cy.ts @@ -5,7 +5,7 @@ import '../support/commands'; describe('Site Statistics Page', () => { it('should load if you click on "Statistics" from homepage', () => { cy.visit('/'); - cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click(); + cy.get('a[data-test="link-menu-item.menu.section.statistics"]').click(); cy.location('pathname').should('eq', '/statistics'); }); diff --git a/cypress/e2e/item-edit.cy.ts b/cypress/e2e/item-edit.cy.ts index a0d49a76570..7fa8aea95fc 100644 --- a/cypress/e2e/item-edit.cy.ts +++ b/cypress/e2e/item-edit.cy.ts @@ -10,10 +10,8 @@ beforeEach(() => { // This page is restricted, so we will be shown the login form. Fill it out & submit. cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); - // We need to wait for the correction types allowed for the item to be loaded to be sure that each tab is fully loaded. - // This because the edit item page causes often tests to fails due to timeout. - cy.intercept('GET', 'server/api/config/correctiontypes/search/findByItem*').as('correctionTypes'); - cy.wait('@correctionTypes'); + cy.intercept('GET', 'server/api/core/items/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'))).as('item'); + cy.wait('@item'); }); describe('Edit Item > Edit Metadata tab', () => { diff --git a/cypress/e2e/item-page.cy.ts b/cypress/e2e/item-page.cy.ts index a6a208e9f45..a7fac6e387e 100644 --- a/cypress/e2e/item-page.cy.ts +++ b/cypress/e2e/item-page.cy.ts @@ -7,6 +7,7 @@ describe('Item Page', () => { // Test that entities will redirect to /entities/[type]/[uuid] when accessed via /items/[uuid] it('should redirect to the entity page when navigating to an item page', () => { cy.visit(ITEMPAGE); + cy.wait(1000); cy.location('pathname').should('eq', ENTITYPAGE); }); diff --git a/cypress/e2e/item-statistics.cy.ts b/cypress/e2e/item-statistics.cy.ts index 6caeacae8e1..3fdc2e7f9df 100644 --- a/cypress/e2e/item-statistics.cy.ts +++ b/cypress/e2e/item-statistics.cy.ts @@ -6,7 +6,7 @@ describe('Item Statistics Page', () => { it('should load if you click on "Statistics" from an Item/Entity page', () => { cy.visit('/entities/publication/'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION'))); - cy.get('ds-navbar ds-link-menu-item a[data-test="link-menu-item.menu.section.statistics"]').click(); + cy.get('a[data-test="link-menu-item.menu.section.statistics"]').click(); cy.location('pathname').should('eq', ITEMSTATISTICSPAGE); }); @@ -23,8 +23,7 @@ describe('Item Statistics Page', () => { it('should contain a "Total visits per month" section', () => { cy.visit(ITEMSTATISTICSPAGE); - // Check just for existence because this table is empty in CI environment as it's historical data - cy.get('.'.concat(Cypress.env('DSPACE_TEST_ENTITY_PUBLICATION')).concat('_TotalVisitsPerMonth')).should('exist'); + cy.get('table[data-test="TotalVisitsPerMonth"]').should('be.visible'); }); it('should pass accessibility tests', () => { diff --git a/cypress/e2e/quality-assurance-source-page.cy.ts b/cypress/e2e/quality-assurance-source-page.cy.ts deleted file mode 100644 index 722917ef16b..00000000000 --- a/cypress/e2e/quality-assurance-source-page.cy.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { testA11y } from 'cypress/support/utils'; - -describe('Quality Assurance Source Page', () => { - beforeEach(() => { - // Must login as an Admin to see the page - cy.visit('/notifications/quality-assurance'); - cy.loginViaForm(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD')); - }); - - it('should pass accessibility tests', () => { - // Source page must first be visible - cy.get('ds-quality-assurance-source-page-component').should('be.visible'); - // Analyze for accessibility issues - testA11y('ds-quality-assurance-source-page-component'); - }); -});