All Projects → cypress-io → cypress-example-todomvc-redux

cypress-io / cypress-example-todomvc-redux

Licence: MIT license
Example TodoMVC application with full code coverage

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to cypress-example-todomvc-redux

next-and-cypress-example
Next.js example instrumented for code coverage from Cypress tests
Stars: ✭ 111 (+158.14%)
Mutual labels:  code-coverage, cypress-example, cypress-code-coverage-example
todo-graphql-example
Example Todo app on top of json-graphql-server
Stars: ✭ 20 (-53.49%)
Mutual labels:  cypress, cypress-example
Cypress Example Recipes
Various recipes for testing common scenarios with Cypress
Stars: ✭ 2,485 (+5679.07%)
Mutual labels:  cypress, cypress-example
local-cypress
Use Cypress without global objects
Stars: ✭ 19 (-55.81%)
Mutual labels:  cypress, cypress-example
instrument-cra
Little module for CRA applications to instrument code without ejecting react-scripts
Stars: ✭ 61 (+41.86%)
Mutual labels:  code-coverage, cypress
Cypress Realworld App
A payment application to demonstrate real-world usage of Cypress testing methods, patterns, and workflows.
Stars: ✭ 2,888 (+6616.28%)
Mutual labels:  code-coverage, cypress
cypress-gh-action-example
Example running Cypress tests inside GitHub Action
Stars: ✭ 29 (-32.56%)
Mutual labels:  cypress, cypress-example
Skunk
A SkunkScore Calculator for Ruby Code -- Find the most complicated code without test coverage!
Stars: ✭ 228 (+430.23%)
Mutual labels:  code-coverage
cypress-xpath
Adds XPath command to Cypress test runner
Stars: ✭ 145 (+237.21%)
Mutual labels:  cypress
Github Action
Coveralls Github Action
Stars: ✭ 214 (+397.67%)
Mutual labels:  code-coverage
Minicover
Cross platform code coverage tool for .NET Core
Stars: ✭ 193 (+348.84%)
Mutual labels:  code-coverage
next-ts-starter
A Next.JS powered Typescript starter with styled components, styled-system, framer motion, jest and cypress
Stars: ✭ 27 (-37.21%)
Mutual labels:  cypress
react-learning-resources
A curated list of resources to learn React and related web technologies as fast as possible.
Stars: ✭ 65 (+51.16%)
Mutual labels:  cypress
Xcparse
Command line tool & Swift framework for parsing Xcode 11+ xcresult
Stars: ✭ 221 (+413.95%)
Mutual labels:  code-coverage
code-coverage-action
GitHub Action that generates code coverage reports
Stars: ✭ 28 (-34.88%)
Mutual labels:  code-coverage
Cmake Scripts
A selection of useful scripts for use in CMake projects, include code coverage, sanitizers, and dependency graph generation.
Stars: ✭ 202 (+369.77%)
Mutual labels:  code-coverage
ruby-codacy-coverage
DEPRECATED Post coverage results to Codacy
Stars: ✭ 12 (-72.09%)
Mutual labels:  code-coverage
amazin
A MERN-stack app for eCommerce platform, Webshop, Web Store. Storybook: https://www.amazin.one/ Alternative: https://ntrix.github.io/amazin-story
Stars: ✭ 27 (-37.21%)
Mutual labels:  cypress
octocov
octocov is a toolkit for collecting code metrics (code coverage, code to test ratio and test execution time).
Stars: ✭ 191 (+344.19%)
Mutual labels:  code-coverage
svelte-pwa-now
A PWA ready Svelte v3.0 starter template with Tailwind, Now integration and optional Typescript suppot
Stars: ✭ 138 (+220.93%)
Mutual labels:  cypress

cypress-example-todomvc-redux CircleCI renovate-app badge Coverage Status

TodoMVC example with full e2e test code coverage

This example is a fork of the official Redux TodoMVC example with a set of Cypress.io end-to-end tests. The tests run instrumented application code and the code coverage is saved automatically using cypress-istanbul plugin.

GitLab CI mirror

pipeline status coverage report

Deployed coverage report is at https://cypress-io.gitlab.io/cypress-example-todomvc-redux/, generated following this GitLab coverage guide.

Install and use

Because this project uses Parcel bundler to serve the web application, it requires Node v12+.

yarn
yarn test

The full code coverage HTML report will be saved in coverage. You can also see text summary by running

yarn report:coverage:text

How it works

Application is served by Parcel bundler that uses .babelrc file to load babel-plugin-istanbul plugin. This plugin instruments the application source code. During tests @cypress/code-coverage plugin merges and saves application code coverage information, rendering the full HTML report at the end.

Unit tests like cypress/integration/selectors-spec.js that reach into hard to test code paths are also instrumented using the same .babelrc file, and this additional code coverage is automatically added to the application code coverage.

.babelrc

To always instrument the code using Babel and babel-plugin-istanbul one can simply use the istanbul plugin

{
  "plugins": ["istanbul"]
}

But this will have instrumented code in the production bundle. To only instrument the code during tests, add the plugin to the test environment and serve with NODE_ENV=test

{
  "env": {
    "test": {
      "plugins": ["istanbul"]
    }
  }
}

Parceljs note: there are some issues with environment-specific plugins, see PR #2840.

More info

There are also separate blog posts

CircleCI

Code coverage is saved on CircleCI as a test artifact. You can view the full report there by clicking on the "Artifacts" tab and then on "index.html"

Code coverage artifact

The report is a static site, you can drill into each folder to see individual source files. This project should be 100% covered by Cypress tests:

100% code coverage

Warning

Full code coverage is not the guarantee of exceptional quality. For example, the application might NOT work on mobile viewport, while working perfectly on desktop with 100% code coverage. See cypress/integration/viewports-spec.js for how to test main user stories across several viewports.

Smoke tests

As an example, there is a reusable smoke test cypress/integration/smoke.js that goes through the most important parts of the app, covering 84% of the source code. This test can be reused from other tests, for example from cypress/integration/smoke-spec.js, that can be executed after deploy for example by using cypress.config.smoke.js config file

npx cypress run --config-file cypress.config.smoke.js

License

This project is licensed under the terms of the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].