September 2022
Intermediate to advanced
410 pages
10h 7m
English
Setting up Cypress involves two different steps. First, we need to install Cypress itself and then install the cypress-rails gem to help us integrate Cypress into our system.
Install Cypress as a package:
| | $ yarn add --dev cypress |
On the Rails side, we need to make sure we have two gems: the cypress-rails gem and the dotenv gem. The gems both go in the Gemfile in the development and test groups, they are already in place in the sample code:
| | group :development, :test do |
| | # <existing gems...> |
| | gem "cypress-rails" |
| | gem "dotenv-rails" |
| | end |
The cypress-rails gem uses environment variables to manage some settings, so to make our life a little easier, we’re going to use the dotenv gem. Do a bundle ...