Object/Trait

org.scalatestplus.play

BrowserFactory

Related Docs: trait BrowserFactory | package play

Permalink

object BrowserFactory

Companion object to trait BrowserFactory that holds a UnavailableDriver object that implements the Selenium WebDriver interface by throwing UnsupportedOperationException. This is used as a placeholder when a driver is not available on the host platform.

Source
BrowserFactory.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BrowserFactory
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class GrumpyDriver extends WebDriver

    Permalink

    A null-object implementation of the Selenium WebDriver interface that throws UnsupportedOperationException from all of its methods, used when either 1) a WebDriver field has not yet been initialized, 2) a requested Selenium WebDriver is unavailable on the host platform, or 3) a test that did not declare it needed a WebDriver in AllBrowserPerSuite or AllBrowserPerTest attempts to use one.

    A null-object implementation of the Selenium WebDriver interface that throws UnsupportedOperationException from all of its methods, used when either 1) a WebDriver field has not yet been initialized, 2) a requested Selenium WebDriver is unavailable on the host platform, or 3) a test that did not declare it needed a WebDriver in AllBrowserPerSuite or AllBrowserPerTest attempts to use one.

    This is named GrumpyDriver because all it does is complain. No matter what you ask of it, it throws an UnsupportedOperationException back at you.

  2. case class UnavailableDriver(ex: Option[Throwable], errorMessage: String) extends GrumpyDriver with Product with Serializable

    Permalink

    An implementation of WebDriver that provides an optional exception and an error message and throws UnsupportedOperationException from all of its other methods, used when a requested Selenium WebDriver is unavailable on the host platform.

    An implementation of WebDriver that provides an optional exception and an error message and throws UnsupportedOperationException from all of its other methods, used when a requested Selenium WebDriver is unavailable on the host platform.

    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 Null Object we provide also carries an optional exception and user-friendly error message.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object UninitializedDriver extends GrumpyDriver with Product with Serializable

    Permalink

    An implementation of WebDriver that throws UnsupportedOperationException from all of its methods, used to initialize instance vars of type WebDriver.

    An implementation of WebDriver that throws UnsupportedOperationException from all of its methods, used to initialize instance vars of type WebDriver.

    Traits OneBrowserPerTest, ConfiguredBrowser, AllBrowsersPerSuite, and AllBrowsersPerTest initialize their webDriver field with this value (to avoid initializing with null).

    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.

  5. object UnneededDriver extends GrumpyDriver with Product with Serializable

    Permalink

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

    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.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  18. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped