cucumber

Path mapping with typescript doesn't work with cucumber test runner

帅比萌擦擦* 提交于 2019-12-12 19:17:41
问题 When running cucumber-js with my typescript project, path remapping fails. Using relative paths is fine but unforgivably ugly. E.g. import ... from "@src/..." fails, while import ... from "../../../foo.ts" works fine. My project looks something like this: package.json tsconfig.json src/ **/*.ts Inside tsconfig.json , I specify remap paths: "paths": { "@src/*": [ "src/*" ], "*": [ "node_modules/*", "src/types/*" ] My commandline looks like this: cucumber-js 'src/**/*.feature' --require-module

Running background once for scenario outline examples in Cucumber Java

大憨熊 提交于 2019-12-12 16:40:02
问题 I want to run the background once for the below scenario so that while executing it, it should not go back the user to login screen again. I found some replies where it says this is how cucumber works but could not find any alternative to do this. What is the best way to handle this and how? if someone can share example code for this. e.g. Background: Given User logs into the application and on the home page Scenario outline: When user fills the form "<FName>" and "<LName>" And click on

invalid option: --autospec

不羁岁月 提交于 2019-12-12 16:25:43
问题 /usr/local/bin/ruby -rrubygems -e "require 'redgreen'" /usr/local/lib/ruby/gems/1.8/gems/rspec-1.3.0/bin/spec --autospec <files_here> -O spec/spec.opts invalid option: --autospec Test::Unit automatic runner. Usage: -e [options] [-- untouched arguments] which spec says "/usr/local/bin/spec" which autospec says "/usr/local/bin/autospec" /usr/local/bin/spec --help includes --autospec option in the list. What am I missing here? 回答1: I finally got some time during the weekend to look into this

How to output Cucumber background steps before each scenario?

蹲街弑〆低调 提交于 2019-12-12 15:58:47
问题 Normally, Cucumber will output background steps to look the same as you defined them in your feature file (once at the top). $ bundle exec cucumber --color --format pretty Feature: Something Background: Given step 1 And step 2 Scenario: a scenario When I do step 3 Then it works Scenario: another scenario When I do a different step 3 Then it works It would be much easier to see when a background step is executed successfully if you could always display the steps at the beginning of a scenario.

What object is in play for instance variables (i.e. what is self) in Cucumber step definitions?

血红的双手。 提交于 2019-12-12 14:58:54
问题 I'm not understanding scoping when using Cucumber in Ruby, especially with regard to instance variables. For the context of my immediate example, in the Before portion of hooks.rb the variable @browser is assigned. @browser = Watir::Browser.new @browser_selected.to_sym (where @browser_selected is usually 'chrome') In step definitions @browser gets used. As a simple example: @browser.send_keys(:tab) What I don't understand is what object contains @browser as an attribute. How does it have

how to access stdout,stderr, and error in cucumber.js step definition using nodejs child_process exec

房东的猫 提交于 2019-12-12 14:42:18
问题 I am new to Cucumber.js, trying to execute a shell command in a step definition. Sample below is a step definition snippet, Cucumber.js does not print stdout. I basically need to access stdout and stderr in a step. var exec = require('child_process').exec; this.Given(/^XYZ server is running$/, function(callback) { child = exec('pwd', function (error, stdout, stderr) { console.log('stdout: ' + stdout); console.log('stderr: ' + stderr); if (error !== null) { console.log('exec error: ' + error);

Jruby and Cucumber / Cucumber Rails - Could not find generator cucumber:install

醉酒当歌 提交于 2019-12-12 14:35:46
问题 Although I've often come here for solutions, however this is my first post! Problem: When trying to run "rails generate cucumber:install" I receive the error: Could not find generator cucumber:install Note: When using plain Ruby on Windows I have managed to successfully configure cucumber, but had to change because of the dependency on java libraries and requirement for Jruby... Background: Setting up a testing pc that requires Windows and Java 6. Using Windows XP Downloaded and installed

How to run a single row of a Cucumber scenario outline example table in RubyMine?

六眼飞鱼酱① 提交于 2019-12-12 14:33:54
问题 I'm running tests using RubyMine (forced upon me). I have some features that use the Scenario Outline and Example format. Is there a way I can run only a certain row from the Example table? Example: Examples: | user_row | row1 | row2 | | 1 | 2 | 4 | | 51 | 51 | 97 | | 98 | 98 | 147 | I only want to run the test from the 2nd row (user_row 51). I can't seem to find anything with the help in RubyMine for this. 回答1: Cucumber itself does support running a single example. RubyMine doesn't support

Cucumber-JVM 3 - Convert DataTable to single object using asMap()

岁酱吖の 提交于 2019-12-12 14:02:38
问题 In cucumber-jvm 3.x.x , I want to convert a datatable with only 2 columns to a single object. This used to be automatic in 2.x.x but has since been removed with the new major version. Code: // Feature Scenario: Scan Barcode Given I Am At The Login Page When I Log In As Valid User | group | gpao | | username | svgpao1 | | password | REDACTED | // Stepdef @When("I Log In As Valid User") public void I_Log_In_As_Valid_User(User user) throws Throwable { Selenium.enterText(driver, user.getUsername(

Rails helpers not working in test environment

本秂侑毒 提交于 2019-12-12 13:41:31
问题 I've followed the tutorial available at http://railscasts.com/episodes/221-subdomains-in-rails-3. It allows you to pass a subdomain option to your routes by overriding the url_for method in a helper file. I've helper method looks like this: module UrlHelper def with_subdomain(subdomain) subdomain = (subdomain || "") subdomain += "." unless subdomain.empty? [subdomain, request.domain, request.port_string].join end def url_for(options = nil) if options.kind_of?(Hash) && options.has_key?(