Skip to content

Commit

Permalink
Test stability fixes. Ensure Item Edit tests wait on tabs to load by …
Browse files Browse the repository at this point in the history
…testing if tab is active. Fix small bug in login-modal test.
  • Loading branch information
tdonohue committed Oct 9, 2024
1 parent 968c5bd commit a012e4c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions cypress/e2e/item-edit.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ describe('Edit Item > Edit Metadata tab', () => {
it('should pass accessibility tests', () => {
cy.get('a[data-test="metadata"]').click();

// Our selected tab should be active
cy.get('a[data-test="metadata"]').should('have.class', 'active');

// <ds-edit-item-page> tag must be loaded
cy.get('ds-edit-item-page').should('be.visible');

Expand All @@ -38,6 +41,9 @@ describe('Edit Item > Status tab', () => {
it('should pass accessibility tests', () => {
cy.get('a[data-test="status"]').click();

// Our selected tab should be active
cy.get('a[data-test="status"]').should('have.class', 'active');

// <ds-item-status> tag must be loaded
cy.get('ds-item-status').should('be.visible');

Expand All @@ -51,6 +57,9 @@ describe('Edit Item > Bitstreams tab', () => {
it('should pass accessibility tests', () => {
cy.get('a[data-test="bitstreams"]').click();

// Our selected tab should be active
cy.get('a[data-test="bitstreams"]').should('have.class', 'active');

// <ds-item-bitstreams> tag must be loaded
cy.get('ds-item-bitstreams').should('be.visible');

Expand All @@ -75,6 +84,9 @@ describe('Edit Item > Curate tab', () => {
it('should pass accessibility tests', () => {
cy.get('a[data-test="curate"]').click();

// Our selected tab should be active
cy.get('a[data-test="curate"]').should('have.class', 'active');

// <ds-item-curate> tag must be loaded
cy.get('ds-item-curate').should('be.visible');

Expand All @@ -88,6 +100,9 @@ describe('Edit Item > Relationships tab', () => {
it('should pass accessibility tests', () => {
cy.get('a[data-test="relationships"]').click();

// Our selected tab should be active
cy.get('a[data-test="relationships"]').should('have.class', 'active');

// <ds-item-relationships> tag must be loaded
cy.get('ds-item-relationships').should('be.visible');

Expand All @@ -101,6 +116,9 @@ describe('Edit Item > Version History tab', () => {
it('should pass accessibility tests', () => {
cy.get('a[data-test="versionhistory"]').click();

// Our selected tab should be active
cy.get('a[data-test="versionhistory"]').should('have.class', 'active');

// <ds-item-version-history> tag must be loaded
cy.get('ds-item-version-history').should('be.visible');

Expand All @@ -114,6 +132,9 @@ describe('Edit Item > Access Control tab', () => {
it('should pass accessibility tests', () => {
cy.get('a[data-test="access-control"]').click();

// Our selected tab should be active
cy.get('a[data-test="access-control"]').should('have.class', 'active');

// <ds-item-access-control> tag must be loaded
cy.get('ds-item-access-control').should('be.visible');

Expand All @@ -127,6 +148,9 @@ describe('Edit Item > Collection Mapper tab', () => {
it('should pass accessibility tests', () => {
cy.get('a[data-test="mapper"]').click();

// Our selected tab should be active
cy.get('a[data-test="mapper"]').should('have.class', 'active');

// <ds-item-collection-mapper> tag must be loaded
cy.get('ds-item-collection-mapper').should('be.visible');

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/login-modal.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('Login Modal', () => {

// Login, and the <ds-log-in> tag should no longer exist
page.submitLoginAndPasswordByPressingEnter(Cypress.env('DSPACE_TEST_ADMIN_USER'), Cypress.env('DSPACE_TEST_ADMIN_PASSWORD'));
cy.get('.form-login').should('not.exist');
cy.get('ds-log-in').should('not.exist');

// Verify we are still on homepage
cy.url().should('include', '/home');
Expand Down

0 comments on commit a012e4c

Please sign in to comment.