cucumber

qaf-cucumber - can not reference data from CSV data provider in BDD2 scenario outline

北城余情 提交于 2019-12-13 02:55:49
问题 Context I want to use qaf-cucumber to take advantage of QAF features while still using Cucumber with JUnit . Mainly, I need QAF for its data provider feature, allowing to externalize scenario examples in .csv in order to use them across several scenarios and features. Junit : 4.12 Cucumber : 5.0.0-RC2 QAF : 2.1.15 qaf-cucumber : 2.1.15-beta-3 (most recent version, as there is no release yet) Problem When using the QAF tag @dataFile above a scenario to specify the location of the .csv: I get

How can I optionally mock geocoder?

China☆狼群 提交于 2019-12-13 02:23:35
问题 I'd like to be able to mock the results of the geocoder gem in some of my tests. I use RSpec and Cucumber. In cucumber I'd like to default to mocking the Geocoder results, but be able to turn it back on again by adding a tag. That would be perfect! Something similar for RSpec would be good too. It would speed up my tests enormously. I know there are some gems out there for doing similar things, e.g. sunspot_test for sunspot. Is there anything similar for geocoder? 回答1: Im using vcr gem for

how can I get a quick count of the number of scenarios and steps in a large cucumber suite without running every test?

天大地大妈咪最大 提交于 2019-12-13 02:22:27
问题 I've tried cucumber --dry-run , but it only seems to work on a per feature file basis. 回答1: cucumber --dry-run will include the count of scenarios and steps for all features run. For example, Given two feature files: test.feature: Feature: 1 Scenario: 1a Given step 1 Given step 2 Scenario: 1b Given step 1 Given step 2 test2.feature: Feature: 2 Scenario: 2 Given step 1 When cucumber --dry-run is run, the results show: 3 scenarios (3 skipped) 5 steps (5 skipped) As you can see, the scenario and

Cucumber and custom RSpec matchers

☆樱花仙子☆ 提交于 2019-12-13 01:34:26
问题 I'm trying to write a custom RSpec matcher for cucumber. I require cucumber/rails/rspec in env.rb, but I still get "uninitialized constant Spec::Matchers" error. I'm using latest versions of Rspec, Cucumber and CucumberRails. What am I missing? P.S. Same matcher works fine with pure RSpec... 回答1: Are you using RSpec 2? The correct constant is now RSpec::Matchers for that. Defined in rspec/matchers . If you're not, then perhaps you haven't required spec/matchers which defines the Spec:

How to execute same cucumber feature or scenario n times?

天大地大妈咪最大 提交于 2019-12-13 01:28:57
问题 I need to execute one scenario which is part of one feature 100 times. There is no scenario outline as there is no data parameterization. I just need to perform gorilla testing on this particular scenario so as to make sure it passes every single time without any fail. Some of my team members observed failure a couple of times, so need to validate the stability. Runner class code: public class Baserunner extends AbstractTestNGCucumberTests{ private TestNGCucumberRunner testNGCucumberRunner;

how to run cucumber test using command line

邮差的信 提交于 2019-12-13 01:28:25
问题 I have test cases written in cucumber with java. I am using IDE IntelliJ. I can run from IDE UI by simply right click a feature file. but now the requirement is I need to run tests in jenkins using command line. explore maven option but has another issue with authentication. is there any other way to directly run cucumber features through command line? 回答1: See the JUnit section here: https://cukes.info/running.html Create the empty class as described and then run the empty class as a junit

Creating dynamic cucumber_steps to check for links on a page

不打扰是莪最后的温柔 提交于 2019-12-13 00:51:56
问题 Basically I want the scenario outline to loop through all of the various combinations so that I don't have to write a bunch of scenarios. I want to have it visit the starting page and then check to see if the links are there however I've hit a barrier. Cucumber feature Scenario Outline: As a user I need links in order to navigate the site Given I am a '<user>' When I am at the <page> page Then I should see a link to '<link>' Scenarios: As a user that is not logged in | user | page | link | |

programatically set Spring profile in Cucumber

亡梦爱人 提交于 2019-12-12 22:24:57
问题 I have begun to use cucumber tests for my Spring application. I set active Spring profile by passing jvm argument spring.profiles.active=testProfile. Is there any way to do this programatically? Something like: @RunWith(Cucumber.class) @Cucumber.Options(...) @ActiveProfiles("testProfile") public class MyCucumberTest Using cucumber 1.1.6 回答1: I'm not sure this is the proper way to do it, but at least it get it working for me. I'm using cucumber version 1.2.4 I specialized the Cucumber junit

Where to cleanup cloudinary file uploads after rspec/cucumber run

一个人想着一个人 提交于 2019-12-12 21:17:22
问题 I use fixture_file_upload in my FactoryGirl methods to test file uploads. Problem is that after cleaning the database, all these uploaded files remain on Cloudinary . I've been using Cloudinary::Api.delete_resources using a rake task to get rid of them, but I'd rather immediately clean them up before DatabaseCleaner removes all related public id's. Where should I interfere with DatabaseCleaner as to remove these files from Cloudinary ? 回答1: Based on @phoet's input, and given the fact that

Jenkins build fails after running Cucumber tests on Java heap space exception

萝らか妹 提交于 2019-12-12 20:31:22
问题 I get following exception when building using Jenkins. This exception raises after running Cucumber tests. Can anyone tell the exact spot that fails on the java heap space? Do you have any idea what can be done in order to solve it? Some background: I had a java heap space during the Cucumber tests, after I increased the memory, Cucumber tests pass, but I get this java heap space right after. Thanks, Lior mojoSucceeded org.apache.maven.plugins:maven-surefire-plugin:2.9(default-test) [JENKINS]