cucumber

How to implement different data for cucumber scenarios based on environment

江枫思渺然 提交于 2019-12-12 12:52:24
问题 I have an issue with executing the cucumber-jvm scenarios in different environments. Data that is incorporated in the feature files for scenarios belongs to one environment. To execute the scenarios in different environemnts, I need to update the data in the features files as per the environment to be executed. for example, in the following scenario, i have the search criteria included in the feature file. search criteria is valid for lets say QA env. Scenario: search user with valid criteria

java.lang.NoSuchMethodError: cucumber.runtime.RuntimeOptions.getJunitOptions()Ljava/util/List;

谁说胖子不能爱 提交于 2019-12-12 12:25:39
问题 I am trying to run a simple cucumber feature test. Below is my junit runner file &POM.xml file. When I try to run feature file individually, it runs and doesn't throw error. But when run using runner file, i get the below mentioned error : java.lang.NoSuchMethodError: cucumber.runtime.RuntimeOptions.getJunitOptions()Ljava/util/List; at cucumber.api.junit.Cucumber.<init>(Cucumber.java:61) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base

How to run scenarios in Cucumber-JVM in parallel? [duplicate]

本秂侑毒 提交于 2019-12-12 12:08:41
问题 This question already has answers here : How to execute cucumber feature file parallel (4 answers) Closed 2 years ago . I have a set of acceptance tests written for the Cucumber-JVM. In order to reduce the feedback time I would like to run the scenarios (of a feature) in parallel. How do I do that in the simplest and most convenient way? (I would prefer to be able to express this in Java code, as a regular JUnit test/runner, i.e. I would prefer not to resort to some workaround using the maven

How do I use ruby-debug in Capybara w/ selenium

旧城冷巷雨未停 提交于 2019-12-12 11:24:33
问题 We have Capybara working with the selenium driver but when I try to use 'debugger' inside a step it doesn't quite work. e.g. in the debug console entering 'page' works but entering 'page.body' hangs. We also had weirdness when trying to use debugger with the akephalos driver. With akephalos we couldn't type in the debug prompt... well actually we could but you had to hit the key several times before a letter would randomly show up in the terminal. Doing a 'Ctrl-C' let us type but we got

cucumber Couldn't load 2.1/gherkin_lexer_en

心不动则不痛 提交于 2019-12-12 11:20:36
问题 I am getting the following error whenever i run cucumber feature. However, the script works fine but this warning message appears everytime i execute the feature file. What is wrong here? C:\Automation\PickLists\Activities\2.RemoveActivity>cucumber WARNING: cannot load such file -- 2.1/gherkin_lexer_en Couldn't load 2.1/gherkin_lexer_en The $LOAD_PATH was: lib C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/cucumber-1.3.18/bin/../lib C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/builder-3.2.2/lib C:/Ruby21

Best practice to keep common steps of cucumber

无人久伴 提交于 2019-12-12 11:05:20
问题 I'm using cucumber-watir-webdriver with for automation purposes. I have the following directory structure: |features -|feature1 --|1.feature --|step_definitions ---|1.rb -feature2 --|2.feature --|step_definitions ---|2.rb and so on. I need to know what is best practice to reduce redundancy in 1.rb and 2.rb . feature1 and feature2 are completely different so I cannot combine both in one directory. Also there is some part where feature line is same but execution in steps is different so it will

How to test JavaScripts without to delete the `test` database data?

扶醉桌前 提交于 2019-12-12 11:01:04
问题 I am using Ruby on Rails 3.2.2, cucumber-rails-1.3.0, rspec-rails-2.8.1 and capybara-1.1.2. I would like to use Selenium in order to test JavaScripts, but without to delete the test database data each time I run the cucumber command line in my Terminal window. That is, if I state a feature like the following: Feature: ... @javascript Scenario: ... JavaScript is tested as well as expected. However, after the test has run, the test database data is deleted and I must seed again that database in

Run Cucumber test with Mockito

泄露秘密 提交于 2019-12-12 10:59:39
问题 I'm trying to run a JUnit Cucumber test that uses Mockito. Here's the issue I'm running into. In my Cucumber Runner class, I have @RunWith(Cucumber.class) And in my regular JUnit tests I have @RunWith(Mockito.class) Given that I can only have one @RunWith at a time, how can I use Mockito in conjunction with Cucumber? 回答1: Yes, you can use Cucumber and Mockito at the same time. You can't use two JUnit runners at the same time. But if you add Mockito as a dependency to your project and create

How to save Cucumber test results to a file

亡梦爱人 提交于 2019-12-12 10:49:10
问题 I have some Cucumber tests that can be run from console with rake cucumber Is there a command line option to store test results to a text file? 回答1: Either Run cucumber directly and use -o . From cucumber --help : -o, --out [FILE|DIR] Write output to a file/directory instead of STDOUT. This option applies to the previously specified --format, or the default format if no format is specified. Check the specific formatter's docs to see whether to pass a file or a dir. Run rake with CUCUMBER_OPTS

Global BeforeAll Hook for cucumber-jvm?

天涯浪子 提交于 2019-12-12 10:44:08
问题 The ruby version of cucumber supports a global before hook. An *.rb file placed in the features/support directory gets apparently called only once, before any and all scenarios run. See https://github.com/cucumber/cucumber/wiki/Hooks#global-hooks That seems to be a great way to make sure a database (used in read-only during tests) gets populated (and thus is in a known state) before any tests run. Is there a similar feature available for the Java version of cucumber? 回答1: Please follow this