I use Cucumber and Capybara for my automatic front-end tests.
I have two environments in which I would like to run my tests. One of them is an intermediate environment, and the other is a production environment.
I currently have my tests written for direct access to the script.
visit('https://staging.somewhere.com')
I would like to reuse tests in production ( https://production.somewhere.com ).
Is it possible to save the url in a variable in step definitions
visit(domain)
and define a domain using an environment variable called a command line form? how
$> bundle exec cucumber features DOMAIN=staging
if I want to specify tests on my intermediate environment or
$> bundle exec cucumber features DOMAIN=production
if i want it to work in the production process?
How do I set this up? I am new to Ruby and I was looking for forums for direct information, but could not find. Let me know if I can provide more information. Thank you for your help!
source share