How to use RSpec Expectations in Page Object classes within Cucumber framework

First make sure you have already required ‘rspec’ in your env file:

require "rspec"
require "rspec/expectations"

Then all you have to do is include the RSpec::Matchers module in the class you want to use the RSpec Expectations:

include RSpec::Matchers
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.