Skip to content

Instantly share code, notes, and snippets.

@ddavison
Created May 13, 2015 17:10
Show Gist options
  • Select an option

  • Save ddavison/4c0182ec001cff17424b to your computer and use it in GitHub Desktop.

Select an option

Save ddavison/4c0182ec001cff17424b to your computer and use it in GitHub Desktop.
// Create a super class, that all your tests will be based off of.
@Config(
url = "about:blank",
browser = Browser.CHROME
)
public class AutomationTest extends Locomotive {
public AutomationTest() {
baseUrl = TestEnvironment.getUrl();
navigateTo(baseUrl);
}
}
// Since our class extends AutomationTest, the environment will be set here, and we won't have to specify the @Config
public class TestClass extends AutomationTest {
@Test
public void myTest() {
// do something...
}
}
public class TestEnvironment {
/**
* Reads the environment to be run against.
*/
public static String getUrl() {
return System.getPropety("testEnvironment", "https://environment/ffo/Ansokan.do");
// default to https://ombud-system2.system2.bolagsverket.se/ffo/Ansokan.do
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment