diff --git a/package-lock.json b/package-lock.json index 3f4a5cebed..3d946366d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2877,7 +2877,7 @@ "integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==", "requires": { "follow-redirects": "1.5.10", - "is-buffer": "2.0.3" + "is-buffer": "^2.0.2" } }, "babel-jest": { @@ -4429,15 +4429,15 @@ } }, "contentful": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/contentful/-/contentful-7.9.1.tgz", - "integrity": "sha512-cmKpkgf1alKAGlOY8atAjGrPaJ5Lj7JiPXnzNtmx6/0SzKBAzSj0lkCP1z7svSM+RRIjf4SPIjaR2BeWlGEMog==", + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/contentful/-/contentful-7.10.0.tgz", + "integrity": "sha512-ZXDwLpNC3NVM3498XyJJ7YfOuQ8QV6xUMXYj95NnLOnORyvBqmahoL+mxfUppCaS+8dFR3C45dtKHIDWm4DUyA==", "requires": { - "axios": "0.19.0", - "contentful-resolve-response": "1.1.4", - "contentful-sdk-core": "6.3.6", - "json-stringify-safe": "5.0.1", - "lodash": "4.17.15" + "axios": "^0.19.0", + "contentful-resolve-response": "^1.1.4", + "contentful-sdk-core": "^6.4.0", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.11" } }, "contentful-resolve-response": { @@ -4445,16 +4445,16 @@ "resolved": "https://registry.npmjs.org/contentful-resolve-response/-/contentful-resolve-response-1.1.4.tgz", "integrity": "sha512-oFq6n6zjbiwD9/7mBa8YHPwvPM0B0D4uOgg1n/rVzpQPhCrzeIixNj6fbJAbDiJt05rZqxiY3K1Db7pPRhRaZw==", "requires": { - "lodash": "4.17.15" + "lodash": "^4.17.4" } }, "contentful-sdk-core": { - "version": "6.3.6", - "resolved": "https://registry.npmjs.org/contentful-sdk-core/-/contentful-sdk-core-6.3.6.tgz", - "integrity": "sha512-QUHrnzBXzJmLD68apaAQYy0BaTtbfmPwZvPk2hJ3uTzjiR0rlFC7qHxL/aN4rBx8ahHqxJ6EGgmoGmcjBYxe5A==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/contentful-sdk-core/-/contentful-sdk-core-6.4.0.tgz", + "integrity": "sha512-UvYQ/Wrt5EntlMSBbgqgvKfTBRzf6fIT2p5Wp7bsnA3/KLEiYcYd/2qhUKw4x9nfp+0G8B1s4TpDwxV0oymBiA==", "requires": { - "lodash": "4.17.15", - "qs": "6.7.0" + "lodash": "^4.17.10", + "qs": "^6.5.2" } }, "convert-source-map": { @@ -6950,7 +6950,7 @@ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", "requires": { - "debug": "3.1.0" + "debug": "=3.1.0" }, "dependencies": { "debug": { diff --git a/package.json b/package.json index 4d6696a3c0..a794c8a358 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "dependencies": { "@contentful/rich-text-html-renderer": "13.4.0", "check-more-types": "2.24.0", - "contentful": "7.9.1", + "contentful": "7.10.0", "debug": "4.1.1", "docsearch.js": "2.6.3", "font-awesome": "4.7.0", diff --git a/source/_data/plugins.yml b/source/_data/plugins.yml index 01f4baf726..88ae009670 100644 --- a/source/_data/plugins.yml +++ b/source/_data/plugins.yml @@ -112,6 +112,11 @@ link: https://github.com/bartlett705/npm-cy keywords: [github, actions, npm] + - name: 'vscode-cy-helper' + description: Visual Studio Code extension for cypress and cucumber preprocessor + link: https://marketplace.visualstudio.com/items?itemName=Shelex.vscode-cy-helper + keywords: [vscode, extension, intellisense] + - name: Custom Commands plugins: - name: cy-view diff --git a/source/guides/guides/continuous-integration.md b/source/guides/guides/continuous-integration.md index 8c227ac0c7..8e25d4f95b 100644 --- a/source/guides/guides/continuous-integration.md +++ b/source/guides/guides/continuous-integration.md @@ -482,12 +482,40 @@ return server.start() node scripts/run-cypress-tests.js ``` -# Known Issues +# Common problems and solutions ## In Docker If you are running long runs on Docker, you need to set the `ipc` to `host` mode. {% issue 350 'This issue' %} describes exactly what to do. +## Xvfb + +When running on Linux, Cypress needs an X11 server; otherwise it spawns its own X11 server during the test run. When running several Cypress instances in parallel, the spawning of multiple X11 servers at once can cause problems for some of them. In this case, you can separately start a single X11 server and pass the server's address to each Cypress instance using `DISPLAY` variable. + +First, spawn the X11 server in the background at some port, for example `:99`. If you have installed `xvfb` on Linux or if you are using one of our Docker images from {% url cypress-docker-images https://github.com/cypress-io/cypress-docker-images %}, the tools below should be available. + +```shell +Xvfb :99 & +``` + +Second, set the X11 address in an environment variable + +```shell +export DISPLAY=:99 +``` + +Start headless Cypress as usual + +```shell +npx cypress run +``` + +After all tests across all Cypress instances finish, kill the Xvfb background process using `pkill` + +```shell +pkill Xvfb +``` + # See also - {% url cypress-example-kitchensink https://github.com/cypress-io/cypress-example-kitchensink#ci-status %} is set up to run on multiple CI providers. diff --git a/source/guides/tooling/code-coverage.md b/source/guides/tooling/code-coverage.md index b8199ef4a7..64a2f02459 100644 --- a/source/guides/tooling/code-coverage.md +++ b/source/guides/tooling/code-coverage.md @@ -423,6 +423,12 @@ From now on, the front end code coverage collected during end-to-end tests will You can explore the above combined full stack coverage report at the {% url 'coveralls.io/github/cypress-io/cypress-example-realworld' https://coveralls.io/github/cypress-io/cypress-example-realworld %} dashboard. +# Future work + +We are currently exploring two additional features for code coverage during end-to-end tests. First, we would like to avoid "manual" instrumentation step using Istanbul.js library and instead capture the native code coverage that can be collected by the Chrome browser's V8 engine. You can find a proof-of-concept example in {% url bahmutov/cypress-native-chrome-code-coverage-example https://github.com/bahmutov/cypress-native-chrome-code-coverage-example %} repository. + +Second, we would like to capture the code coverage from *the locally running back end server* that is serving the front end web application and handles the API requests from the web application under test. We believe that E2E tests with additional {% url "API tests" https://www.cypress.io/blog/2017/11/07/add-gui-to-your-e2e-api-tests/ %} that Cypress can perform can effectively cover a lot of back end code. + # Examples You can find full examples showing different code coverage setups in the following repositories: