cucumber

How do I re-run a cucumber scenario outline with different parameters?

久未见 提交于 2019-12-30 10:34:45
问题 I have a cucumber scenario outline for testing a webservice that is similar to: Scenario Outline: Check the limit functionality When I GET "/api/activity-schedule-items.xml" with parameters {<filter>} Then the xml attribute "total-count" is "<count>" Scenarios: | filter | count | | 'limit' => 0 | 0 | | 'limit' => 2 | 2 | | 'limit' => 2 | 2 | | 'limit' => -1 | 15 | which works fine, however I want to re-run the same scenario outline and scenarios for each of our webservices. Basically, I would

Triggering Raphael events externally

被刻印的时光 ゝ 提交于 2019-12-30 09:47:08
问题 My app is using Raphaël to drop a collection of objects onto a page, each with a click handler bound that uses data attached to the object when it was loaded in via JSON. That’s all working fine. I now am trying to add in some test coverage using Cucumber (yes, I know I should have built the tests in first, I will do next time). I need to trigger a click on the first object to test that that object’s associated page loads. I’ve tried finding the appropriate SVG path for that object and

How can I figure out which step I've just executed in Cucumber's AfterStep hook?

…衆ロ難τιáo~ 提交于 2019-12-30 07:34:30
问题 I'm writing a method to be executed on the AfterStep callback for Cucumber. https://github.com/cucumber/cucumber/wiki/Hooks#step-hooks How can I figure out which step was executed before this hook was called? 回答1: The AfterStep hook only receives the scenario as parameter. What you can do, is count the steps, and then get the current one: AfterStep do |scenario| @step ||= 0 p scenario.steps[@step].name @step += 1 end This will print, in turn, the names of each parameter 回答2: Using gem

protractor config file is not picking up the cucumber step definitions

≡放荡痞女 提交于 2019-12-30 07:33:09
问题 i am new to protractor and cucumber framework. i followed the steps from protractor site and here https://semaphoreci.com/community/tutorials/getting-started-with-protractor-and-cucumber. i have a config file configured with cucumber framework options, feature file and step definition file. But when i run my cucumber-config file it does not recognize my step definitions and always throw an error. any help on this? below are my setup files. //cucumber-config.js exports.config = {

Selenium Webdriver getting a cookie value

别说谁变了你拦得住时间么 提交于 2019-12-30 07:23:47
问题 I am trying to get a cookie value but keep getting an error of <Selenium::WebDriver::Driver:0x13a0e0e8 browser=:firefox> I am calling @browser.cookie_named("configsession").each do |cookie| puts cookie[:name] is there something I i'm doing wrong? 回答1: The methods for working with cookies are defined in the Selenium::WebDriver::Options - see the API docs. To access these cookie methods, you need to call the manage method for the driver: @browser.manage To get a cookie based on its name, you

Selenium Webdriver getting a cookie value

百般思念 提交于 2019-12-30 07:23:09
问题 I am trying to get a cookie value but keep getting an error of <Selenium::WebDriver::Driver:0x13a0e0e8 browser=:firefox> I am calling @browser.cookie_named("configsession").each do |cookie| puts cookie[:name] is there something I i'm doing wrong? 回答1: The methods for working with cookies are defined in the Selenium::WebDriver::Options - see the API docs. To access these cookie methods, you need to call the manage method for the driver: @browser.manage To get a cookie based on its name, you

What does Steak add beyond just using Capybara and RSpec in Rails testing?

随声附和 提交于 2019-12-30 06:10:30
问题 I'm trying to understand the need for Steak. I get that its like Cucumber, except that you can use pure ruby instead of mapping your english language specs to ruby like in Cucumber, but it says that it mainly adds a wrapper around the RSpec DSL, and lets you use that taken from: http://jeffkreeftmeijer.com/2010/steak-because-cucumber-is-for-vegetarians/ module Spec::Example::ExampleGroupMethods alias scenario example alias background before end module Spec::DSL::Main alias feature describe

Cuke4Nuke or SpecFlow?

拥有回忆 提交于 2019-12-29 11:48:11
问题 I am trying to decide if I should use Cuke4Nuke or SpecFlow. What are the pro/cons of each? Opinions on which is better and why. Thanks! 回答1: (I might be biased because I am involved with SpecFlow, but here my thoughts...) Cuke4Nuke is very close to Cucumber. This promises a lot of advantages: Compatibility Getting new features from Cucumber when Cucumber evolves (at least in theory, but language support is an example for this) Being a real part of the Cucumber community and the Cucumber

How to resolve Rails model namespace collision

风流意气都作罢 提交于 2019-12-29 04:22:23
问题 The story so far: I have a rails app with a model named "Term". All is well until trying to install Cucumber. Upon running rake cucumber I get Term is not a class (TypeError) This happens because Cucumber includes another gem, 'term-ansicolor' (to do the nifty colored text output in the console), and term-ansicolor defines a module named "Term". Cucumber includes term-ansicolor before including the Rails models, thus "Term" is already defined as a module when loading the "Term" model. Top

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

烈酒焚心 提交于 2019-12-29 04:14:49
问题 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 |-MyFeature.feature In the junit test MyFeatureTest.java I have this: import org.junit.runner.RunWith; import cucumber.junit.Cucumber; @RunWith(Cucumber.class) public class HomepageTest { } Now https://github.com/cucumber/cucumber-jvm/wiki/IDE-support says that I should add the following line: