System Specs

Background

"System tests" are the new replacement for "feature specs" in modern Rails apps. Also, the new driver Ferrum-Cuprite driver does a similar job to Selenium, but it's radically faster and the tests are way more stable (less flaky specs). See also relevant thread on Slack.

Migration from Feature specs into System specs

This is a task which is in progress here. The process involves these steps (mentioned on this page) :

  • move spec files from spec/features to into spec/system

  • replace require "spec_helper"with require "system_helper"

  • Use RSpec.describe to define system specs, instead of RSpec.feature

  • Replace the scenario alias in previous feature specs with the standard it syntax (this appears to be optional)

Additionally, other changes may be required. For example:

  • some helper methods were created considered Selenium; these won't work now and need to be adapted to Ferrum

  • some syntax might not work under system specs, for example background do blocks need to be replaced with before do .

  • the syntax for manipulating cookies with Ferrum is found here; see also this commit.

  • other issues will certainly come up and will be added here

References

Last updated