-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cypress): upgrade to [email protected] (#27)
* chore(cypress): upgrade to [email protected] Breaking: Flag `videoRecording` becomes `video` https://docs.cypress.io/guides/references/changelog.html#3-0-0 * chore(cypress): run all spec files in the same run to save time https://github.com/topheman/npm-registry-browser#cypress3xx-upgrade
- Loading branch information
Showing
6 changed files
with
116 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,6 +140,19 @@ I'm using [cypress.io](https://www.cypress.io/) for the e2e tests. You will find | |
|
||
<p align="center"><a href="https://twitter.com/topheman/status/989856595436867584"><img src="https://raw.githubusercontent.com/topheman/npm-registry-browser/master/public/cypress-screenshot-small.png" width="300" /></a></p> | ||
|
||
When you add a spec file, reference it in [cypress/integration/index.spec.js](cypress/integration/index.spec.js) (specific to my [cypress.json](cypress.json) config, explained bellow). | ||
|
||
#### [email protected] upgrade | ||
|
||
Since `[email protected]`, each spec file runs in isolation. The tests took much longer to run. | ||
|
||
To speed them up, I decided to run all the files in the same spec (tests don't rely on state of previous state - they could be ran in isolation if needed). | ||
|
||
[A message is output](cypress/support/precyrun.js) to explain how to run them in a regular way: | ||
|
||
* remove [cypress/integration/index.spec.js](cypress/integration/index.spec.js) | ||
* update [cypress.json](cypress.json), remove the `testFiles` entry. | ||
|
||
## Linter | ||
|
||
I use eslint to check the coding style, with the following presets: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"baseUrl": "http://localhost:5000", | ||
"videoRecording": false, | ||
"video": false, | ||
"chromeWebSecurity": false, | ||
"projectId": "8r5nf4" | ||
"projectId": "8r5nf4", | ||
"testFiles": "**/index.spec.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import "./home.spec"; | ||
import "./package.spec"; | ||
import "./qrcode.spec"; | ||
import "./search.spec"; | ||
import "./searchResults.spec"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This file is called on "precy:run" script | ||
console.log(` | ||
= Running all test files in the same spec ========================================================== | ||
Since [email protected], each spec file runs in isolation. The tests took much longer to run. | ||
To speed them up, I decided to run all the files in the same spec. | ||
When creating a new spec file, update cypress/integration/index.spec.js, add your file. | ||
If you want to revert to the regular usage: | ||
- remove cypress/integration/index.spec.js | ||
- update cypress.json, remove the "testFiles" entry. | ||
──────────────────────────────────────────────────────────────────────────────────────────────────── | ||
`); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters