Skip to content

Commit d7ff9c3

Browse files
authored
Merge pull request #3315 from tdonohue/upgrade_cypress
Upgrade to Cypress 13.15.0
2 parents c1cc9ba + b4d932a commit d7ff9c3

File tree

6 files changed

+79
-52
lines changed

6 files changed

+79
-52
lines changed

cypress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'cypress';
22

33
export default defineConfig({
4+
video: true,
45
videosFolder: 'cypress/videos',
56
screenshotsFolder: 'cypress/screenshots',
67
fixturesFolder: 'cypress/fixtures',

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: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@ import { testA11y } from 'cypress/support/utils';
33
const page = {
44
openLoginMenu() {
55
// Click the "Log In" dropdown menu in header
6-
cy.get('ds-header [data-test="login-menu"]').click();
6+
cy.get('[data-test="login-menu"]').click();
77
},
88
openUserMenu() {
99
// Once logged in, click the User menu in header
10-
cy.get('ds-header [data-test="user-menu"]').click();
10+
cy.get('[data-test="user-menu"]').click();
1111
},
1212
submitLoginAndPasswordByPressingButton(email, password) {
1313
// Enter email
14-
cy.get('ds-header [data-test="email"]').type(email);
14+
cy.get('[data-test="email"]').type(email);
1515
// Enter password
16-
cy.get('ds-header [data-test="password"]').type(password);
16+
cy.get('[data-test="password"]').type(password);
1717
// Click login button
18-
cy.get('ds-header [data-test="login-button"]').click();
18+
cy.get('[data-test="login-button"]').click();
1919
},
2020
submitLoginAndPasswordByPressingEnter(email, password) {
2121
// In opened Login modal, fill out email & password, then click Enter
22-
cy.get('ds-header [data-test="email"]').type(email);
23-
cy.get('ds-header [data-test="password"]').type(password);
24-
cy.get('ds-header [data-test="password"]').type('{enter}');
22+
cy.get('[data-test="email"]').type(email);
23+
cy.get('[data-test="password"]').type(password);
24+
cy.get('[data-test="password"]').type('{enter}');
2525
},
2626
submitLogoutByPressingButton() {
2727
// This is the POST command that will actually log us out
2828
cy.intercept('POST', '/server/api/authn/logout').as('logout');
2929
// Click logout button
30-
cy.get('ds-header [data-test="logout-button"]').click();
30+
cy.get('[data-test="logout-button"]').click();
3131
// Wait until above POST command responds before continuing
3232
// (This ensures next action waits until logout completes)
3333
cy.wait('@logout');
@@ -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');

cypress/support/commands.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ Cypress.Commands.add('login', login);
101101
*/
102102
function loginViaForm(email: string, password: string): void {
103103
// Enter email
104-
cy.get('ds-log-in [data-test="email"]').type(email);
104+
cy.get('[data-test="email"]').type(email);
105105
// Enter password
106-
cy.get('ds-log-in [data-test="password"]').type(password);
106+
cy.get('[data-test="password"]').type(password);
107107
// Click login button
108-
cy.get('ds-log-in [data-test="login-button"]').click();
108+
cy.get('[data-test="login-button"]').click();
109109
}
110110
// Add as a Cypress command (i.e. assign to 'cy.loginViaForm')
111111
Cypress.Commands.add('loginViaForm', loginViaForm);

package-lock.json

Lines changed: 39 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@
202202
"compression-webpack-plugin": "^9.2.0",
203203
"copy-webpack-plugin": "^6.4.1",
204204
"cross-env": "^7.0.3",
205-
"cypress": "12.17.4",
206-
"cypress-axe": "^1.4.0",
205+
"cypress": "^13.15.0",
206+
"cypress-axe": "^1.5.0",
207207
"deep-freeze": "0.0.1",
208208
"eslint": "^8.39.0",
209209
"eslint-plugin-deprecation": "^1.4.1",

0 commit comments

Comments
 (0)