Skip to content

Commit b023c4d

Browse files
change: [UIE-10701] - Upgrade Cypress to v15.13.0, replace deprecated cy.env calls (#13555)
* Upgrade Cypress and related dependencies; replace calls to deprecated `cy.env` with `Cypress.expose` * Upgrade Cypress to 15.13.0 in Dockerfile * Added changeset: Upgrade Cypress to v15.13.0
1 parent 328ba10 commit b023c4d

24 files changed

Lines changed: 148 additions & 427 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Tech Stories
3+
---
4+
5+
Upgrade Cypress to v15.13.0 ([#13555](https://github.com/linode/manager/pull/13555))

packages/manager/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ARG IMAGE_REGISTRY=docker.io
66
ARG NODE_VERSION=22.19.0
77

88
# Cypress version.
9-
ARG CYPRESS_VERSION=15.4.0
9+
ARG CYPRESS_VERSION=15.13.0
1010

1111
# Node.js base image for Cloud Manager CI tasks.
1212
#

packages/manager/cypress/e2e/core/account/account-maintenance.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Maintenance', () => {
1818
cy.exec(`rm -f ${downloadsFolder}/${filePatterns}`, {
1919
failOnNonZeroExit: false,
2020
}).then((result) => {
21-
if (result.code === 0) {
21+
if (result.exitCode === 0) {
2222
cy.log(`Deleted file: ${filePatterns}`);
2323
} else {
2424
cy.log(`Failed to delete file: ${filePatterns}`);

packages/manager/cypress/support/api/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { oauthToken } from 'support/constants/api';
22
import { entityPrefix, entityTag } from 'support/constants/cypress';
33

4-
const apiroot = Cypress.env('REACT_APP_API_ROOT') + '/';
5-
const apirootBeta = Cypress.env('REACT_APP_API_ROOT') + 'beta/';
4+
const apiroot = Cypress.expose('REACT_APP_API_ROOT') + '/';
5+
const apirootBeta = Cypress.expose('REACT_APP_API_ROOT') + 'beta/';
66

77
export const apiCheckErrors = (
88
resp: Cypress.Response<any>,

packages/manager/cypress/support/api/domains.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const makeDomainCreateReq = (domainPayload?: CreateDomainPayload) => {
4242
},
4343
body: domainData,
4444
method: 'POST',
45-
url: Cypress.env('REACT_APP_API_ROOT') + '/domains',
45+
url: Cypress.expose('REACT_APP_API_ROOT') + '/domains',
4646
});
4747
};
4848

packages/manager/cypress/support/api/longview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const makeClientCreateReq = (
3939
},
4040
body: linodeData,
4141
method: 'POST',
42-
url: Cypress.env('REACT_APP_API_ROOT') + '/longview/clients',
42+
url: Cypress.expose('REACT_APP_API_ROOT') + '/longview/clients',
4343
});
4444
};
4545

packages/manager/cypress/support/api/managed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export const nonManagedAccount = accountSettingsFactory.build({
3030
* where Managed is not expected to be enabled (e.g. when being run via CI).
3131
*/
3232
export const expectManagedDisabled = () => {
33-
const accountSettings = Cypress.env('cloudManagerAccountSettings') as
33+
const accountSettings = Cypress.expose('cloudManagerAccountSettings') as
3434
| AccountSettings
3535
| undefined;
36-
const failOnManaged = Cypress.env('CY_TEST_FAIL_ON_MANAGED');
36+
const failOnManaged = Cypress.expose('CY_TEST_FAIL_ON_MANAGED');
3737

3838
if (!accountSettings) {
3939
throw new Error('Unable to retrieve cached account settings');

packages/manager/cypress/support/api/nodebalancers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const makeNodeBalCreateReq = (nodeBal: NodeBalancer) => {
2626
},
2727
body: nodeBalData,
2828
method: 'POST',
29-
url: Cypress.env('REACT_APP_API_ROOT') + '/v4/nodebalancers',
29+
url: Cypress.expose('REACT_APP_API_ROOT') + '/v4/nodebalancers',
3030
});
3131
};
3232

packages/manager/cypress/support/constants/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* API OAuth token for authenticating API requests and Cloud Manager interactions.
33
*/
4-
export const oauthToken = Cypress.env('MANAGER_OAUTH');
4+
export const oauthToken = Cypress.expose('MANAGER_OAUTH');
55

66
/**
77
* API request pagination page size.

packages/manager/cypress/support/constants/cypress.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
/**
66
* Tag to identify test entities, resources, etc.
77
*/
8-
export const entityTag = Cypress.env()['CY_TEST_RESOURCE_PREFIX'] || 'cy-test';
8+
export const entityTag =
9+
Cypress.expose()['CY_TEST_RESOURCE_PREFIX'] || 'cy-test';
910

1011
/**
1112
* Prefix for entity names and labels that will be created by Cypress tests.

0 commit comments

Comments
 (0)