From b0924b5d983583f320ed2a2ed537e80aceaef5d6 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 15 Jan 2025 10:30:46 -0600 Subject: [PATCH 1/2] Ensure Admin sidebar link is visible before clicking links --- cypress/e2e/admin-add-new-modals.cy.ts | 3 +++ cypress/e2e/admin-edit-modals.cy.ts | 3 +++ cypress/e2e/admin-export-modals.cy.ts | 2 ++ 3 files changed, 8 insertions(+) diff --git a/cypress/e2e/admin-add-new-modals.cy.ts b/cypress/e2e/admin-add-new-modals.cy.ts index 565ae154f1e..0179ca7a7c5 100644 --- a/cypress/e2e/admin-add-new-modals.cy.ts +++ b/cypress/e2e/admin-add-new-modals.cy.ts @@ -12,6 +12,7 @@ describe('Admin Add New Modals', () => { cy.get('#sidebar-collapse-toggle').click(); // Click on entry of menu + cy.get('#admin-menu-section-new-title').should('be.visible'); cy.get('#admin-menu-section-new-title').click(); cy.get('a[data-test="menu.section.new_community"]').click(); @@ -25,6 +26,7 @@ describe('Admin Add New Modals', () => { cy.get('#sidebar-collapse-toggle').click(); // Click on entry of menu + cy.get('#admin-menu-section-new-title').should('be.visible'); cy.get('#admin-menu-section-new-title').click(); cy.get('a[data-test="menu.section.new_collection"]').click(); @@ -38,6 +40,7 @@ describe('Admin Add New Modals', () => { cy.get('#sidebar-collapse-toggle').click(); // Click on entry of menu + cy.get('#admin-menu-section-new-title').should('be.visible'); cy.get('#admin-menu-section-new-title').click(); cy.get('a[data-test="menu.section.new_item"]').click(); diff --git a/cypress/e2e/admin-edit-modals.cy.ts b/cypress/e2e/admin-edit-modals.cy.ts index e96d6ce898c..79190bfce92 100644 --- a/cypress/e2e/admin-edit-modals.cy.ts +++ b/cypress/e2e/admin-edit-modals.cy.ts @@ -12,6 +12,7 @@ describe('Admin Edit Modals', () => { cy.get('#sidebar-collapse-toggle').click(); // Click on entry of menu + cy.get('#admin-menu-section-edit-title').should('be.visible'); cy.get('#admin-menu-section-edit-title').click(); cy.get('a[data-test="menu.section.edit_community"]').click(); @@ -25,6 +26,7 @@ describe('Admin Edit Modals', () => { cy.get('#sidebar-collapse-toggle').click(); // Click on entry of menu + cy.get('#admin-menu-section-edit-title').should('be.visible'); cy.get('#admin-menu-section-edit-title').click(); cy.get('a[data-test="menu.section.edit_collection"]').click(); @@ -38,6 +40,7 @@ describe('Admin Edit Modals', () => { cy.get('#sidebar-collapse-toggle').click(); // Click on entry of menu + cy.get('#admin-menu-section-edit-title').should('be.visible'); cy.get('#admin-menu-section-edit-title').click(); cy.get('a[data-test="menu.section.edit_item"]').click(); diff --git a/cypress/e2e/admin-export-modals.cy.ts b/cypress/e2e/admin-export-modals.cy.ts index 9f69764d197..0466920eee4 100644 --- a/cypress/e2e/admin-export-modals.cy.ts +++ b/cypress/e2e/admin-export-modals.cy.ts @@ -12,6 +12,7 @@ describe('Admin Export Modals', () => { cy.get('#sidebar-collapse-toggle').click(); // Click on entry of menu + cy.get('#admin-menu-section-export-title').should('be.visible'); cy.get('#admin-menu-section-export-title').click(); cy.get('a[data-test="menu.section.export_metadata"]').click(); @@ -25,6 +26,7 @@ describe('Admin Export Modals', () => { cy.get('#sidebar-collapse-toggle').click(); // Click on entry of menu + cy.get('#admin-menu-section-export-title').should('be.visible'); cy.get('#admin-menu-section-export-title').click(); cy.get('a[data-test="menu.section.export_batch"]').click(); From dde029df7f9ebfc995e36fb6ceb5b335a0a7f3a0 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 15 Jan 2025 10:31:10 -0600 Subject: [PATCH 2/2] Ensure Item Edit page tab is visible before & after clicking it. --- cypress/e2e/item-edit.cy.ts | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/item-edit.cy.ts b/cypress/e2e/item-edit.cy.ts index 604aab9d042..ad5d8ea0930 100644 --- a/cypress/e2e/item-edit.cy.ts +++ b/cypress/e2e/item-edit.cy.ts @@ -13,9 +13,11 @@ beforeEach(() => { describe('Edit Item > Edit Metadata tab', () => { it('should pass accessibility tests', () => { + cy.get('a[data-test="metadata"]').should('be.visible'); cy.get('a[data-test="metadata"]').click(); - // Our selected tab should be active + // Our selected tab should be both visible & active + cy.get('a[data-test="metadata"]').should('be.visible'); cy.get('a[data-test="metadata"]').should('have.class', 'active'); // tag must be loaded @@ -34,9 +36,11 @@ describe('Edit Item > Edit Metadata tab', () => { describe('Edit Item > Status tab', () => { it('should pass accessibility tests', () => { + cy.get('a[data-test="status"]').should('be.visible'); cy.get('a[data-test="status"]').click(); - // Our selected tab should be active + // Our selected tab should be both visible & active + cy.get('a[data-test="status"]').should('be.visible'); cy.get('a[data-test="status"]').should('have.class', 'active'); // tag must be loaded @@ -50,9 +54,11 @@ describe('Edit Item > Status tab', () => { describe('Edit Item > Bitstreams tab', () => { it('should pass accessibility tests', () => { + cy.get('a[data-test="bitstreams"]').should('be.visible'); cy.get('a[data-test="bitstreams"]').click(); - // Our selected tab should be active + // Our selected tab should be both visible & active + cy.get('a[data-test="bitstreams"]').should('be.visible'); cy.get('a[data-test="bitstreams"]').should('have.class', 'active'); // tag must be loaded @@ -77,9 +83,11 @@ describe('Edit Item > Bitstreams tab', () => { describe('Edit Item > Curate tab', () => { it('should pass accessibility tests', () => { + cy.get('a[data-test="curate"]').should('be.visible'); cy.get('a[data-test="curate"]').click(); - // Our selected tab should be active + // Our selected tab should be both visible & active + cy.get('a[data-test="curate"]').should('be.visible'); cy.get('a[data-test="curate"]').should('have.class', 'active'); // tag must be loaded @@ -93,9 +101,11 @@ describe('Edit Item > Curate tab', () => { describe('Edit Item > Relationships tab', () => { it('should pass accessibility tests', () => { + cy.get('a[data-test="relationships"]').should('be.visible'); cy.get('a[data-test="relationships"]').click(); - // Our selected tab should be active + // Our selected tab should be both visible & active + cy.get('a[data-test="relationships"]').should('be.visible'); cy.get('a[data-test="relationships"]').should('have.class', 'active'); // tag must be loaded @@ -109,9 +119,11 @@ describe('Edit Item > Relationships tab', () => { describe('Edit Item > Version History tab', () => { it('should pass accessibility tests', () => { + cy.get('a[data-test="versionhistory"]').should('be.visible'); cy.get('a[data-test="versionhistory"]').click(); - // Our selected tab should be active + // Our selected tab should be both visible & active + cy.get('a[data-test="versionhistory"]').should('be.visible'); cy.get('a[data-test="versionhistory"]').should('have.class', 'active'); // tag must be loaded @@ -125,9 +137,11 @@ describe('Edit Item > Version History tab', () => { describe('Edit Item > Access Control tab', () => { it('should pass accessibility tests', () => { + cy.get('a[data-test="access-control"]').should('be.visible'); cy.get('a[data-test="access-control"]').click(); - // Our selected tab should be active + // Our selected tab should be both visible & active + cy.get('a[data-test="access-control"]').should('be.visible'); cy.get('a[data-test="access-control"]').should('have.class', 'active'); // tag must be loaded @@ -141,9 +155,11 @@ describe('Edit Item > Access Control tab', () => { describe('Edit Item > Collection Mapper tab', () => { it('should pass accessibility tests', () => { + cy.get('a[data-test="mapper"]').should('be.visible'); cy.get('a[data-test="mapper"]').click(); - // Our selected tab should be active + // Our selected tab should be both visible & active + cy.get('a[data-test="mapper"]').should('be.visible'); cy.get('a[data-test="mapper"]').should('have.class', 'active'); // tag must be loaded