Skip to content

Commit a012e4c

Browse files
committed
Test stability fixes. Ensure Item Edit tests wait on tabs to load by testing if tab is active. Fix small bug in login-modal test.
1 parent 968c5bd commit a012e4c

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

cypress/e2e/item-edit.cy.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ describe('Edit Item > Edit Metadata tab', () => {
2020
it('should pass accessibility tests', () => {
2121
cy.get('a[data-test="metadata"]').click();
2222

23+
// Our selected tab should be active
24+
cy.get('a[data-test="metadata"]').should('have.class', 'active');
25+
2326
// <ds-edit-item-page> tag must be loaded
2427
cy.get('ds-edit-item-page').should('be.visible');
2528

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

44+
// Our selected tab should be active
45+
cy.get('a[data-test="status"]').should('have.class', 'active');
46+
4147
// <ds-item-status> tag must be loaded
4248
cy.get('ds-item-status').should('be.visible');
4349

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

60+
// Our selected tab should be active
61+
cy.get('a[data-test="bitstreams"]').should('have.class', 'active');
62+
5463
// <ds-item-bitstreams> tag must be loaded
5564
cy.get('ds-item-bitstreams').should('be.visible');
5665

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

87+
// Our selected tab should be active
88+
cy.get('a[data-test="curate"]').should('have.class', 'active');
89+
7890
// <ds-item-curate> tag must be loaded
7991
cy.get('ds-item-curate').should('be.visible');
8092

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

103+
// Our selected tab should be active
104+
cy.get('a[data-test="relationships"]').should('have.class', 'active');
105+
91106
// <ds-item-relationships> tag must be loaded
92107
cy.get('ds-item-relationships').should('be.visible');
93108

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

119+
// Our selected tab should be active
120+
cy.get('a[data-test="versionhistory"]').should('have.class', 'active');
121+
104122
// <ds-item-version-history> tag must be loaded
105123
cy.get('ds-item-version-history').should('be.visible');
106124

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

135+
// Our selected tab should be active
136+
cy.get('a[data-test="access-control"]').should('have.class', 'active');
137+
117138
// <ds-item-access-control> tag must be loaded
118139
cy.get('ds-item-access-control').should('be.visible');
119140

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

151+
// Our selected tab should be active
152+
cy.get('a[data-test="mapper"]').should('have.class', 'active');
153+
130154
// <ds-item-collection-mapper> tag must be loaded
131155
cy.get('ds-item-collection-mapper').should('be.visible');
132156

cypress/e2e/login-modal.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('Login Modal', () => {
6767

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

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

0 commit comments

Comments
 (0)