cucumber

How to transform Spec-flow table data into different values

China☆狼群 提交于 2019-12-19 23:27:50
问题 I need to transform Spec-flow table data that we get via table.CreateInstance() or table.CreateSet() . I am using Spec flow for DB testing and in some cases, Table field values needs to be mapped to different values as DB tables are storing codes instead of the the values we have entered in tables of feature files. I do not want to include the codes in feature files as it reduces the readability. For example, If I have entered Single for status as mentioned below, I want it to be mapped or

Does if else concept available in feature file (Gherkin language)?

核能气质少年 提交于 2019-12-19 19:53:18
问题 Is there anyway where we can use if/else concept in feature file? For example: Scenario: User should be able to check login page Given I am on login page When I click on SignIn button Then I should be in home page If yes Then I will create a new profile Else Then I will logout from page 回答1: Not that I am aware of. Gherkin (and cucumber) are best used when they specify discreet business cases though, and should be repeatable, else they get hard to follow and test. It looks like you have two

How do you get cucumber/guard to filter on tags like @wip?

旧巷老猫 提交于 2019-12-19 18:49:26
问题 I'm running spork and guard and all has been going very well with my RSpec tests which were all run correctly. In order to speed up the tests I could successfully filter my RSpec tests with tags I placed in my .rspec file. .rspec --colour --debug --tag focus --tag now Unfortunately though I have not been able to filter my cucumber tags. Every time cucumber runs it runs either everything or just the file that changed. How can I get cucumber/spork/guard to respect tags like @wip, @now etc and

How to write cucumber Step definitions in python

吃可爱长大的小学妹 提交于 2019-12-19 17:32:06
问题 I am new to the Cucumber framework. I am trying to make Cucumber work with Python. I have written the feature file and want to know how to write the step definitions in Python. I searched over the internet and found the step definitions for Ruby language but nothing for Python. Is it even possible to run Cucumber with Python? 回答1: Cucumber supports 14 languages right now, including Python on the JVM also called Jython. I would start by reading up on Cucumber-JVM, it is an implementation of

Rails/Cucumber/Webrat: redirect_to, flash[:notice] not working

為{幸葍}努か 提交于 2019-12-19 11:53:17
问题 I'm new to Cucumber and have been stepping through a railscast by Ryan Bates. http://railscasts.com/episodes/155-beginning-with-cucumber Unfortunately my scenario is failing where the railscast passes. Specifically it is failing on the step: Then I should see "New Article Created." I suspect it may have something to do with the differing versions of the gems we are using, currently I have the latest of each. It gives me the following error: *Then I should see "New Article Created." expected

how to use capybara has_text

让人想犯罪 __ 提交于 2019-12-19 11:17:00
问题 So now I've got cucumber/capybara/selenium hitting a google app script, which is great, but for some reason I can't seem to check for text in the body of the page in the way I expect. In the debugger I can grab the page object, which I can in the browser has the expected text. Scanning the html directly shows the text appearing twice, and yet page.has_text? appears false: (rdb:1) p page.html.scan(/Introduction Video/) ["Introduction Video", "Introduction Video"] (rdb:1) p page.has_text?

how to use capybara has_text

流过昼夜 提交于 2019-12-19 11:16:03
问题 So now I've got cucumber/capybara/selenium hitting a google app script, which is great, but for some reason I can't seem to check for text in the body of the page in the way I expect. In the debugger I can grab the page object, which I can in the browser has the expected text. Scanning the html directly shows the text appearing twice, and yet page.has_text? appears false: (rdb:1) p page.html.scan(/Introduction Video/) ["Introduction Video", "Introduction Video"] (rdb:1) p page.has_text?

Ruby gem cucumber SSL error and Gem sources

拟墨画扇 提交于 2019-12-19 11:03:39
问题 I was trying to install cucumber gem for Ruby. Although there were few topics somewhat related to this, I can't find exact question with exact answer. When on Windows I try to run the command gem install cucumber and the console returned: ERROR: Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz) Then, I googled for a solution and

Calling Block multiple times in Cucumber Around Hook (Ruby)

那年仲夏 提交于 2019-12-19 10:42:16
问题 I'm trying to run a scenario several (30) times in order to get a nice statistical sample. However the block is only executing once; each subsequent time results in the scenario being called and not executing (although it says that the scenario did successfully complete with a time of around 5 ms). Around('@mass_benchmark') do |scenario, block| $seconds_taken = "SECONDS TAKEN NOT SET" @time_array = [] 30.times do before_hook(scenario) block.call after_hook(scenario) @time_array << $seconds

Specify the feature file location in cucumber

只谈情不闲聊 提交于 2019-12-19 07:17:12
问题 I have created some cucumber test steps and a small Cucumber test case, which I run with JUnit like so: @RunWith(Cucumber.class) public class FuelCarTest { //executs cucumber steps in the class FuelCarSteps } The Cucumber features files are now automatically loaded from the classpath location, src/main/resources/<package-name>/*.feature I could like to know how I can tell cucumber the location of my feature files, because I need it to load them from a location outside the classpath (e.g. data