Questions tagged [cucumber]

Cucumber is a Behavior Driven Development (BDD) tool that executes functional descriptions written in plain text (structured in the simple Gherkin language) as automated tests.

Cucumber is a Behavior Driven Development (BDD) tool.

It lets software development teams describe how software should behave in plain text structured in the simple Gherkin language. The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid - all rolled into one format.

Cucumber works with Ruby, Java, .NET, Flex or web applications written in any language. It has been translated to over 30 spoken languages.

Cucumber supports over a dozen different software platforms. Every Cucumber implementation provides the same overall functionality, but they also have their own installation procedure and platform-specific functionality.

References:

Related tags:

10965 questions
25
votes
7 answers

How to learn/teach Gherkin for Cucumber

I'd like to enable the business analysts to be able to write all of their specs for features, scenarios and steps that is Cucumber friendly using Gherkin. I've read some of the basic info on the github site for Cucumber and from doing a quick Google…
Satchel
  • 16,414
  • 23
  • 106
  • 192
25
votes
8 answers

REST API test cucumber steps best practice

Trying to write up cucumber feature steps for REST API test. I am not sure which approach is better: Given I log in with username and password When I add one "tv" into my cart And I check my cart Then I should see the item "tv" is in my…
ccy
  • 1,385
  • 6
  • 17
  • 27
25
votes
1 answer

How to test for same feature with multiple backgrounds in cucumber

I've got a feature (a .feature file) that are working fine in cucumber. The background of all the scenarios in the feature just sets up a user, and then logs in as a supervisor, e.g. Background: Given I am logged in as a supervisor with an…
Tim Diggins
  • 4,364
  • 3
  • 30
  • 49
24
votes
5 answers

ruby 1.9.2 strange warning when running cucumber specs

I just updated to try rails 3, using rvm with ruby 1.9.2-p0. When I run my cucumber specs then I get following strange warnings /home/ubuntu/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/utils.rb:16: warning: regexp match /.../n against to UTF-8…
server info
  • 1,335
  • 1
  • 14
  • 24
23
votes
9 answers

How do I set the path to my Cucumber features using cucumber-junit?

I try to build my first executable specifications with Java and Maven. I created a simple project with this structure: specification |-src |-test |-java |-mypackage |-MyFeatureTest.java |-resources …
cringe
  • 13,401
  • 15
  • 69
  • 102
23
votes
5 answers

How to make Capybara do a DELETE request in a Cucumber feature?

I am using Cucumber and Capybara. I need to make an HTTP DELETE request. Previously the features used webrat, so a simple statement like visit "/comment/" + comment_id, :delete worked, but now I am using Capybara. The way to do a GET request is…
umar
  • 4,309
  • 9
  • 34
  • 47
23
votes
8 answers

Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: java.base doesn't "opens java.util" to unnamed module

I have created a Cucumber feature file and steps file, then I have clicked "Run configurations" for feature file and I see the following in the console. How can I solve this problem? *Feature: Login into account Existing user should be able to…
23
votes
8 answers

How do I find an image on a page with Cucumber / Capybara in Rails 3

I am using Cucumber / Capybara with Rails 3 and am trying to validate the existence of an image after upload. I'm not sure how to check the url of the image to validate it. I have the following scenario: Scenario: Create new listing Given I am…
Jamis Charles
  • 5,827
  • 8
  • 32
  • 42
23
votes
2 answers

Cucumber not showing coloured output in windows

this is probably something really stupid but I can't work it out. I upgraded my version of cucumber to v 0.10.0 and now the test's (running on Win 7) are not showing coloured output with the "pretty" formatter. When tests are run it prints this…
James Hollingworth
  • 14,040
  • 12
  • 39
  • 57
23
votes
3 answers

Running Cucumber tests directly from executable jar

I have a project with cucumber and maven also I am using the JUnit. I am able to run and build my project successfully from Eclipse. Now I want to run the test from command line in another system which does(should) not have eclipse or cucumber…
Arpan Buch
  • 1,380
  • 5
  • 19
  • 41
23
votes
12 answers

Cucumber, capybara and selenium - Submitting a form without a button

I have a test using Cucumber, capybara and selenium driver. This test should go to a form and submit it. The normal text would be Scenario: Fill form Given I am on the Form page When I fill in "field1" with "value1" And I fill in…
Daniel Cukier
  • 11,502
  • 15
  • 68
  • 123
23
votes
5 answers

Cucumber/Capybara: check that a page does NOT have content?

Using Cucumber and Capybara, is there a way to verify that a string is NOT present on a page? For example, how would I write the opposite of this step: Then /^I should see "(.*?)"$/ do |arg1| page.should have_content(arg1) end This passes if arg1…
dB'
  • 7,838
  • 15
  • 58
  • 101
22
votes
2 answers

Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called

What does this env.rb error mean, pls? root# rake db:migrate WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called. To avoid this warning, move 'gem cucumber-rails' under only group :test…
Alpha01
  • 838
  • 6
  • 13
22
votes
1 answer

cucumber and capybara, how to open external url or visit outside url

i am using cucumber and capybara. in a rails 3.0.9 platform. i am getting this test case fail: log is: (::) failed steps (::) No route matches "/wiki/Baltimore_Ravens" (ActionController::RoutingError) :10:in…
Bilal Basharat
  • 3,066
  • 6
  • 21
  • 20
22
votes
3 answers

How to use common/shared "blocks" between cucumber features?

I'm new to cucumber, but enjoying it. I'm currently writing some Frank tests, and would like to reuse blocks of cucumber script across multiple features - I'd like to do this a the cucumber level if possible (not inside the ruby). For example, I…
Stuart
  • 66,722
  • 7
  • 114
  • 165