Last active
January 9, 2019 12:24
-
-
Save ToshiDono/6f0b4f84ef3add3d9a75e381cf515895 to your computer and use it in GitHub Desktop.
Two methods for making tests parallel on the JDI 2 Framework
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
| /** | |
| * In TestsInit add one from two methods | |
| */ | |
| /** | |
| * First method. | |
| * Clean cookies and refresh page. | |
| */ | |
| @AfterMethod(alwaysRun = true) | |
| public static void cleanBrowser(){ | |
| WebDriverFactory.getDriver().manage().deleteAllCookies(); | |
| WebPage.currentPage.refresh(); | |
| } | |
| /** | |
| * Second method. | |
| * Reopen browser if it opened. | |
| */ | |
| @BeforeMethod(alwaysRun = true) | |
| public static void rerunDriver(){ | |
| if (WebDriverFactory.hasRunDrivers()){ | |
| WebDriverFactory.reopenDriver(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment