gregfenton / example-cypress-react-selector-formik

An example of using cypress-react-selector

Home Page:https://github.com/abhinaba-ghosh/cypress-react-selector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

An example of using cypress-react-selector

https://github.com/abhinaba-ghosh/cypress-react-selector


Languages

Language:JavaScript 80.8%Language:HTML 15.9%Language:CSS 3.4%