Coder Social home page Coder Social logo

jjy05 / cypress-realworld-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cypress-io/cypress-realworld-app

0.0 1.0 0.0 6.67 MB

A payment application to demonstrate real-world usage of Cypress testing methods, patterns, and workflows.

Home Page: https://docs.cypress.io

License: MIT License

TypeScript 99.35% HTML 0.48% JavaScript 0.08% Shell 0.08%

cypress-realworld-app's Introduction

Cypress Real World App Logo

Cypress Logo

A payment application to demonstrate real-world usage of Cypress testing methods, patterns, and workflows.

Cypress Real World App

๐Ÿ’ฌ Note from maintainers

This application is purely for demonstration and educational purposes. Its setup and configuration resemble typical real-world applications, but it's not a full-fledge production system. Use this app to learn, experiment, tinker, and practice application testing with Cypress.

Happy Testing


Features

๐Ÿ›  Built with React, XState, Express, lowdb, Material-UI and TypeScript
โšก๏ธ Zero database dependencies
๐Ÿš€ Full-stack Express/React application with real-world features and tests
๐Ÿ‘ฎโ€โ™‚๏ธ Local Authentication
๐Ÿ”ฅ Database Seeding with End-to-end Tests
๐Ÿ’ป CI/CD + Cypress Dashboard

Getting Started

The Cypress Real-World App (RWA) is a full-stack Express/React application backed by a local JSON database (lowdb).

The app is bundled with example data (data/database.json) that contains everything you need to start using the app and run tests out-of-the-box.

๐Ÿšฉ Note

You can login to the app with any of the example app users. The default password for all users is s3cret.
Example users can be seen by running yarn list:dev:users.

Prerequisites

The only requirement for this project is to have Node.js version 12 installed on your machine. Refer to the .node-version file for the exact version.

TypeScript will be added as a local dependency to the project, so no need to install it.

Installation

yarn install

Run the app

yarn dev

Start Cypress

yarn cypress:open

Tests

Type Location
api cypress/tests/api
ui cypress/tests/ui
unit src/__tests__

Database

Additional NPM Scripts

Script Description
dev Starts backend in watch mode and frontend
start Starts backend and frontend
types Validates types
db:seed Generates fresh database seeds for json files in /data
start:empty Starts backend, frontend and Cypress with empty database seed
tsnode Customized ts-node command to get around react-scripts restrictions
list:dev:users Provides id and username for users in the dev database

For a complete list of scripts see package.json

Code Coverage Report

The Cypress Real-World App uses the @cypress/code-coverage plugin to generate code coverage reports for the app frontend and backend.

To generate a code coverage report:

  1. Run yarn cypress:run --env coverage=true and wait for the test run to complete.
  2. Once the test run is complete, you can view the report at coverage/index.html.

License

license

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

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Kevin Old

Amir Rustamzadeh

Brian Mann

Gleb Bahmutov

Ben Hong

David Khourshid

This project follows the all-contributors specification. Contributions of any kind welcome!

cypress-realworld-app's People

Contributors

allcontributors[bot] avatar amirrustam avatar bahmutov avatar cypresspentester avatar dandv avatar dvdvdmt avatar filiphric avatar kevinold avatar kuceb avatar ogelacinyc avatar oppahansi avatar renovate-bot avatar renovate[bot] avatar ryota-murakami avatar wlsf82 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.