cucumber

Passing jvm arguments to Gradle test task

梦想与她 提交于 2019-12-11 07:39:28
问题 I would like to pass JVM parameters to my Gradle test task. I use the parameters in a Cucumber feature file: ${app.url} . In the build.gradle file, I put those lines: test { testLogging.showStandardStreams = true systemProperties System.getProperties() } When I execute gradle test -Dapp.url=http://..... , I don't see the parameter was passed to the application. I also tried the below, but the result is the same: test { testLogging.showStandardStreams = true systemProperty "app.url", System

Cucumber DataTable Error - io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to cucumber.api.DataTable

混江龙づ霸主 提交于 2019-12-11 07:33:34
问题 Trying to run a scenario with cucumber/selenium/java/intelliJ, but getting an error regarding the DataTable in one of the steps. The dataTable was working fine and converting the arguments for the step correctly before I started using a test runner and changed some things around, but I just can't get this to work. This is the error: cucumber.runtime.CucumberException: Could not convert arguments for step [^I enter the following login details:$] defined at 'Steps.MaStepdefs

Register LocalDateTime xstream transformer with cucumber datatable

自闭症网瘾萝莉.ら 提交于 2019-12-11 07:31:16
问题 I have the following datatable in a Gherkin file: Given the system knows about the following equipments: | SerialNumber | CreationDate | | 1234A | 2016-05-17T08:41:17.970Z | | 5678A | 2012-03-16T08:21:17.970Z | And the following matching step definition in java : @Given("^the system knows about the following equipments:$") public void theSystemKnowsAboutTheFollowingEquipments(List<Equipment> equipments) throws Throwable { // step code... } With the POJO Equipment.java : public class Equipment

devise sign up automatically signs in user

情到浓时终转凉″ 提交于 2019-12-11 07:29:14
问题 when i sign up a user, but don't have confirmable setup just yet (i.e. will be in the future but commented out for now), does it automatically sign in the user? i need sign_up to just sign_up the user, but not sign him in, it needs to redirect to the login page, how do i get sign up to not log the user in? 回答1: Instead of copy pasting code and replacing one line (which could be harder to maintain), just override the after_sign_up_path_for(resource), so it uses the after_sign_in_path_for

Using proper grammar in Gherkin

穿精又带淫゛_ 提交于 2019-12-11 07:28:31
问题 It seems to be very difficult to look up documentation about Gherkin, so I was wondering if there was a way to augment step definitions to enable the tester to use proper grammar. One example that shows what I mean is: ...Testing... Then I see there is 1 item ...More testing... Then I see there are 2 items Obviously, these two steps would use the same code. I defined a step definition like this which almost works: Then(/^I see there (is|are) (\d+) item(s)?$/) do |item_count| ...code... end

how to select a picture from UIImagePickerController using Frank Cucumber?

痞子三分冷 提交于 2019-12-11 06:44:48
问题 I was trying to use BDD technique to check the import picture process using Frank in the iPhone Simulator. The problem is that I cannot call the last step of selecting an image from UIImagePickerControllerSourceTypePhotoLibrary source (launching the UIImagePickerController was very easy using "touch"-commands on a button). It always stuck in the progress when I can see the saved images in the Simulator. The Frank Symbiote said the object I wanna touch is a "PLAlbumViewCell" object. 回答1: I

Installing hpricot for JRuby

寵の児 提交于 2019-12-11 06:42:44
问题 I'm trying to look at cucumber for Jruby on Rails. One of the pre-requesites is webrat which has as pre-requisite hpricot. I've installed the gem with hpricot using: gem install hpricot --source http://code.whytheluckystiff.net --version 0.6.1 --platform java This installs the java version of hpricot. I add the hpricot_scan.jar to the CLASSPATH but when I run: cucumber features -n I get the following output: HpricotScanService.java:931:in `hpricot_scan': java.lang.NoSuchMethodError: org.jruby

How to write numbers in cucumber scenarios

允我心安 提交于 2019-12-11 05:47:59
问题 I would like to write a number in cucumber page. Please let me know How can I write this. Scenario Outline: Enter an invalid URL Given the context "Invalid URL" is open on "Market" When user is on the error 404 page Then page not found message is displayed But i have observed that 404 is taken as a parameter. 回答1: Sure, you just have to handle it as a regular expression (regex) in your step definitions. Your step definition could read as following: @When("^When user is on the error \"(\\d+)\"

Tests are running on my Ubuntu pc, but not on my Mac OS X Lion 10.7.3, Ruby 1.9.3, Rails 3.2.1

旧城冷巷雨未停 提交于 2019-12-11 05:21:13
问题 I have project in Dropbox and two running laptops: one with Ubuntu and one with Mac OS X Lion 10.7.3. When I try to run either rspec or cucumber on ubuntu they are running well, but when I try to run tests on Mac I have the same errors in config/application.rb:13: Bundler.require(*Rails.groups(:assets => %w(development test))) For cucumber: Using the default profile... undefined method `gsub' for nil:NilClass (NoMethodError) /Users/sergey/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.1

How to add a wait method to wait until a specific element is loaded in ruby+Cucumber2.0

﹥>﹥吖頭↗ 提交于 2019-12-11 05:06:37
问题 I have a problem while testing my cases on browser stack. The problem am facing is inconsistently reproduced. To make my code wait until an element is loaded am using as below: gift_no_btn1 = Capybara.find('giftingNoButton') gift_no_btn1.click The problem here is that the screen is stuck in the other module where my intended element is not loaded and hence my script fails. I have read that find() method is replaced of wait_untill method in Capybara 2.0. 回答1: Capybaras find methods will wait