Installing Cypress
Explore the process of installing Cypress to enable comprehensive integration testing in Rails applications. This lesson guides you through adding Cypress and Cypress-Rails gems, initializing Cypress, running tests both via UI and command line, and integrating Cypress with ESLint for a streamlined testing workflow.
We'll cover the following...
We'll cover the following...
Setting up Cypress involves two different steps. First we need to install Cypress itself. Then, we need to install the Cypress-Rails gem to help us integrate Cypress into our system.
First, install Cypress as a package:
$ yarn add --dev cypress
Now we need to add two gems: the Cypress-Rails gem and the dotenv gem. The gems both go in the Gemfile in the development and test groups:
group :development, :test do
# <existing gems...>
gem "cypress-rails"
gem "dotenv-rails"
end
...