返回排行榜

cypress-io/cypress-example-kitchensink

HTMLexample.cypress.io

This is an example app used to showcase Cypress.io testing.

cypressautomated-teststravis-cicircle-cie2e-testscypress-orb-example
Star 增长趋势
Star
1.2k
Forks
2.2k
周增长
Issues
22
5001k
2016年4月2019年9月2023年2月2026年7月
README

Kitchen Sink renovate-app badge semantic-release

This is an example app used to showcase Cypress.io End-to-End (E2E) testing. The application demonstrates the use of most Cypress API commands. Additionally this example app is configured to run E2E tests in various CI platforms. Several workflows demonstrate the CI use of Cypress Docker images which provide convenient, pre-configured compatible environments for Cypress. The tests are also heavily commented.

To see the kitchen sink application, and to view the Cypress API commands demonstrated by the app, visit example.cypress.io.

For a full reference of our documentation, go to docs.cypress.io.

For an example payment application demonstrating real-world usage of Cypress.io End-to-End (E2E) testing, go to the cypress-io/cypress-realworld-app repository.

CI Status

The following table lists live workflows from various CI providers. These each independently test the contents of this example repository. They run and record using Cypress Cloud with their results displaying centrally under Cypress Cloud ProjectId 4b7344. Each CI provider shows its build status on its own site:

CI Provider Workflow Build Status Docker example
CircleCI .circleci/config.yml CircleCI :white_check_mark:
cypress-io/github-action using-action.yml Cypress GHA status
GitHub Actions single.yml Single tests status
GitHub Actions parallel.yml Parallel tests status

You can find all CI results recorded on the Cypress Cloud Cypress Cloud

CI Workflow Examples

This table shows additional examples of CI workflows. With the exception of GitHub Actions workflows, these are not live examples as in the table above and they may require modification before use. The GitHub Actions workflows are live and they run without recording to Cypress Cloud.

CI Provider Basic Config Full Parallel Config Docker example
AWS Amplify amplify.yml
AWS CodeBuild basic/buildspec.yml buildspec.yml
Azure Pipelines basic/azure-ci.yml azure-ci.yml
Buddy.works buddy.yml :white_check_mark:
Buildkite .buildkite/pipeline.yml
CircleCI basic/.circleci/config.yml :white_check_mark:
GitHub Actions chrome.yml
GitHub Actions chrome-docker.yml :white_check_mark:
GitLab basic/.gitlab-ci.yml .gitlab-ci.yml :white_check_mark:
Jenkins basic/Jenkinsfile Jenkinsfile :white_check_mark:
Semaphore 2.0 basic/.semaphore.yml .semaphore/semaphore.yml
Travis CI basic/.travis.yml .travis.yml

The Cypress documentation page CI Provider Examples provides some more examples with extensive guides for using Cypress with some of the most popular CI providers.

Run Tests

Local testing

To run the tests from this repo on your local machine, first make sure your machine meets the Cypress System Requirements, including the installation of Node.js according to the version specified in the file .node-version.

Executing the following instructions will clone the repository, install dependencies and run Cypress:

git clone https://github.com/cypress-io/cypress-example-kitchensink.git
cd cypress-example-kitchensink
npm ci # install dependencies
npm run local:run # run Cypress headlessly

local:run is a package.json script that starts a local webserver and then uses cypress run to run Cypress headlessly. If you would like to run Cypress tests interactively, then run the following command which uses cypress open to run Cypress in headed mode. You can pick individual tests to run.

npm run local:open

As an alternative to using the local:open and local:run scripts, you can also start the server in one step and then run Cypress in a second step.

npm start # start server on port 8080

You can check that the server is running if you open a web browser and navigate to http://localhost:8080.

Then in a separate terminal window execute either

npx cypress run # for headless mode

or

npx cypress open # for headed interactive mode

Script and server structure

The scripts local:run and local:open use the start-test alias of the npm module start-server-and-test to run ./scripts/start.js, which starts the webserver, waits for it to become ready, and then launches Cypress.

The start script spawns a webserver using the npm module serve and displays the Kitchen Sink App on port 8080.

Docker testing

If you have Docker installed locally, for instance using Docker Desktop, you can run the tests from this repo interactively in a Docker container. Use Cypress Docker images, which are built with all the prerequisites for running Cypress. They are available as base, browsers and included options from Docker Hub and the Amazon ECR (Elastic Container Registry) Public Gallery.

As above, start by cloning the repo and installing dependencies:

git clone https://github.com/cypress-io/cypress-example-kitchensink
cd cypress-example-kitchensink
npm ci

NOTE: For simplicity, the Docker examples below use a repository reference such as cypress/base with the latest version tag. To select an earlier version, replace latest with an explicit tag, for example cypress/base:20.15.1. Explicit version tags are recommended for production. Usage is further explained in the Tags section of the Cypress Docker Images - README.

cypress/base

The following example uses a cypress/base image which itself contains no browsers. You will use the Electron browser bundled with Cypress instead. To run the Docker container, execute the following:

docker run -it --rm -v .:/app -w /app cypress/base:latest

When the container prompt appears, enter:

npx cypress install     # install Cypress binary
npm run test:ci         # start server and run tests in Electron browser
exit

cypress/browsers

With a cypress/browsers image you have the additional choice of Chrome, Edge and Firefox browsers. Execute the following:

docker run -it --rm -v .:/app -w /app cypress/browsers:latest

When the container prompt appears, enter:

npx cypress install     # install Cypress binary
npm run test:ci         # start server and run tests in Electron browser
npm run test:ci:chrome  # start server and run tests in Chrome browser
npm run test:ci:edge    # start server and run tests in Edge browser
npm run test:ci:firefox # start server and run tests in Firefox browser
exit

cypress/included

The cypress/included images add a full Cypress installation compared to cypress/browsers. Execute the following to run the container with a one-line command, testing with the Chrome browser:

docker run -it --rm -v .:/app -w /app --entrypoint bash cypress/included:latest -c 'npm run test:ci:chrome' # use for matching Cypress versions

Replace the latest tag in the above command using the Cypress version from the repo's package.json, if this repository has not yet been updated to the latest released Cypress version. Note that mismatched versions will cause errors.

NOTE: Additional browsers Chrome, Edge and Firefox are installed in linux/amd64 architecture images cypress/browsers and cypress/included. Firefox is available pre-installed for linux/arm64 architecture images based on Firefox >=136.0.2. Refer to the Cypress Docker images README for details. The Electron browser, which is built-in to Cypress, is available in all images and architectures.

CI Testing

If you would like to try out running tests in a Continuous Integration (CI) provider then you need to first fork the repository so that you have your own copy. Refer to the GitHub documentation to set up aliases for remote upstream (to this repo) and remote origin (to your fork) correctly. You will also need to have an account with the CI provider you want to test with.

Documentation

Support

  • For "how-to" questions and discussions, go to the Cypress Discord Chat and be part of the worldwide user community!

Contributing

Check out the Contributing Guideline.

Changelog

See Releases.

相关仓库
cypress-io/cypress

Fast, easy and reliable testing for anything that runs in a browser.

TypeScriptnpmMIT Licensecypressend-to-end-testing
cypress.io
50.6k3.5k
nrwl/nx

The Monorepo Platform that amplifies both developers and AI agents. Nx optimizes your builds, scales your CI, and fixes failed PRs automatically. Ship in half the time.

TypeScriptnpmMIT Licensenxangular
nx.dev
29.1k2.8k
cypress-io/cypress-realworld-app

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

TypeScriptnpmMIT Licensecypresstesting
docs.cypress.io
5.9k2.6k
cypress-io/cypress-example-recipes

Various recipes for testing common scenarios with Cypress

JavaScriptnpmtestingexamples
on.cypress.io/examples
3.5k1.3k
vuesion/vuesion

Vuesion is a boilerplate that empowers product teams to build faster with modern best practices across engineering and design. It features a full-stack framework, comprehensive design system, robust testing, and seamless internationalization.

VueMIT Licenseseoi18n
vuesion.herokuapp.com
2.9k384
sorry-cypress/sorry-cypress

Open-source, free, self-hosted alternative to Cypress Dashboard

TypeScriptnpmMIT Licensecypressparallelization
sorry-cypress.dev
2.8k289
NoriSte/ui-testing-best-practices

The largest UI testing best practices list (last update: March 2025)

Creative Commons Attribution Share Alike 4.0 Internationalui-testinge2e-testing
1.7k164
cypress-io/github-action

GitHub Action for running Cypress end-to-end & component tests

JavaScriptnpmMIT Licensegithub-actionsactions
on.cypress.io/guides/continuous-integration/github-actions
1.5k356
skillrecordings/egghead-next

The frontend for egghead.io.

TypeScriptnpmOthereggheadnextjs
egghead.io
1.4k195
UnlyEd/next-right-now

Flexible production-grade boilerplate with Next.js 11, Vercel and TypeScript. Includes multiple opt-in presets using Storybook, Airtable, GraphQL, Analytics, CSS-in-JS, Monitoring, End-to-end testing, Internationalization, CI/CD and SaaS B2B multi single-tenancy (monorepo) support

HTMLMIT Licensetypescripttypescript-boilerplate
unlyed.github.io/next-right-now/
1.3k107
TowhidKashem/snapchat-clone

👻 A Snapchat clone built with React and Redux. Written in Typescript. Styled with SASS. Tested with Cypress, Jest and Enzyme. Linted with Eslint and formatted with Prettier!

TypeScriptnpmMIT Licensereactredux
towhidkashem.github.io/snapchat-clone/
1.1k1
rusefi/rusefi

rusefi - GPL internal combustion engine control unit

COtherstm32f4gpl
rusefi.com
1.1k396