Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Upgrade Cypress from v9 to v12 #37810

Merged
merged 41 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4af2acc
run-with-conditional-flag: Use CYPRESS_GROUP_NAME env var
LekoArts Mar 30, 2023
275cce3
mdx
LekoArts Mar 30, 2023
499d5f4
path-prefix
LekoArts Mar 30, 2023
aea5d66
visual-regression config changes
LekoArts Mar 30, 2023
6ec0c80
visual-regression move snapshots
LekoArts Mar 30, 2023
3fb82e4
trailing-slash
LekoArts Mar 30, 2023
3c08b34
then don't use TS for configs... :tableflip:
LekoArts Mar 30, 2023
43d3e66
Revert "then don't use TS for configs... :tableflip:"
LekoArts Mar 30, 2023
1ba432e
add typescript dep
LekoArts Mar 30, 2023
f65ce0c
add tsconfig
LekoArts Mar 30, 2023
6cab274
themes
LekoArts Mar 30, 2023
83c8405
contentful YOLO
LekoArts Mar 30, 2023
f87a444
themes add tsconfig
LekoArts Mar 30, 2023
a76f50e
Merge branch 'master' into cypress-9-to-12
LekoArts Apr 3, 2023
d4926a2
begin development-runtime
LekoArts Apr 3, 2023
a6dd961
fix contentful image snapshots location
LekoArts Apr 3, 2023
6bbae5d
development-runtime: fix snapshot location
LekoArts Apr 3, 2023
422f5c6
contentful remove unused import
LekoArts Apr 4, 2023
2e68303
finish development-runtime?
LekoArts Apr 4, 2023
bd3d618
fix specPattern lel
LekoArts Apr 4, 2023
75def60
finish production-runtime
LekoArts Apr 4, 2023
d03b139
videoUploadOnPasses: false
LekoArts Apr 4, 2023
baf8c53
add typescript
LekoArts Apr 4, 2023
6d00a75
update package.json stuff
LekoArts Apr 4, 2023
eb4ce16
use cypress-split
LekoArts Apr 4, 2023
e2a1409
Revert "use cypress-split"
LekoArts Apr 4, 2023
32e5b90
fix typo
LekoArts Apr 4, 2023
08cc49d
fix production-runtime
LekoArts Apr 4, 2023
a3243b6
development run all specs experiment
LekoArts Apr 4, 2023
7cd422c
fix styling
LekoArts Apr 4, 2023
22125dc
fix error-handling
LekoArts Apr 4, 2023
738488c
update lifecycle-methods
LekoArts Apr 5, 2023
60e9206
move project ids to config files
LekoArts Apr 5, 2023
711683b
add group names to trailing-slash
LekoArts Apr 5, 2023
d34d6f4
use env vars
LekoArts Apr 5, 2023
439eec0
fix record script
LekoArts Apr 5, 2023
4157003
does now this work lol?
LekoArts Apr 5, 2023
5c8aaa6
setup env vars
LekoArts Apr 5, 2023
71b32d5
try again
LekoArts Apr 5, 2023
82c5a36
skip redirects
LekoArts Apr 6, 2023
c55c243
add requireSnapshots
LekoArts Apr 6, 2023
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
6 changes: 0 additions & 6 deletions e2e-tests/mdx/cypress-dev.json

This file was deleted.

6 changes: 0 additions & 6 deletions e2e-tests/mdx/cypress.json

This file was deleted.

11 changes: 11 additions & 0 deletions e2e-tests/mdx/cypress/configs/build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from "cypress"

export default defineConfig({
e2e: {
baseUrl: `http://localhost:9000`,
specPattern: `cypress/integration/*.{js,ts}`
},
env: {
"GATSBY_COMMAND": `build`
}
})
11 changes: 11 additions & 0 deletions e2e-tests/mdx/cypress/configs/develop.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from "cypress"

export default defineConfig({
e2e: {
baseUrl: `http://localhost:8000`,
specPattern: `cypress/integration/*.{js,ts}`
},
env: {
"GATSBY_COMMAND": `develop`
}
})
17 changes: 0 additions & 17 deletions e2e-tests/mdx/cypress/plugins/index.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
import "gatsby-cypress"
import "./commands"
16 changes: 0 additions & 16 deletions e2e-tests/mdx/cypress/support/index.js

This file was deleted.

8 changes: 8 additions & 0 deletions e2e-tests/mdx/cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
}
13 changes: 7 additions & 6 deletions e2e-tests/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@mdx-js/react": "^2",
"@sindresorhus/slugify": "^2.1.1",
"cypress": "^9.7.0",
"cypress": "^12.9.0",
"fs-extra": "^11.1.0",
"gatsby": "next",
"gatsby-plugin-mdx": "next",
Expand Down Expand Up @@ -35,10 +35,10 @@
"start-server-and-test:develop": "start-server-and-test develop http://localhost:8000 cy:run:develop",
"start-server-and-test:build": "start-server-and-test serve http://localhost:9000 cy:run:build",
"serve": "gatsby serve",
"cy:open:develop": "cypress open --config-file cypress-dev.json",
"cy:open:build": "cypress open",
"cy:run:build": "node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --group production",
"cy:run:develop": "node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --config-file cypress-dev.json --group development",
"cy:open:develop": "cypress open --browser chrome --e2e --config-file cypress/configs/develop.ts",
"cy:open:build": "cypress open --browser chrome --e2e --config-file cypress/configs/build.ts",
"cy:run:build": "CYPRESS_GROUP_NAME=production node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file cypress/configs/build.ts",
"cy:run:develop": "CYPRESS_GROUP_NAME=development node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e --config-file cypress/configs/develop.ts",
"reset": "node scripts/reset.js",
"update": "node scripts/update.js"
},
Expand All @@ -47,6 +47,7 @@
"gatsby-cypress": "next",
"is-ci": "^3.0.1",
"prettier": "^2.8.3",
"start-server-and-test": "^1.15.3"
"start-server-and-test": "^2.0.0",
"typescript": "^5.0.2"
}
}
8 changes: 8 additions & 0 deletions e2e-tests/path-prefix/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "cypress"

export default defineConfig({
e2e: {
baseUrl: `http://localhost:9000/blog`,
specPattern: `cypress/integration/*.{js,ts}`
},
})
3 changes: 0 additions & 3 deletions e2e-tests/path-prefix/cypress.json

This file was deleted.

17 changes: 0 additions & 17 deletions e2e-tests/path-prefix/cypress/plugins/index.js

This file was deleted.

1 change: 1 addition & 0 deletions e2e-tests/path-prefix/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "gatsby-cypress"
16 changes: 0 additions & 16 deletions e2e-tests/path-prefix/cypress/support/index.js

This file was deleted.

8 changes: 8 additions & 0 deletions e2e-tests/path-prefix/cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
}
16 changes: 8 additions & 8 deletions e2e-tests/path-prefix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
"version": "1.0.0",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": {
"cypress": "^9.7.0",
"cypress": "^12.9.0",
"gatsby": "next",
"gatsby-plugin-feed": "next",
"gatsby-plugin-image": "next",
"gatsby-plugin-manifest": "next",
"gatsby-plugin-offline": "next",
"gatsby-plugin-sharp": "next",
"gatsby-plugin-sitemap": "next",
"gatsby-source-filesystem": "next",
Expand All @@ -30,13 +29,13 @@
"develop": "gatsby develop",
"format": "prettier --write '**/*.js'",
"test": "npm run build && npm run start-server-and-test",
"start-server-and-test": "start-server-and-test serve \"http://localhost:9000/blog/|http://localhost:9001/blog/\" cy:run",
"start-server-and-test:locally": "start-server-and-test serve \"http://localhost:9000/blog/|http://localhost:9001/blog/\" cy:open",
"start-server-and-test": "start-server-and-test serve http://localhost:9000/blog/ cy:run",
"start-server-and-test:locally": "start-server-and-test serve http://localhost:9000/blog/ cy:open",
"serve": "npm-run-all --parallel serve:*",
"serve:site": "gatsby serve --prefix-paths",
"serve:assets": "node scripts/serve.js",
"cy:open": "cypress open",
"cy:run": "node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome"
"cy:open": "cypress open --browser chrome --e2e",
"cy:run": "node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e"
},
"devDependencies": {
"cpy-cli": "^4.2.0",
Expand All @@ -46,8 +45,9 @@
"is-ci": "^3.0.1",
"make-dir-cli": "^3.0.0",
"npm-run-all": "^4.1.5",
"prettier": "2.8.3",
"start-server-and-test": "^1.15.3",
"prettier": "^2.8.7",
"start-server-and-test": "^2.0.0",
"typescript": "^5.0.2",
"wait-on": "^7.0.1"
},
"repository": {
Expand Down
5 changes: 0 additions & 5 deletions e2e-tests/trailing-slash/cypress-always.json

This file was deleted.

5 changes: 0 additions & 5 deletions e2e-tests/trailing-slash/cypress-ignore.json

This file was deleted.

5 changes: 0 additions & 5 deletions e2e-tests/trailing-slash/cypress-never.json

This file was deleted.

9 changes: 9 additions & 0 deletions e2e-tests/trailing-slash/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "cypress"

export default defineConfig({
e2e: {
specPattern: `cypress/integration/*.{js,ts}`
},
videoUploadOnPasses: false,
chromeWebSecurity: false,
})
4 changes: 0 additions & 4 deletions e2e-tests/trailing-slash/cypress.json

This file was deleted.

9 changes: 9 additions & 0 deletions e2e-tests/trailing-slash/cypress/configs/always.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "cypress"

export default defineConfig({
e2e: {
specPattern: [`cypress/integration/always.js`, `cypress/integration/functions.js`, `cypress/integration/static.js`]
},
videoUploadOnPasses: false,
chromeWebSecurity: false,
})
9 changes: 9 additions & 0 deletions e2e-tests/trailing-slash/cypress/configs/ignore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "cypress"

export default defineConfig({
e2e: {
specPattern: [`cypress/integration/ignore.js`, `cypress/integration/functions.js`, `cypress/integration/static.js`]
},
videoUploadOnPasses: false,
chromeWebSecurity: false,
})
9 changes: 9 additions & 0 deletions e2e-tests/trailing-slash/cypress/configs/never.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "cypress"

export default defineConfig({
e2e: {
specPattern: [`cypress/integration/never.js`, `cypress/integration/functions.js`, `cypress/integration/static.js`]
},
videoUploadOnPasses: false,
chromeWebSecurity: false,
})
2 changes: 1 addition & 1 deletion e2e-tests/trailing-slash/cypress/integration/always.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertPageVisits } from "../support/utils/trailing-slash"
import { assertPageVisits } from "../utils/trailing-slash"

Cypress.on('uncaught:exception', (err) => {
if (err.message.includes('Minified React error #418') || err.message.includes('Minified React error #423') || err.message.includes('Minified React error #425')) {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/trailing-slash/cypress/integration/functions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertPageVisits } from "../support/utils/trailing-slash"
import { assertPageVisits } from "../utils/trailing-slash"

describe(`functions`, () => {
describe(`src/api/test.js`, () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/trailing-slash/cypress/integration/ignore.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertPageVisits } from "../support/utils/trailing-slash"
import { assertPageVisits } from "../utils/trailing-slash"

Cypress.on('uncaught:exception', (err) => {
if (err.message.includes('Minified React error #418') || err.message.includes('Minified React error #423') || err.message.includes('Minified React error #425')) {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/trailing-slash/cypress/integration/never.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertPageVisits } from "../support/utils/trailing-slash"
import { assertPageVisits } from "../utils/trailing-slash"

Cypress.on('uncaught:exception', (err) => {
if (err.message.includes('Minified React error #418') || err.message.includes('Minified React error #423') || err.message.includes('Minified React error #425')) {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/trailing-slash/cypress/integration/static.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertPageVisits } from "../support/utils/trailing-slash"
import { assertPageVisits } from "../utils/trailing-slash"

const IS_BUILD = Cypress.env(`IS_BUILD`)

Expand Down
17 changes: 0 additions & 17 deletions e2e-tests/trailing-slash/cypress/plugins/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions e2e-tests/trailing-slash/cypress/support/commands.js

This file was deleted.

18 changes: 18 additions & 0 deletions e2e-tests/trailing-slash/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import "gatsby-cypress"

declare global {
namespace Cypress {
interface Chainable {
/**
* Assert the current URL
* @param route
* @example cy.assertRoute('/page-2')
*/
assertRoute(value: string): Chainable<JQuery<HTMLElement>>
}
}
}

Cypress.Commands.add(`assertRoute`, route => {
cy.url().should(`equal`, `${window.location.origin}${route}`)
})
8 changes: 8 additions & 0 deletions e2e-tests/trailing-slash/cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
}
Loading