Skip to content

gregfenton/example-cypress-react-selector-formik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of using cypress-react-selector with Formik

The goal of this project is to give an example of how to use cy.react() with a non-trivial but commonly used set of React components.

screen shot

Run this example

  1. git clone https://github.com/gregfenton/example-cypress-react-selector-formik.git
  2. cd example-cypress-react-selector-formik
  3. npm install
  4. In one console, run: npm start
  5. In another console, run: $(npm bin)/cypress open
  6. When the Cypress window opens, click to run the test form_spec.js

Understanding this example

There are two files in this example worth understanding:

  1. src/App.js contains the form displayed in the UI. This is essentially the entire application, with the rest of the files in src and public having been generated by CRA.
  2. cypress/integration/form_spec.js is the one test spec that uses cypress-react-selector to interact with React elements (Formik fields) and validates the result of submitting the form.

Dependencies

See package.json at the root of this project.

This project was bootstrapped with Create React App.

Releases

No releases published

Packages

No packages published