cucumber

Error: Could not find or load main class cucumber.api.cli.Main

对着背影说爱祢 提交于 2019-12-23 20:21:35
问题 I try to run this gradle task task runCucumber(type: JavaExec) { main = "cucumber.api.cli.Main" args += ['-f', 'html:build/reports/cucumber/', '-f', 'json:build/reports/cucumber/report.json', '--glue', 'com.waze.testing.cucumber', 'src/main/resources/features' , '--tags', '~@ignore', '--tags', '~@preRelease', '--tags', '@advil'] systemProperties['http.keepAlive'] = 'false' systemProperties['http.maxRedirects'] = '20' ignoreExitValue = true } and get this error: Error: Could not find or load

Understanding native and send_keys in Capybara

痞子三分冷 提交于 2019-12-23 15:35:57
问题 I am trying to understand the meaning of the following Capybara syntax. What exactly does native do? What is send_keys used for? Also, I would like to understand what this particular block does. within('#step-3') do recipe_name = first(:xpath, '//*[@id="recipe-name"]').native recipe_name.clear recipe_name.send_keys('Email recipe') end 回答1: Capybara uses a driver to control a browser or browser simulator (Rack::Test, Poltergeist, Selenium, etc.). Each driver must implement the API that

Integrating external data source with Cucumber feature file

帅比萌擦擦* 提交于 2019-12-23 13:12:06
问题 I am new to Cucumber and the feature files it uses for BDD. I want to know if there is any way I could directly give the filepath of my external data file (eg. CSV file), and fetch the values of the parameters I use to create my test script. 回答1: You can add a tag with parameter to the features @data("/path/data.json") Scenario: Login as zinc admin Given I open zinc homepage And then create hook that reads the param and loads file before running a scenario. Before do |scenario| // read data

Remove warning about ansicon from “rake cucumber”

烂漫一生 提交于 2019-12-23 12:45:57
问题 When you run any rake task with cucumber installed on a machine that doesn't have ANSICON installed, you get the following message: *** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows When running locally I like using ANSICON, but when used within the build server I don't care about that - and I don't want to see that warning there. Is there a way to get rid of it? 回答1: You can actually remove the warning itself. I do not like

capybara - Clicking a button without an id

纵然是瞬间 提交于 2019-12-23 12:23:14
问题 I'm trying to to click the button in this html code <div class="modal-footer"><button class="btn" data-dismiss="modal">Kapat</button></div> I've already tried find with various combinations, the closest I came to success was with this code: click_on "Kapat" The problem is that there are 3 copies of the same button in the page, so my question is; is there a way to specify this particular div ? 回答1: If the button has a specific path, you could use within or a find down to that path, but that

Ruby increase file size on the fly for testing

我只是一个虾纸丫 提交于 2019-12-23 12:09:34
问题 This may sound weird, or why do you want to do that. I'm trying to write a cucumber feature to test uploading large image file (>16M) So, I don't want to store the large file on github or in my project. I'm using imagemagick to create an image but as far as I can do is just 1M. Can I increase the file size in ruby? I don't care about the content inside the file, just the file size. Thanks, is there anyway I could trick cucumber to believe me that I'm uploading a large file size? Thanks 回答1:

Cucumber `--tags` options from command line?

我是研究僧i 提交于 2019-12-23 11:46:10
问题 What i would like to do is to pass cucumber options from command line to execute scenarios with tag name @extecuteThese but also i wanted to exclude scenarios that are with tag name @WIP so what am i doing so far is -Dcucumber.options='--tags @executeThese --tags ~@WIP' But unfortunately, it's not considering ~@WIP tag option Any help, much appreciated!! 回答1: Lets pretend this is your feature: Feature ABC @executeThese Scenario: abc1 @WIP @executeThese Scenario: abc2 What you are currently

Should Gherkin scenario always have When step?

老子叫甜甜 提交于 2019-12-23 09:49:17
问题 When defining scenarios in Gherkin sometimes there is no clear distinction between Given and When steps, i.e. there is no active interaction with the system from the user and the purpose of the validation is to verify how the system should look under certain circumstances. Consider the following: Scenario: Show current balance Given user is on account page Then user should see his balance vs Scenario: Show current balance When user goes to account page Then user should see his balance I am

Running capybara with nginx

和自甴很熟 提交于 2019-12-23 09:31:54
问题 Is is possible to run capybara with nginx and passenger? instead or webrick? Capybara is installed with cucumber in a rails app. 回答1: It is easy - the only thing you have to do is to switch your mind - neither capybara nor cucumber are not tied to local environment you can test application that is located in internet and it will not care about it - you can even test google.com if you want. For your particular problem you'll have to set Capybara.run_server = false Capybara.server_port = 8000 #

How to include Capybara into module in Cucumber project

与世无争的帅哥 提交于 2019-12-23 09:15:48
问题 I defined a module: module Support include Capybara::DSL def self.do_something click_link 'Questions' end end It's situated at features/support/support.rb My env.rb: require 'capybara' require 'cucumber' require 'capybara/cucumber' Capybara.app_host = "http://www.stackoverflow.com" Capybara.run_server = false Capybara.default_driver = :selenium I invoke function of module in steps.rb: Support::do_something And I have exception: undefined method `click_link' for Support:Module (NoMethodError)