cucumber

Project doesn't recognize cucumber-picocontainer dependency

佐手、 提交于 2019-12-21 18:34:30
问题 I'm currently working on a java test framework with cucumber, JUnit and Selenium. I've already worked on projects like that, but I'm experiencing an issue on this one. I'm trying to create a Context class that is a Singleton. I want to use cucumber-picocontainer to have this class accessible in every step definition class. I added the dependencies in my pom.xml, but every time I try to execute my tests, I have an exception that says : "NewLoginSteps doesn't have an empty constructor. If you

What's the profit of using /.*?/

纵饮孤独 提交于 2019-12-21 09:14:32
问题 In some Rails code (cucumber features' steps definitions, javascripts, rails_admin gem) I found this regular expression parts: string =~ /some regexp.+rules should match "(.*?)"/i I do have some knowledge at regular expressions and i know that * and ? symbols are similar but whilst asterisk means zero and more , the question mark means could be present or could be not . So, using the question mark near the group of symbols makes its presence non-required within the phrase being tested. What's

Preserve variable in cucumber?

时光总嘲笑我的痴心妄想 提交于 2019-12-21 07:20:07
问题 I want to access variables in difference Given/Then/When clauses. How to preserve variables so that they are accessible everywhere? Given(#something) do foo = 123 # I want to preserve foo end Then(#something) do # how to access foo at this point??? end 回答1: To share variables across step definitions, you need to use instance or global variables. Instance variables can be used when you need to share data across step definitions but only for the one test (ie the variables are cleared after each

How to resolve the deprecation of format option in @CucumberOptions?

£可爱£侵袭症+ 提交于 2019-12-21 07:08:37
问题 When i am using the option format in @CucumberOptions for test reports it is showing that the format option has been deprecated how to resolve that. @CucumberOptions( monochrome = true, format = {"html:target/cucumber-html-report", "json:target/cucumber-json-report.json" }) 回答1: replace format with plugin @CucumberOptions( monochrome = true,plugin = {"html:target/cucumber-html-report", "json:target/cucumber-json-report.json" }) 来源: https://stackoverflow.com/questions/31138086/how-to-resolve

How to resolve the deprecation of format option in @CucumberOptions?

安稳与你 提交于 2019-12-21 07:08:09
问题 When i am using the option format in @CucumberOptions for test reports it is showing that the format option has been deprecated how to resolve that. @CucumberOptions( monochrome = true, format = {"html:target/cucumber-html-report", "json:target/cucumber-json-report.json" }) 回答1: replace format with plugin @CucumberOptions( monochrome = true,plugin = {"html:target/cucumber-html-report", "json:target/cucumber-json-report.json" }) 来源: https://stackoverflow.com/questions/31138086/how-to-resolve

Rails 3.1.1 and Cucumber - Error

不问归期 提交于 2019-12-21 07:04:51
问题 I have git a little problem running Cucumber. When using cucumber I get the following results: Yanniss-MacBook:rechnungen yannis$ cucumber Using the default profile... /Users/yannis/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_ MiniTest v1.6.0 is out of date. `gem install minitest` and add `gem 'minitest' to you test helper. (RuntimeError) /Users/yannis/.rbenv/versions/1.9.2-p290/lib/ruby

Cucumber Capybara scroll to bottom of page

[亡魂溺海] 提交于 2019-12-21 06:46:58
问题 I'd like to use my Cucumber/Capybara setup to test endless scroll by driving a browser and scrolling to the bottom of the page to ensure that the new content is loaded. Is there a way to do this? 回答1: You could use javascript to achieve this: page.execute_script "window.scrollBy(0,10000)" 回答2: I solved this with visit '#footer' inside a "scroll to the bottom of the page" step. 来源: https://stackoverflow.com/questions/4424790/cucumber-capybara-scroll-to-bottom-of-page

Using Cucumber With Modular Sinatra Apps

 ̄綄美尐妖づ 提交于 2019-12-21 05:32:14
问题 I'm building out a medium-sized application using Sinatra and all was well when I had a single app.rb file and I followed Aslak's guidance up on Github: https://github.com/cucumber/cucumber/wiki/Sinatra As the app grew a bit larger and the app.rb file started to bulge, I refactored out a lot of of the bits into "middleware" style modules using Sinatra::Base, mapping things using a rack-up file (config.ru) etc. The app works nicely - but my specs blew up as there was no more app.rb file for

Cucumber scenarios for extremely long work flow

偶尔善良 提交于 2019-12-21 04:20:49
问题 We need to test a long process of steps for one Feature. From logging in to many modal dialogs, multi-step forms, and users of different roles all interacting. How can we break parts of this process down into individual Scenarios? Here is an example: Scenario: New Manuscript Given I am on the manuscripts page When I press "Submit A New Manuscript" Then I should see "Please specify this manuscript's type" Scenario: Choose Manuscript Type Given I am choosing a manuscript type When I click

Capybara & Cucumber | Getting cookies

核能气质少年 提交于 2019-12-21 03:52:24
问题 I'm trying to get cookie values in the Cucumber step: Step definitions When /^I log in$/ do # code to log in end Then /^cookies should be set$/ do cookies[:author].should_not be_nil end Controller class SessionsController < ApplicationController def create cookies[:author] = 'me' redirect_to authors_path end end But it doesn't work: Result expected: not nil got: nil In the RSpec examples, all works just fine: Controller Spec require 'spec_helper' describe SessionsController do describe