Tecno Android Phones, Samsung Imei Repair, Huawei Mediapad, Official Firmware/ Flash File, WiFi, Alcatel One, Flash Tool Windows, Android Jelly Bean

Using Capybara and RSpec assertions in Page Objects

Using Capybara and RSpec assertions in Page Objects - we say welcome to the blog Tecno Android Phones we provide a lot of latest gadget information that must be very dear for you to miss, now we will discuss first about Using Capybara and RSpec assertions in Page Objects we have collected a lot of information to make this article to complete for you, Please read:

Articles : Using Capybara and RSpec assertions in Page Objects
full Link : Using Capybara and RSpec assertions in Page Objects

You can also see our article on:


Using Capybara and RSpec assertions in Page Objects

On my Rails project, I am using RSpec and Capybara to write functional tests.  I did not want to specify any HTML elements in my Capybara feature files, since that makes the feature files brittle to HTML / CSS changes. It also violates the DRY principle and basic code hygiene.

So, I decided to refactor out my HTML centric Capybara code into separate Page Objects. If you are unfamiliar with Page Objects, then read the following:



The Page Object pattern for encapsulating HTML centric DSL is a common pattern followed while writing UI level functional tests in ThoughtWorks.

The problem I was facing when I refactored my code into Page objects was that I was unable to use the RSpec 'expect' syntax in Page Objects. Turns out all I had to do in my page objects was:

include RSpec::Matchers

Here is the full code from my project on Github.
https://github.com/gsluthra/dakshina/tree/master/spec/features

The appropriate feature files and page objects in a GIST:
https://gist.github.com/gsluthra/8356015



Articles about Using Capybara and RSpec assertions in Page Objects finished discussed

We think it is enough information about Using Capybara and RSpec assertions in Page Objects, hopefully the information we give can give benefit for you,

If you feel the information Using Capybara and RSpec assertions in Page Objects that we provide can provide benefits for others please share with link https://southernmatron.blogspot.com/2014/01/using-capybara-and-rspec-assertions-in.html thank you for visiting our blog page and do not forget to visit other pages.

Tag :
Share on Facebook
Share on Twitter
Share on Google+
Tags :

Related : Using Capybara and RSpec assertions in Page Objects

0 komentar:

Post a Comment