Skip to content

develop to master auto PR #2824

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

Merged
merged 3 commits into from
May 28, 2020
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
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const revisionOpts = {
dontRenameFile: ['.html', 'CNAME'],
dontUpdateReference: ['.html'],
dontSearchFile: ['.js'],
debug: process.env.NODE_ENV === 'production',
debug: true,
}

function remove (folder) {
Expand Down
6 changes: 3 additions & 3 deletions source/_changelogs/4.7.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

**Features:**

- `cy.request()` now supports an `encoding` option that can be used to set the encoding of the response body, defaulting to `utf-8`. Addresses {% issue 2029 %} and {% issue 3576 %}.
- {% url "`cy.request()`" request %} now supports an `encoding` option that can be used to set the encoding of the response body, defaulting to `utf-8`. Addresses {% issue 2029 %} and {% issue 3576 %}.

**Bugfixes:**

- We fixed a regression in {% url "4.6.0" changelog-4-6-0 %} where the address bar of the application under test would disappear when scrolling commands ran and the application under test would visually shift after taking screenshots. Fixes {% issue 7443 %} and {% issue 7466 %}.
- We fixed a regression where test runs could hang when loading spec files with source maps. Fixes {% issue 7464 %}.
- We fixed a regression in {% url "4.6.0" changelog-4-6-0 %} where the address bar of the application under test would disappear when scrolling commands ran and the application under test would visually shift after taking screenshots. Fixes {% issue 7443 %} and {% issue 7466 %}.
- We fixed a regression in {% url "4.6.0" changelog-4-6-0 %} where test runs could hang when loading spec files with source maps. Fixes {% issue 7464 %}.

**Misc:**

Expand Down
1 change: 1 addition & 0 deletions source/api/commands/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ When clicking on `request` within the command log, the console outputs the follo
{% imgTag /img/api/request/console-log-request-response-body-headers-status-url.png "Console Log request" %}

{% history %}
{% url "4.7.0" changelog#3-3-0 %} | Added support for `encoding` option.
{% url "3.3.0" changelog#3-3-0 %} | Added support for options `retryOnStatusCodeFailure` and `retryOnNetworkFailure`.
{% url "3.2.0" changelog#3-2-0 %} | Added support for any valid HTTP `method` argument including `TRACE`, `COPY`, `LOCK`, `MKCOL`, `MOVE`, `PURGE`, `PROPFIND`, `PROPPATCH`, `UNLOCK`, `REPORT`, `MKACTIVITY`, `CHECKOUT`, `MERGE`, `M-SEARCH`, `NOTIFY`, `SUBSCRIBE`, `UNSUBSCRIBE`, `SEARCH`, and `CONNECT`.
{% endhistory %}
Expand Down
44 changes: 43 additions & 1 deletion source/guides/tooling/code-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,12 @@ To handle code coverage collected during each test, we created a {% url "`@cypre

## Install the plugin

{% note info %}
Please consult the {% url "`@cypress/code-coverage`" https://github.com/cypress-io/code-coverage %} documentation for up-to-date installation instructions.
{% endnote %}

```shell
npm install -D @cypress/code-coverage nyc istanbul-lib-coverage
npm install -D @cypress/code-coverage
```

Then add the code below to your {% url "`supportFile`" configuration#Folders-Files %} and {% url "`pluginsFile`" configuration#Folders-Files %}.
Expand All @@ -210,7 +214,10 @@ import '@cypress/code-coverage/support'
// cypress/plugins/index.js
module.exports = (on, config) => {
require('@cypress/code-coverage/task')(on, config)
// include any other plugin code...

// It's IMPORTANT to return the config object
// with any changed environment variables
return config
}
```
Expand Down Expand Up @@ -446,6 +453,39 @@ We are currently exploring two additional features for code coverage during end-

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.

# Videos

There is a series of videos we have recorded showing code coverage in Cypress

### How to instrument react-scripts web application for code coverage
<!-- textlint-disable terminology -->
{% video youtube edgeQZ8UpD0 %}

### Get code coverage reports from Cypress tests

{% video youtube y8StkffYra0 %}

### Excluding code from code coverage reports

{% video youtube DlceMpRpbAw %}

### Check code coverage robustly using 3rd party tool

{% video youtube dwU5gUG2 %}

### Adding code coverage badge to your project

{% video youtube bNVRxb-MKGo %}

### Show code coverage in commit status check

{% video youtube AAl4HmJ3YuM %}

### Checking code coverage on pull request

{% video youtube 9Eq_gIshK0o %}
<!-- textlint-enable -->

# Examples

You can find full examples showing different code coverage setups in the following repositories:
Expand All @@ -469,3 +509,5 @@ Find the full list of examples linked in {% url cypress-io/code-coverage#externa
- {% url "Combined End-to-end and Unit Test Coverage" https://glebbahmutov.com/blog/combined-end-to-end-and-unit-test-coverage/ %}
- {% url "Code Coverage by Parcel Bundler" https://glebbahmutov.com/blog/code-coverage-by-parcel/ %}
- {% url "Code Coverage for End-to-end Tests" https://glebbahmutov.com/blog/code-coverage-for-e2e-tests/ %}