Skip to content

mtlynch/hello-world-cypress

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
e2e
 
 
 
 
 
 
 
 
 
 

hello-world-cypress

Overview

This repo shows a basic example of using Cypress and Docker Compose to create simple end-to-end tests for any web application. This example uses a Go application, but you can reuse the pattern in this repository for any web application that can run in Docker.

For more information, see the blog post, "Easy End-to-End Testing with Cypress."

Run the test app

The example application is called Sentimentalyzer, a very rudimentary text sentiment analyzer. To run it, enter the following commands:

docker build --tag sentimentalyzer .
docker run \
  --interactive \
  --tty \
  --env PORT=8123 \
  --publish 8123:8123 \
  sentimentalyzer

The app will be running on localhost:8123.

Run end-to-end tests

To execute the end-to-end tests for Sentimentalyzer, enter the following commands:

cd e2e
docker-compose up --abort-on-container-exit --exit-code-from cypress

When the command completes, you will see test output on the console and a video of the test run will appear in the folder e2e/cypress/integration/videos.

Other branches

This repo contains several branches to demonstrate different Cypress scenarios:

Scenario Branch
Basic Cypress example master
Using Cypress with Chrome browser chrome
Running Cypress from within Circle CI circle
Running Cypress from within Travis CI travis
Running Cypress in interactive mode interactive

About

A simple example of using Cypress.io for end-to-end testing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published