I need to download a csv file from my app using Open::URI and to do that I need to give it a fully qualified URI. So whats the best way to get the HOST and more importantly PORT in my cucumber script?
Note I am using Capybara and Selenium
In a typical project, cucumber --require features features/some/path will suffice. Repetitious usages can be added to user-defined profiles contained in the project’s cucumber.yml file. Use the flag --profile or -p to execute Cucumber with a profile. You can still use other command line arguments alongside --profile or -p , if desired.
First, let’s start with definitions. What is Capybara? On Capybara’s official page it is described as follows: “ Capybara is a library written in the Ruby programming language which makes it easy to simulate how a user interacts with your application.
Cucumber-js does not support configuration of Cucumber with an env file. You can use environment variables in the profile argument list, just as you would normally specify them on the command-line. When running Cucumber, it can sometimes be handy to pass special values to Cucumber for your step definitions to use.
If you want to see a bit of cucumber.js, the JavaScript port of Cucumber, you can take a look at the directory storra/features. If you have the Audiobook Collection Manager up and running, you might want to explore the application manually for a minute, to see what functionality it offers (not much, really).
For capybara < 2.0:
Capybara.current_session.driver.rack_server.host Capybara.current_session.driver.rack_server.port
Capybara 2.0:
Capybara.current_session.server.host Capybara.current_session.server.port
FYI, my use case is having clickable links in the mail generated by the integration tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With