Skip to content

Commit

Permalink
Merge pull request DSpace#3842 from tdonohue/test_stabilization
Browse files Browse the repository at this point in the history
Attempt to stabilize a few randomly failing e2e tests
  • Loading branch information
tdonohue authored Jan 15, 2025
2 parents 6dd61ca + 7feb9fc commit c20bf58
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 13 deletions.
3 changes: 3 additions & 0 deletions cypress/e2e/admin-add-new-modals.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('Admin Add New Modals', () => {
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-new-title"]').click();

cy.get('a[data-test="menu.section.new_community"]').click();
Expand All @@ -25,6 +26,7 @@ describe('Admin Add New Modals', () => {
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-new-title"]').click();

cy.get('a[data-test="menu.section.new_collection"]').click();
Expand All @@ -38,6 +40,7 @@ describe('Admin Add New Modals', () => {
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('[data-test="admin-menu-section-new-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-new-title"]').click();

cy.get('a[data-test="menu.section.new_item"]').click();
Expand Down
9 changes: 6 additions & 3 deletions cypress/e2e/admin-edit-modals.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ describe('Admin Edit Modals', () => {
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-edit-title').click();
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-edit-title"]').click();

cy.get('a[data-test="menu.section.edit_community"]').click();

Expand All @@ -25,7 +26,8 @@ describe('Admin Edit Modals', () => {
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-edit-title').click();
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-edit-title"]').click();

cy.get('a[data-test="menu.section.edit_collection"]').click();

Expand All @@ -38,7 +40,8 @@ describe('Admin Edit Modals', () => {
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-edit-title').click();
cy.get('[data-test="admin-menu-section-edit-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-edit-title"]').click();

cy.get('a[data-test="menu.section.edit_item"]').click();

Expand Down
6 changes: 4 additions & 2 deletions cypress/e2e/admin-export-modals.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ describe('Admin Export Modals', () => {
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-export-title').click();
cy.get('[data-test="admin-menu-section-export-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-export-title"]').click();

cy.get('a[data-test="menu.section.export_metadata"]').click();

Expand All @@ -25,7 +26,8 @@ describe('Admin Export Modals', () => {
cy.get('[data-test="sidebar-collapse-toggle"]').click();

// Click on entry of menu
cy.get('#admin-menu-section-export-title').click();
cy.get('[data-test="admin-menu-section-export-title"]').should('be.visible');
cy.get('[data-test="admin-menu-section-export-title"]').click();

cy.get('a[data-test="menu.section.export_batch"]').click();

Expand Down
32 changes: 24 additions & 8 deletions cypress/e2e/item-edit.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

// <ds-edit-item-page> tag must be loaded
Expand All @@ -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');

// <ds-item-status> tag must be loaded
Expand All @@ -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');

// <ds-item-bitstreams> tag must be loaded
Expand All @@ -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');

// <ds-item-curate> tag must be loaded
Expand All @@ -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');

// <ds-item-relationships> tag must be loaded
Expand All @@ -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');

// <ds-item-version-history> tag must be loaded
Expand All @@ -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');

// <ds-item-access-control> tag must be loaded
Expand All @@ -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');

// <ds-item-collection-mapper> tag must be loaded
Expand Down

0 comments on commit c20bf58

Please sign in to comment.