Created
May 13, 2015 17:10
-
-
Save ddavison/4c0182ec001cff17424b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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... | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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