Skip to content

Instantly share code, notes, and snippets.

@ToshiDono
Last active January 9, 2019 12:24
Show Gist options
  • Select an option

  • Save ToshiDono/6f0b4f84ef3add3d9a75e381cf515895 to your computer and use it in GitHub Desktop.

Select an option

Save ToshiDono/6f0b4f84ef3add3d9a75e381cf515895 to your computer and use it in GitHub Desktop.
Two methods for making tests parallel on the JDI 2 Framework
/**
* 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