Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tech Stories
---

Upgrade Cypress to v15.13.0 ([#13555](https://github.com/linode/manager/pull/13555))
2 changes: 1 addition & 1 deletion packages/manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG IMAGE_REGISTRY=docker.io
ARG NODE_VERSION=22.19.0

# Cypress version.
ARG CYPRESS_VERSION=15.4.0
ARG CYPRESS_VERSION=15.13.0

# Node.js base image for Cloud Manager CI tasks.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('Maintenance', () => {
cy.exec(`rm -f ${downloadsFolder}/${filePatterns}`, {
failOnNonZeroExit: false,
}).then((result) => {
if (result.code === 0) {
if (result.exitCode === 0) {
cy.log(`Deleted file: ${filePatterns}`);
} else {
cy.log(`Failed to delete file: ${filePatterns}`);
Expand Down
4 changes: 2 additions & 2 deletions packages/manager/cypress/support/api/common.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { oauthToken } from 'support/constants/api';
import { entityPrefix, entityTag } from 'support/constants/cypress';

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

export const apiCheckErrors = (
resp: Cypress.Response<any>,
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/cypress/support/api/domains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const makeDomainCreateReq = (domainPayload?: CreateDomainPayload) => {
},
body: domainData,
method: 'POST',
url: Cypress.env('REACT_APP_API_ROOT') + '/domains',
url: Cypress.expose('REACT_APP_API_ROOT') + '/domains',
});
};

Expand Down
2 changes: 1 addition & 1 deletion packages/manager/cypress/support/api/longview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const makeClientCreateReq = (
},
body: linodeData,
method: 'POST',
url: Cypress.env('REACT_APP_API_ROOT') + '/longview/clients',
url: Cypress.expose('REACT_APP_API_ROOT') + '/longview/clients',
});
};

Expand Down
4 changes: 2 additions & 2 deletions packages/manager/cypress/support/api/managed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export const nonManagedAccount = accountSettingsFactory.build({
* where Managed is not expected to be enabled (e.g. when being run via CI).
*/
export const expectManagedDisabled = () => {
const accountSettings = Cypress.env('cloudManagerAccountSettings') as
const accountSettings = Cypress.expose('cloudManagerAccountSettings') as
| AccountSettings
| undefined;
const failOnManaged = Cypress.env('CY_TEST_FAIL_ON_MANAGED');
const failOnManaged = Cypress.expose('CY_TEST_FAIL_ON_MANAGED');

if (!accountSettings) {
throw new Error('Unable to retrieve cached account settings');
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/cypress/support/api/nodebalancers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const makeNodeBalCreateReq = (nodeBal: NodeBalancer) => {
},
body: nodeBalData,
method: 'POST',
url: Cypress.env('REACT_APP_API_ROOT') + '/v4/nodebalancers',
url: Cypress.expose('REACT_APP_API_ROOT') + '/v4/nodebalancers',
});
};

Expand Down
2 changes: 1 addition & 1 deletion packages/manager/cypress/support/constants/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* API OAuth token for authenticating API requests and Cloud Manager interactions.
*/
export const oauthToken = Cypress.env('MANAGER_OAUTH');
export const oauthToken = Cypress.expose('MANAGER_OAUTH');

/**
* API request pagination page size.
Expand Down
3 changes: 2 additions & 1 deletion packages/manager/cypress/support/constants/cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
/**
* Tag to identify test entities, resources, etc.
*/
export const entityTag = Cypress.env()['CY_TEST_RESOURCE_PREFIX'] || 'cy-test';
export const entityTag =
Cypress.expose()['CY_TEST_RESOURCE_PREFIX'] || 'cy-test';

/**
* Prefix for entity names and labels that will be created by Cypress tests.
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/cypress/support/constants/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
/**
* Login base URL for Cloud Manager.
*/
export const loginBaseUrl = Cypress.env('REACT_APP_LOGIN_ROOT');
export const loginBaseUrl = Cypress.expose('REACT_APP_LOGIN_ROOT');
4 changes: 2 additions & 2 deletions packages/manager/cypress/support/plugins/fetch-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export const fetchAccount: CypressPlugin = async (_on, config) => {

return {
...config,
env: {
...config.env,
expose: {
...config.expose,
cloudManagerAccount: account || accountCacheData,
cloudManagerAccountSettings: accountSettings,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export const fetchLinodeClusters: CypressPlugin = async (on, config) => {
});
return {
...config,
env: {
...config.env,
expose: {
...config.expose,
cloudManagerClusters: clusters.data,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export const fetchLinodeImages: CypressPlugin = async (_, config) => {
const images = data.data;
return {
...config,
env: {
...config.env,
expose: {
...config.expose,
cloudManagerImages: images,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export const fetchLinodeRegions: CypressPlugin = async (on, config) => {

return {
...config,
env: {
...config.env,
expose: {
...config.expose,
cloudManagerRegions: extendedRegions,
cloudManagerAvailability: availability.data,
},
Expand Down
5 changes: 5 additions & 0 deletions packages/manager/cypress/support/plugins/load-env-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export const loadEnvironmentConfig: CypressPlugin = (

return {
...config,
expose: {
...config.expose,
...(conf.parsed ?? []),
...process.env,
},
env: {
...config.env,
...(conf.parsed ?? []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { Account } from '@linode/api-v4';
export const mockAccountRequest = () => {
// `cloudManagerAccount` is fetched during setup if the `fetchAccount` plugin is used.
// See also: `cypress/support/plugins/fetch-account.ts`.
const cachedAccount = Cypress.env('cloudManagerAccount') as
const cachedAccount = Cypress.expose('cloudManagerAccount') as
| Account
| undefined;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { launchDarklyUrlPattern } from 'support/constants/feature-flags';
* priority in the event that both modify the same feature flag value.
*/
export const mockFeatureFlagRequests = () => {
const featureFlagOverrides = Cypress.env('featureFlagOverrides');
const featureFlagOverrides = Cypress.expose('featureFlagOverrides');

if (featureFlagOverrides) {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/cypress/support/setup/test-tagging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { Runnable, Test } from 'mocha';
cy.tag = tag;
cy.addTag = addTag;

const query = Cypress.env('CY_TEST_TAGS') ?? '';
const query = Cypress.expose('CY_TEST_TAGS') ?? '';

/**
*
Expand Down
4 changes: 2 additions & 2 deletions packages/manager/cypress/support/util/clusters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const chooseCluster = (): ObjectStorageCluster => {
* @returns Override Cloud Manager cluster, or `undefined`.
*/
export const getOverrideCluster = (): ObjectStorageCluster | undefined => {
const overrideClusterId = Cypress.env('CY_TEST_CLUSTER');
const overrideClusterId = Cypress.expose('CY_TEST_CLUSTER');

try {
return getClusterById(overrideClusterId);
Expand Down Expand Up @@ -62,7 +62,7 @@ export const getClusterById = (
*
* Retrieved via Linode APIv4 during Cypress start-up.
*/
export const clusters: ObjectStorageCluster[] = Cypress.env(
export const clusters: ObjectStorageCluster[] = Cypress.expose(
'cloudManagerClusters'
) as ObjectStorageCluster[];

Expand Down
2 changes: 1 addition & 1 deletion packages/manager/cypress/support/util/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const disallowedImageIds: string[] = [];
*
* Retrieved via Linode APIv4 during Cypress start-up.
*/
export const images: Image[] = Cypress.env('cloudManagerImages') as Image[];
export const images: Image[] = Cypress.expose('cloudManagerImages') as Image[];

/**
* Returns a known Cloud Manager image at random, or returns a user-chosen
Expand Down
6 changes: 3 additions & 3 deletions packages/manager/cypress/support/util/regions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const disallowedRegionIds = [
* @returns Override Cloud Manager region, or `undefined`.
*/
export const getOverrideRegion = (): ExtendedRegion | undefined => {
const overrideRegionId = Cypress.env('CY_TEST_REGION');
const overrideRegionId = Cypress.expose('CY_TEST_REGION');

try {
return getRegionById(overrideRegionId);
Expand All @@ -156,7 +156,7 @@ export const getOverrideRegion = (): ExtendedRegion | undefined => {
*
* Retrieved via Linode APIv4 during Cypress start-up.
*/
export const regions: ExtendedRegion[] = Cypress.env(
export const regions: ExtendedRegion[] = Cypress.expose(
'cloudManagerRegions'
) as ExtendedRegion[];

Expand All @@ -165,7 +165,7 @@ export const regions: ExtendedRegion[] = Cypress.env(
*
* Retrieved via Linode APIv4 during Cypress start-up.
*/
export const availability: AccountAvailability[] = Cypress.env(
export const availability: AccountAvailability[] = Cypress.expose(
'cloudManagerAvailability'
) as AccountAvailability[];

Expand Down
10 changes: 5 additions & 5 deletions packages/manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
]
},
"devDependencies": {
"@4tw/cypress-drag-drop": "^2.3.0",
"@4tw/cypress-drag-drop": "^2.3.1",
"@storybook/addon-a11y": "^10.3.3",
"@storybook/addon-docs": "^10.3.3",
"@storybook/react-vite": "^10.3.3",
Expand Down Expand Up @@ -160,17 +160,17 @@
"chai-string": "^1.5.0",
"concurrently": "^9.1.0",
"css-mediaquery": "^0.1.2",
"cypress": "15.4.0",
"cypress": "15.13.0",
"cypress-axe": "^1.7.0",
"cypress-file-upload": "^5.0.8",
"cypress-mochawesome-reporter": "^3.8.2",
"cypress-mochawesome-reporter": "^4.0.2",
"cypress-multi-reporters": "^2.0.5",
"cypress-on-fix": "^1.1.0",
"cypress-real-events": "^1.14.0",
"cypress-real-events": "^1.15.0",
"cypress-vite": "^1.8.0",
"dotenv": "^16.0.3",
"factory.ts": "^0.5.1",
"glob": "^10.5.0",
"glob": "^13.0.6",
"globals": "^16.0.0",
"history": "4",
"jsdom": "^24.1.1",
Expand Down
Loading
Loading