Packages

case object UnneededDriver extends GrumpyDriver with Product with Serializable

An implementation of WebDriver that throws UnsupportedOperationException from all of its methods, used when a test does not need a Selenium WebDriver at all.

Traits OneBrowserPerSuite, OneBrowserPerTest, AllBrowsersPerTest, and MixedFixtures check if the requested WebDriver is available, and if not, installs this driver (to avoid initializing with null) and cancels the tests.

This is an example of the "Null Object Pattern." We use this pattern to avoid initializing with null instead of making the driver type an Option[WebDriver] for two reasons: 1) the type of the implicit needed by Selenium is WebDriver, not Option[WebDriver], and 2) the UnsupportedOperationException thrown by the methods of the Null Object we provide carries a user-friendly error message.

Source
BrowserFactory.scala
Linear Supertypes
Serializable, Product, Equals, GrumpyDriver, WebDriver, SearchContext, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. UnneededDriver
  2. Serializable
  3. Product
  4. Equals
  5. GrumpyDriver
  6. WebDriver
  7. SearchContext
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def close(): Unit

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver
  2. final def findElement(by: By): WebElement

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver → SearchContext
  3. final def findElements(by: By): List[WebElement]

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver → SearchContext
  4. final def get(url: String): Unit

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver
  5. final def getCurrentUrl(): String

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver
  6. final def getPageSource(): String

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver
  7. final def getTitle(): String

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver
  8. final def getWindowHandle(): String

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver
  9. final def getWindowHandles(): Set[String]

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver
  10. final def manage(): Options

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver
  11. final def navigate(): Navigation

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver
  12. def productElementName(n: Int): String
    Definition Classes
    Product
  13. def productElementNames: Iterator[String]
    Definition Classes
    Product
  14. final def quit(): Unit

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver
  15. final def switchTo(): TargetLocator

    Throws UnsupportedOperationException.

    Throws UnsupportedOperationException.

    Definition Classes
    GrumpyDriver → WebDriver