I'm using Behat and Mink to test several sites. Two of them use Single Sign On, so one of my test includes login in one site, go to second site and check I'm logged in.
This is acomplished with this behat code:
Feature: SSO
In order to login in all related sites
As a anonymous user
I want to login in just one site
Scenario: Login with normal user
Given I am on "/user/login"
When I fill in "name" with "username"
And I fill in "pass" with "password"
And I press "login"
Then I should see "My account"
And I go to "http://server.developer1.workstations/"
Then I should see "Close session"
This works, but the problem is this line:
And I go to "http://server.developer1.workstations/"
We have different environments (local devs, dev, stagging) with different URLs, so I can't write a test that works in every machine. The first server it's ok because I can have different base_url settings for each machine, but I can't find a way to set the second server as a general settings instead of rewritting every feature file changing that second server URL.
Is there any way to declare variables, constants or something that can be stored in a file that will be different for each machine?
slave1_url
,slave2_url
etc., createslave_url
parameter and overload it using behat profiles. Then, run different profile on targeted environments. – Stewartstewed