The main objective of this repo to learn how to configure e2e and BDD test case using CodeCeptjs and cucumber with RubyonRails application.
Things you may want to cover:
-
Ruby version ruby-3.0.0
-
System dependencies
-
Configuration
bundle install
- Database creation
rake db:create & rake db:migrate
- How to run the test suite
yarn run test
- create a folder in root app directory named spec (if you already cover unit test then skip this step)
- create folder e2e inside spec folder
- then go to e2e directory cd spec/e2e
- then run npm init
- then yarn init
- run npm install -g codeceptjs-webdriverio
- run codeceptjs init
- run npm install -g puppeteer
- then update your codecept.conf.js file accordingly
- add feature test and run it.
mkdir bdd
better to keep this in seperate folder inside spec
- Use cd to go into that directory. If you want to, you can open the directory up in your favourite text exitor at this point.
cd bdd
-
First we’ll add Cucumber and RSpec-Expectations in Gemfile
-
Now go back to the command-line and run bundle install to install those gems.
bundle install
- Now we’re ready! If we run cucumber at this point , we’ll see it’s telling us to create a features directory.
bundle exec cucumber
-
No such file or directory - features. You can use
cucumber --initto get started. Good, we’ve installed Cucumber. -
As instructed, we can use the cucumber --init command to create the conventional folder structure for our Gherkin specifications and the code that will let Cucumber test them:
cucumber --init
- Now we’re ready to create our first feature file.
bundle exec cucumber
0 scenarios 0 steps 0m0.000s