Skip to content

Commit 1d015a5

Browse files
authored
Merge pull request #156 from S-H-GAMELINKS/support/cypress-v10or-later
Supports Cypress v10 or later
2 parents 9b3ed03 + ea4319e commit 1d015a5

File tree

14 files changed

+110
-69
lines changed

14 files changed

+110
-69
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Once installed, you'll want to run:
5050
$ rake cypress:init
5151
```
5252

53-
This will override a few configurations in your `cypress.json` configuration
53+
This will override a few configurations in your `cypress.config.js` configuration
5454
file.
5555

5656
## Usage
@@ -161,7 +161,7 @@ preferred environment variables project-wide using a tool like
161161
the Rails test server on
162162
* **CYPRESS_RAILS_BASE_PATH** (default: `"/"`) the base path for all Cypress's
163163
requests to the app (e.g. via `cy.visit()`). If you've customized your
164-
`baseUrl` setting (e.g. in `cypress.json`), you'll need to duplicate it with
164+
`baseUrl` setting (e.g. in `cypress.config.js`), you'll need to duplicate it with
165165
this environment variable
166166
* **CYPRESS_RAILS_TRANSACTIONAL_SERVER** (default: `true`) when true, will start
167167
a transaction on all database connections before launching the server. In

example/cypress.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
// setupNodeEvents can be defined in either
5+
// the e2e or component configuration
6+
e2e: {
7+
setupNodeEvents(on, config) {
8+
on('before:browser:launch', (browser = {}, launchOptions) => {
9+
/* ... */
10+
})
11+
},
12+
},
13+
screenshotsFolder: "tmp/cypress_screenshots",
14+
videosFolder: "tmp/cypress_videos",
15+
trashAssetsBeforeRuns: false
16+
})

example/cypress.json

Lines changed: 0 additions & 5 deletions
This file was deleted.
File renamed without changes.

example/cypress/plugins/index.js

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/// <reference types="cypress" />
2+
// ***********************************************
3+
// This example commands.ts shows you how to
4+
// create various custom commands and overwrite
5+
// existing commands.
6+
//
7+
// For more comprehensive examples of custom
8+
// commands please read more here:
9+
// https://on.cypress.io/custom-commands
10+
// ***********************************************
11+
//
12+
//
13+
// -- This is a parent command --
14+
// Cypress.Commands.add('login', (email, password) => { ... })
15+
//
16+
//
17+
// -- This is a child command --
18+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
19+
//
20+
//
21+
// -- This is a dual command --
22+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
23+
//
24+
//
25+
// -- This will overwrite an existing command --
26+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
27+
//
28+
// declare global {
29+
// namespace Cypress {
30+
// interface Chainable {
31+
// login(email: string, password: string): Chainable<void>
32+
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
33+
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34+
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
35+
// }
36+
// }
37+
// }

example/cypress/support/index.js renamed to example/cypress/support/e2e.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ***********************************************************
2-
// This example support/index.js is processed and
2+
// This example support/e2e.ts is processed and
33
// loaded automatically before your test files.
44
//
55
// This is a great place to put global configuration and
@@ -12,3 +12,9 @@
1212
// You can read more here:
1313
// https://on.cypress.io/configuration
1414
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands';
18+
19+
// Alternatively you can use CommonJS syntax:
20+
// require('./commands')

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"version": "0.1.0",
1313
"devDependencies": {
14-
"cypress": "9.6.1",
14+
"cypress": "^12.13.0",
1515
"webpack-dev-server": "^3.8.0"
1616
}
1717
}

0 commit comments

Comments
 (0)