cucumber

Cucumber: Before hook run only once for all scenarios

纵饮孤独 提交于 2019-12-12 10:33:52
问题 I have a scenario outline with multiple scenarios. I'd like my Before hook to run only once so I can bootstrap the ActiveRecord objects I need to run against all of the scenarios. The problem is if I use Before do # my code here end This will execute before each Scenario. Is there anyway to run it once for the entire Outline? 回答1: I think if you simply create the objects in a file in features/support they will be persisted: ImportantThing.create(:name => "USEFUL THING") This is because before

InitializationError while running Cucumber JUnit Tests

巧了我就是萌 提交于 2019-12-12 10:20:53
问题 package cucumber; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( format={"pretty"}, features= "src/features/" ) public class cucumberRunner { } Using: cucumber-core-1.2.4 cucumber-java-1.2.4 cucumber-junit-1.2.4 junit-4.12 Eclipse Mars.1 java 8 Error Trace: java.lang.NoClassDefFoundError: org/dom4j/Element at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class

How to get code coverage of javascript using cucumber?

家住魔仙堡 提交于 2019-12-12 09:07:11
问题 I am using gem ' Simplecov ' to generate the code coverage for ruby(.rb file) using cucumber but my UI code is in JavaScript . How i get the code coverage of Javascript using Cucumber? Is there any gem or tool available to get the code coverage of Javascript? Please give comments on that issue. 来源: https://stackoverflow.com/questions/23538879/how-to-get-code-coverage-of-javascript-using-cucumber

When should I test Views separately in Cucumber & RSpec workflow?

…衆ロ難τιáo~ 提交于 2019-12-12 08:42:18
问题 After some time of doing Cucumber & RSpec BDD, I realized that many of my Cucumber features are just higher level view tests. When I start writing my scenario and then go down to RSpec, I don't ever write view specs, since I could just copy and paste part of the scenario, which would be ugly dupliacation. Take this scenario for example Scenario: New user comes to the site Given I am not signed in When I go to the home page Then I should see "Sign up free" I know that this isn't directly

ruby-debug and cucumber

拈花ヽ惹草 提交于 2019-12-12 08:01:39
问题 I have a failing scenario in cucumber, and I'd like to debug my rails controller using ruby-debug. But if I add 'debugger' to the point where I want to break, it doesn't stop. I tried adding require of ruby-debug and rubygems to the features/support/env.rb but then it says to me that it can't load ruby-debug, although ruby-debug is on the gem list and I can load it in irb. So... what should I do to get it working? Thanks! 回答1: i had this same problem today, and i got it figured out. here's my

rake cucumber and rake spec always use “develop” environment

家住魔仙堡 提交于 2019-12-12 07:50:01
问题 My rake tasks for running Cucumber and RSpec tests are always using my development environment. Here are the relevant config files: RAILS_ROOT/config/environments/cucumber.rb # Edit at your own peril - it's recommended to regenerate this file # in the future when you upgrade to a newer version of Cucumber. # IMPORTANT: Setting config.cache_classes to false is known to # break Cucumber's use_transactional_fixtures method. # For more information see https://rspec.lighthouseapp.com/projects

Rails3 form_for hidden_field undefined method 'merge'

穿精又带淫゛_ 提交于 2019-12-12 07:47:39
问题 My attempt to place a hidden_field within a form_for is crashing within cucumber on an ActionView helper error. Something also about FixNum which escapes me since I haven't dug through the source code. My prices_controller shows this: @price = Price.new @commodity = Commodity.find(params[:id]) I want to make the link between price and commodity with this hidden_field: <%= form_for (@price), :url => prices_path do |f| %> <% f.hidden_field :commodity_id, @commodity.id %> . . <div class="actions

How to select current date+1 from date picker popup, without using sendkeys

怎甘沉沦 提交于 2019-12-12 07:04:41
问题 Using selenium web-driver Java, I want to select current date+1 from date popup, I have seen other post related to date picker but they are related to current date only or else using sendkeys. I don't want to use sendkeys. Below is the HTML code '<table id="dp_cal_calendar" class="calendar" classname="calendar" style="display: block; position: absolute; top: 282px; left: 574px;"> <tbody> <tr> <tr> <td> <table class="cells" classname="cells"> <thead class="caldayheading" classname=

Cannot instantiate test steps class

时光总嘲笑我的痴心妄想 提交于 2019-12-12 07:04:33
问题 I have following jar files added to my project : gherkin 2.12 cucumber-junit 1.2.5 cucumber-java 1.2.5 cucumber core 1.2.5 cucumber jvm-deps 1.0.5 cobetura 2.1.1 mockito all 1.9.1 cucumber-reporting 3.13 I am getting an error when I try to run test runner class: cucumber.runtime.CucumberException: Failed to instantiate class stepDefinition.Test_steps Test Runner Class : package CucumberTest; import org.junit.runner.RunWith; import cucumber.api.junit.Cucumber; import cucumber.api

Cucumber Eclipse - Resolving warning: Cucumber-JVM's --format option is deprecated. Please use --plugin instead

感情迁移 提交于 2019-12-12 06:35:36
问题 Running Cucumber with Eclipse and getting the following warning: Cucumber-JVM's --format option is deprecated. Please use --plugin instead Tried to use Eclipse search functionality to search for "--format" and "format" but unable to find the relevant file I need to change. Any ideas? 回答1: In cucumber-java/src/org/jetbrains/plugins/cucumber/java/run/CucumberJavaRunConfigurationProducer.java change public static final String FORMATTER_OPTIONS = " --format org.jetbrains.plugins.cucumber.java.run