View Javadoc

1   package com.atlassian.webdriver;
2   
3   import com.atlassian.pageobjects.TestedProduct;
4   import com.atlassian.webdriver.pageobjects.WebDriverTester;
5   import com.google.common.base.Supplier;
6   
7   /**
8    * Utils for getting and manipulating {@link org.openqa.selenium.WebDriver} instances.
9    *
10   * @since 2.1
11   */
12  public final class Drivers
13  {
14  
15      private Drivers()
16      {
17          throw new AssertionError("Don't instantiate me");
18      }
19  
20  
21      public static Supplier<AtlassianWebDriver> fromProduct(final TestedProduct<? extends WebDriverTester> product)
22      {
23          return new Supplier<AtlassianWebDriver>()
24          {
25              @Override
26              public AtlassianWebDriver get()
27              {
28                  return product.getTester().getDriver();
29              }
30          };
31      }
32  }