Cucumber Capybara scroll to bottom of page
You could use javascript to achieve this: page.execute_script “window.scrollBy(0,10000)”
You could use javascript to achieve this: page.execute_script “window.scrollBy(0,10000)”
Good question, one I’ve grappled with recently while working on a Rails app, also using Cucumber/RSpec. I try to test as much as possible at every level, however, I’ve also found that as the codebase grows, I sometimes feel I’m repeating myself needlessly. Using “Outside-in” testing, my process usually goes something like: Cucumber Scenario -> … Read more
Here is a non-developer tool. We had a similar requirement and I wanted to have a stab at creating a Chrome extension. It’s free and there are no ads. Above all it is cross-platform and requires no technical knowledge to install and run. https://chrome.google.com/webstore/detail/tidy-gherkin/nobemmencanophcnicjhfhnjiimegjeo I know this is an old post, but I came across … Read more
Yes, we can write a gherkin step on multiple lines using triple set of double quotes (“””). Gherkin recognizes the triple set of double quotes as the bounding delimiters for the multi-line string and passes it in. Whatever content you write between triple set of double quotes will be passed to your step definition as … Read more
(I might be biased because I am involved with SpecFlow, but here my thoughts…) Cuke4Nuke is very close to Cucumber. This promises a lot of advantages: Compatibility Getting new features from Cucumber when Cucumber evolves (at least in theory, but language support is an example for this) Being a real part of the Cucumber community … Read more
Bah. I can’t believe I didn’t find this earlier. You CAN escape a pipe with the backslash, but the specflow syntax highlighter gets confused by it. Then the data should be | Field | Value | | SomeField | a\|b\|c |
Use the checked? method e.g.: my_box = find(‘#some_checkbox’) my_box.should be_checked # Before Rspec 2.11 # OR using new syntax expect(my_box).to be_checked # Rspec 2.11
Even though have_css? will do the trick, your tests should tell you how they failed, rather than just saying some condition was supposed to be true and it was false. With this in mind, the first example below reads much better than the second: # IF FAILED => “expected 10, got 7” page.all(‘table#myTable tr’).count.should == … Read more
According to Cucumber.io there are 2 styles in which a tag expression can be defined. For your specific case, to exclude steps or features marked with @ignore, these 2 styles translate into: old style : cucumber –tags ~@ignore new style : cucumber –tags “not @ignore”. To my surprise, using the same cucumber-js v1.3.1 running on … Read more
Declaritive is the proper way, IMO. If youre talking about page .aspx file names, you’re doing it wrong. The purpose of the story is to facilitate communication between developers and non-develoeprs. Non-developers don’t care about products.aspx, they care about a product listing. Your system does something the non-developers find value in. This is what you’re … Read more