Trait

org.scalatestplus.play

AllBrowsersPerSuite

Related Doc: package play

Permalink

trait AllBrowsersPerSuite extends TestSuiteMixin with WebBrowser with Eventually with IntegrationPatience

Trait that uses a shared test approach to enable you to run the same tests on multiple browsers in a ScalaTest Suite, where each kind of browser is started and stopped just once for the whole Suite.

Note: the difference between this trait and AllBrowsersPerTest is that this trait will allow you to write tests that rely on maintaining browser state between the tests. This is a good fit for integration tests in which each test builds on actions taken by the previous tests.

This trait overrides Suite's withFixture lifecycle method to create a new WebDriver instance the first time it is needed by each test, and close it the first time it is not needed (thus allowing multiple tests to share the same browser), and overrides the tags lifecycle method to tag the shared tests so you can filter them by browser type. This trait's self-type, ServerProvider, will ensure a TestServer and Application are available to each test. The self-type will require that you mix in either GuiceOneServerPerSuite, GuiceOneServerPerTest, ConfiguredServer before you mix in this trait. Your choice among these three ServerProviders will determine the extent to which a TestServer is shared by multiple tests.

You'll need to place any tests that you want executed by multiple browsers in a sharedTests method. Because all tests in a ScalaTest Suite must have unique names, you'll need to append the browser name (available from the BrowserInfo passed to sharedTests) to each test name:

def sharedTests(browser: BrowserInfo) {
  "The blog app home page" must {
    "have the correct title " + browser.name in {
       go to (host + "index.html")
       pageTitle must be ("Awesome Blog")
    }

All tests registered via sharedTests will be registered for each desired WebDriver, as specified by the browsers field. When running, any tests for browser drivers that are unavailable on the current platform will be canceled. All tests registered under sharedTests will be tagged automatically if they end with a browser name in square brackets. For example, if a test name ends with [Firefox], it will be automatically tagged with "org.scalatest.tags.FirefoxBrowser". This will allow you can include or exclude the shared tests by browser type using ScalaTest's regular tagging feature.

You can use tagging to include or exclude browsers that you sometimes want to test with, but not always. If you never want to test with a particular browser, you can prevent tests for it from being registered at all by overriding browsers and excluding its BrowserInfo in the returned Seq. For example, to disable registration of tests for HtmlUnit, you'd write:

override lazy val browsers: IndexedSeq[BrowserInfo] =
  Vector(
    FirefoxInfo,
    SafariInfo,
    InternetExplorerInfo,
    ChromeInfo
  )

Note that this trait can only be mixed into traits that register tests as functions, as the shared tests technique is not possible in style traits that declare tests as methods, such as org.scalatest.Spec. Attempting to do so will become a type error once we release ScalaTest 2.2.0.

package org.scalatestplus.play.examples.allbrowserspersuite

import play.api.test._
import org.scalatestplus.play._
import org.scalatestplus.play.guice._
import play.api.{Play, Application}
import play.api.inject.guice._
import play.api.routing._
import play.api.cache.EhCacheModule

class ExampleSpec extends PlaySpec with GuiceOneServerPerSuite with AllBrowsersPerSuite {

  // Override fakeApplication if you need an Application with other than
  // default parameters.
  def fakeApplication() = new GuiceApplicationBuilder()
    .disable[EhCacheModule]
    .configure("foo" -> "bar")
    .router(Router.from(TestRoute))
    .build()

  // Place tests you want run in different browsers in the `sharedTests` method:
  def sharedTests(browser: BrowserInfo) = {

    "The AllBrowsersPerSuite trait" must {
      "provide a web driver " + browser.name in {
        go to ("http://localhost:" + port + "/testing")
        pageTitle mustBe "Test Page"
        click on find(name("b")).value
        eventually { pageTitle mustBe "scalatest" }
      }
    }
  }

  // Place tests that don't need a WebDriver outside the `sharedTests` method
  // in the constructor, the usual place for tests in a `PlaySpec`
  "The AllBrowsersPerSuite trait" must {
    "provide an Application" in {
      app.configuration.getString("foo") mustBe Some("bar")
    }
    "make the Application available implicitly" in {
      def getConfig(key: String)(implicit app: Application) = app.configuration.getString(key)
      getConfig("foo") mustBe Some("bar")
    }
    "start the Application" in {
      Play.maybeApplication mustBe Some(app)
    }
    "provide the port" in {
      port mustBe Helpers.testServerPort
    }
    "provide an actual running server" in {
      import java.net._
      val url = new URL("http://localhost:" + port + "/boum")
      val con = url.openConnection().asInstanceOf[HttpURLConnection]
      try con.getResponseCode mustBe 404
      finally con.disconnect()
    }
  }
}

Here's how the output would look if you ran the above test class in sbt on a platform that did not support Selenium drivers for Internet Explorer or Chrome:

> test-only *allbrowserspersharedsuite*
[info] ExampleSpec:
[info] The AllBrowsersPerSuite trait
[info] - must provide a web driver [Firefox]
[info] The AllBrowsersPerSuite trait
[info] - must provide a web driver [Safari]
[info] The AllBrowsersPerSuite trait
[info] - must provide a web driver [InternetExplorer] !!! CANCELED !!!
[info]   Was unable to create a Selenium InternetExplorerDriver on this platform. (AllBrowsersPerSuite.scala:257)
[info] The AllBrowsersPerSuite trait
[info] - must provide a web driver [Chrome] !!! CANCELED !!!
[info]   Was unable to create a Selenium ChromeDriver on this platform. (AllBrowsersPerSuite.scala:257)
[info] The AllBrowsersPerSuite trait
[info] - must provide a web driver [HtmlUnit]
[info] The AllBrowsersPerSuite trait
[info] - must provide a Application
[info] - must make the Application available implicitly
[info] - must start the Application
[info] - must provide the port
[info] - must provide an actual running server

Because the shared tests will be tagged according to browser, you can include or exclude tests based on the browser they use. For example, here's how the output would look if you ran the above test class with sbt and ask to include only Firefox:

> test-only *allbrowserspersharedtest* -- -n org.scalatest.tags.FirefoxBrowser
[info] ExampleSpec:
[info] The AllBrowsersPerSuite trait
[info] - must provide a web driver [Firefox]
[info] The AllBrowsersPerSuite trait
[info] The AllBrowsersPerSuite trait
[info] The AllBrowsersPerSuite trait
[info] The AllBrowsersPerSuite trait
[info] The AllBrowsersPerSuite trait

Self Type
AllBrowsersPerSuite with TestSuite with ServerProvider
Source
AllBrowsersPerSuite.scala
Linear Supertypes
IntegrationPatience, Eventually, PatienceConfiguration, AbstractPatienceConfiguration, ScaledTimeSpans, WebBrowser, TestSuiteMixin, SuiteMixin, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AllBrowsersPerSuite
  2. IntegrationPatience
  3. Eventually
  4. PatienceConfiguration
  5. AbstractPatienceConfiguration
  6. ScaledTimeSpans
  7. WebBrowser
  8. TestSuiteMixin
  9. SuiteMixin
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. final class ActiveElementTarget extends SwitchTarget[Element]

    Permalink
    Definition Classes
    WebBrowser
  2. final class AlertTarget extends SwitchTarget[Alert]

    Permalink
    Definition Classes
    WebBrowser
  3. final class Checkbox extends Element

    Permalink
    Definition Classes
    WebBrowser
  4. case class ClassNameQuery extends Query with Product with Serializable

    Permalink
    Definition Classes
    WebBrowser
  5. final class ColorField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  6. class CookiesNoun extends AnyRef

    Permalink
    Definition Classes
    WebBrowser
  7. case class CssSelectorQuery extends Query with Product with Serializable

    Permalink
    Definition Classes
    WebBrowser
  8. final class DateField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  9. final class DateTimeField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  10. final class DateTimeLocalField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  11. final class DefaultContentTarget extends SwitchTarget[WebDriver]

    Permalink
    Definition Classes
    WebBrowser
  12. case class Dimension extends Product with Serializable

    Permalink
    Definition Classes
    WebBrowser
  13. sealed trait Element extends AnyRef

    Permalink
    Definition Classes
    WebBrowser
  14. final class EmailField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  15. final class FrameElementTarget extends SwitchTarget[WebDriver]

    Permalink
    Definition Classes
    WebBrowser
  16. final class FrameIndexTarget extends SwitchTarget[WebDriver]

    Permalink
    Definition Classes
    WebBrowser
  17. final class FrameNameOrIdTarget extends SwitchTarget[WebDriver]

    Permalink
    Definition Classes
    WebBrowser
  18. final class FrameWebElementTarget extends SwitchTarget[WebDriver]

    Permalink
    Definition Classes
    WebBrowser
  19. case class IdQuery extends Query with Product with Serializable

    Permalink
    Definition Classes
    WebBrowser
  20. case class LinkTextQuery extends Query with Product with Serializable

    Permalink
    Definition Classes
    WebBrowser
  21. final class MonthField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  22. class MultiSel extends Element

    Permalink
    Definition Classes
    WebBrowser
  23. class MultiSelOptionSeq extends IndexedSeq[String]

    Permalink
    Definition Classes
    WebBrowser
  24. case class NameQuery extends Query with Product with Serializable

    Permalink
    Definition Classes
    WebBrowser
  25. final class NumberField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  26. case class PartialLinkTextQuery extends Query with Product with Serializable

    Permalink
    Definition Classes
    WebBrowser
  27. final class PasswordField extends Element

    Permalink
    Definition Classes
    WebBrowser
  28. final case class PatienceConfig extends Product with Serializable

    Permalink
    Definition Classes
    AbstractPatienceConfiguration
  29. case class Point extends Product with Serializable

    Permalink
    Definition Classes
    WebBrowser
  30. sealed trait Query extends Product with Serializable

    Permalink
    Definition Classes
    WebBrowser
  31. final class RadioButton extends Element

    Permalink
    Definition Classes
    WebBrowser
  32. final class RadioButtonGroup extends AnyRef

    Permalink
    Definition Classes
    WebBrowser
  33. final class RangeField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  34. final class SearchField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  35. class SingleSel extends Element

    Permalink
    Definition Classes
    WebBrowser
  36. sealed abstract class SwitchTarget[T] extends AnyRef

    Permalink
    Definition Classes
    WebBrowser
  37. case class TagNameQuery extends Query with Product with Serializable

    Permalink
    Definition Classes
    WebBrowser
  38. final class TelField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  39. final class TextArea extends Element

    Permalink
    Definition Classes
    WebBrowser
  40. final class TextField extends Element

    Permalink
    Definition Classes
    WebBrowser
  41. final class TimeField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  42. final class UrlField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  43. trait ValueElement extends Element

    Permalink
    Definition Classes
    WebBrowser
  44. final class WeekField extends Element with ValueElement

    Permalink
    Definition Classes
    WebBrowser
  45. final class WindowTarget extends SwitchTarget[WebDriver]

    Permalink
    Definition Classes
    WebBrowser
  46. final class WrappedCookie extends AnyRef

    Permalink
    Definition Classes
    WebBrowser
  47. case class XPathQuery extends Query with Product with Serializable

    Permalink
    Definition Classes
    WebBrowser

Abstract Value Members

  1. abstract def expectedTestCount(filter: Filter): Int

    Permalink
    Definition Classes
    SuiteMixin
  2. abstract def nestedSuites: IndexedSeq[Suite]

    Permalink
    Definition Classes
    SuiteMixin
  3. abstract def rerunner: Option[String]

    Permalink
    Definition Classes
    SuiteMixin
  4. abstract def run(testName: Option[String], args: Args): Status

    Permalink
    Definition Classes
    SuiteMixin
  5. abstract def runNestedSuites(args: Args): Status

    Permalink
    Attributes
    protected
    Definition Classes
    SuiteMixin
  6. abstract def runTest(testName: String, args: Args): Status

    Permalink
    Attributes
    protected
    Definition Classes
    SuiteMixin
  7. abstract def sharedTests(browser: BrowserInfo): Unit

    Permalink

    Registers tests "shared" by multiple browsers.

    Registers tests "shared" by multiple browsers.

    Implement this method by placing tests you wish to run for multiple browsers. This method will be called during the initialization of this trait once for each browser whose BrowserInfo appears in the IndexedSeq referenced from the browsers field.

    Make sure you append browser.name to each test declared in sharedTests, to ensure they all have unique names. Here's an example:

    def sharedTests(browser: BrowserInfo) {
      "The blog app home page" must {
        "have the correct title " + browser.name in {
           go to (host + "index.html")
           pageTitle must be ("Awesome Blog")
        }
    

    If you don't append browser.name to each test name you'll likely be rewarded with a DuplicateTestNameException when you attempt to run the suite.

    browser

    the passed in BrowserInfo instance

  8. abstract val styleName: String

    Permalink
    Definition Classes
    SuiteMixin
  9. abstract def suiteId: String

    Permalink
    Definition Classes
    SuiteMixin
  10. abstract def suiteName: String

    Permalink
    Definition Classes
    SuiteMixin
  11. abstract def testDataFor(testName: String, theConfigMap: ConfigMap): TestData

    Permalink
    Definition Classes
    SuiteMixin
  12. abstract def testNames: Set[String]

    Permalink
    Definition Classes
    SuiteMixin

Concrete 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. val activeElement: (AllBrowsersPerSuite.this)#ActiveElementTarget

    Permalink
    Definition Classes
    WebBrowser
  5. def addCookie(name: String, value: String, path: String, expiry: Date, domain: String, secure: Boolean)(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  6. val alertBox: (AllBrowsersPerSuite.this)#AlertTarget

    Permalink
    Definition Classes
    WebBrowser
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. lazy val browsers: IndexedSeq[BrowserInfo]

    Permalink

    Info for available browsers.

    Info for available browsers. Override to add in custom BrowserInfo implementations.

    Attributes
    protected
  9. def captureTo(fileName: String)(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  10. def checkbox(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#Checkbox

    Permalink
    Definition Classes
    WebBrowser
  11. def checkbox(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#Checkbox

    Permalink
    Definition Classes
    WebBrowser
  12. def className(className: String): (AllBrowsersPerSuite.this)#ClassNameQuery

    Permalink
    Definition Classes
    WebBrowser
  13. def clickOn(element: (AllBrowsersPerSuite.this)#Element): Unit

    Permalink
    Definition Classes
    WebBrowser
  14. def clickOn(queryString: String)(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  15. def clickOn(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  16. def clickOn(element: WebElement): Unit

    Permalink
    Definition Classes
    WebBrowser
  17. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. def close()(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  19. def colorField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#ColorField

    Permalink
    Definition Classes
    WebBrowser
  20. def colorField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#ColorField

    Permalink
    Definition Classes
    WebBrowser
  21. def cookie(name: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#WrappedCookie

    Permalink
    Definition Classes
    WebBrowser
  22. val cookies: (AllBrowsersPerSuite.this)#CookiesNoun

    Permalink
    Definition Classes
    WebBrowser
  23. def cssSelector(cssSelector: String): (AllBrowsersPerSuite.this)#CssSelectorQuery

    Permalink
    Definition Classes
    WebBrowser
  24. def currentUrl(implicit driver: WebDriver): String

    Permalink
    Definition Classes
    WebBrowser
  25. def dateField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#DateField

    Permalink
    Definition Classes
    WebBrowser
  26. def dateField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#DateField

    Permalink
    Definition Classes
    WebBrowser
  27. def dateTimeField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#DateTimeField

    Permalink
    Definition Classes
    WebBrowser
  28. def dateTimeField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#DateTimeField

    Permalink
    Definition Classes
    WebBrowser
  29. def dateTimeLocalField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#DateTimeLocalField

    Permalink
    Definition Classes
    WebBrowser
  30. def dateTimeLocalField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#DateTimeLocalField

    Permalink
    Definition Classes
    WebBrowser
  31. val defaultContent: (AllBrowsersPerSuite.this)#DefaultContentTarget

    Permalink
    Definition Classes
    WebBrowser
  32. def deleteAllCookies()(implicit driver: WebDriver, pos: Position): Unit

    Permalink
    Definition Classes
    WebBrowser
  33. def deleteCookie(name: String)(implicit driver: WebDriver, pos: Position): Unit

    Permalink
    Definition Classes
    WebBrowser
  34. def emailField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#EmailField

    Permalink
    Definition Classes
    WebBrowser
  35. def emailField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#EmailField

    Permalink
    Definition Classes
    WebBrowser
  36. def enter(value: String)(implicit driver: WebDriver, pos: Position): Unit

    Permalink
    Definition Classes
    WebBrowser
  37. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  39. def eventually[T](fun: ⇒ T)(implicit config: (AllBrowsersPerSuite.this)#PatienceConfig, pos: Position): T

    Permalink
    Definition Classes
    Eventually
  40. def eventually[T](interval: Interval)(fun: ⇒ T)(implicit config: (AllBrowsersPerSuite.this)#PatienceConfig, pos: Position): T

    Permalink
    Definition Classes
    Eventually
  41. def eventually[T](timeout: Timeout)(fun: ⇒ T)(implicit config: (AllBrowsersPerSuite.this)#PatienceConfig, pos: Position): T

    Permalink
    Definition Classes
    Eventually
  42. def eventually[T](timeout: Timeout, interval: Interval)(fun: ⇒ T)(implicit pos: Position): T

    Permalink
    Definition Classes
    Eventually
  43. def executeAsyncScript(script: String, args: AnyRef*)(implicit driver: WebDriver): AnyRef

    Permalink
    Definition Classes
    WebBrowser
  44. def executeScript[T](script: String, args: AnyRef*)(implicit driver: WebDriver): AnyRef

    Permalink
    Definition Classes
    WebBrowser
  45. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  46. def find(queryString: String)(implicit driver: WebDriver): Option[(AllBrowsersPerSuite.this)#Element]

    Permalink
    Definition Classes
    WebBrowser
  47. def find(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver): Option[(AllBrowsersPerSuite.this)#Element]

    Permalink
    Definition Classes
    WebBrowser
  48. def findAll(queryString: String)(implicit driver: WebDriver): Iterator[(AllBrowsersPerSuite.this)#Element]

    Permalink
    Definition Classes
    WebBrowser
  49. def findAll(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver): Iterator[(AllBrowsersPerSuite.this)#Element]

    Permalink
    Definition Classes
    WebBrowser
  50. lazy val firefoxProfile: FirefoxProfile

    Permalink

    Method to provide FirefoxProfile for creating FirefoxDriver, you can override this method to provide a customized instance of FirefoxProfile

    Method to provide FirefoxProfile for creating FirefoxDriver, you can override this method to provide a customized instance of FirefoxProfile

    returns

    an instance of FirefoxProfile

    Attributes
    protected
  51. def frame(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver): (AllBrowsersPerSuite.this)#FrameWebElementTarget

    Permalink
    Definition Classes
    WebBrowser
  52. def frame(element: (AllBrowsersPerSuite.this)#Element): (AllBrowsersPerSuite.this)#FrameElementTarget

    Permalink
    Definition Classes
    WebBrowser
  53. def frame(element: WebElement): (AllBrowsersPerSuite.this)#FrameWebElementTarget

    Permalink
    Definition Classes
    WebBrowser
  54. def frame(nameOrId: String): (AllBrowsersPerSuite.this)#FrameNameOrIdTarget

    Permalink
    Definition Classes
    WebBrowser
  55. def frame(index: Int): (AllBrowsersPerSuite.this)#FrameIndexTarget

    Permalink
    Definition Classes
    WebBrowser
  56. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  57. def goBack()(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  58. def goForward()(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  59. def goTo(page: Page)(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  60. def goTo(url: String)(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  61. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  62. def id(elementId: String): (AllBrowsersPerSuite.this)#IdQuery

    Permalink
    Definition Classes
    WebBrowser
  63. def implicitlyWait(timeout: Span)(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  64. def interval(value: Span): Interval

    Permalink
    Definition Classes
    PatienceConfiguration
  65. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  66. def isScreenshotSupported(implicit driver: WebDriver): Boolean

    Permalink
    Definition Classes
    WebBrowser
  67. def linkText(linkText: String): (AllBrowsersPerSuite.this)#LinkTextQuery

    Permalink
    Definition Classes
    WebBrowser
  68. def monthField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#MonthField

    Permalink
    Definition Classes
    WebBrowser
  69. def monthField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#MonthField

    Permalink
    Definition Classes
    WebBrowser
  70. def multiSel(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#MultiSel

    Permalink
    Definition Classes
    WebBrowser
  71. def multiSel(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#MultiSel

    Permalink
    Definition Classes
    WebBrowser
  72. def name(elementName: String): (AllBrowsersPerSuite.this)#NameQuery

    Permalink
    Definition Classes
    WebBrowser
  73. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  76. def numberField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#NumberField

    Permalink
    Definition Classes
    WebBrowser
  77. def numberField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#NumberField

    Permalink
    Definition Classes
    WebBrowser
  78. def pageSource(implicit driver: WebDriver): String

    Permalink
    Definition Classes
    WebBrowser
  79. def pageTitle(implicit driver: WebDriver): String

    Permalink
    Definition Classes
    WebBrowser
  80. def partialLinkText(partialLinkText: String): (AllBrowsersPerSuite.this)#PartialLinkTextQuery

    Permalink
    Definition Classes
    WebBrowser
  81. implicit val patienceConfig: (AllBrowsersPerSuite.this)#PatienceConfig

    Permalink
    Definition Classes
    IntegrationPatience → AbstractPatienceConfiguration
  82. def pressKeys(value: String)(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  83. def pwdField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#PasswordField

    Permalink
    Definition Classes
    WebBrowser
  84. def pwdField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#PasswordField

    Permalink
    Definition Classes
    WebBrowser
  85. def quit()(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  86. def radioButton(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#RadioButton

    Permalink
    Definition Classes
    WebBrowser
  87. def radioButton(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#RadioButton

    Permalink
    Definition Classes
    WebBrowser
  88. def radioButtonGroup(groupName: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#RadioButtonGroup

    Permalink
    Definition Classes
    WebBrowser
  89. def rangeField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#RangeField

    Permalink
    Definition Classes
    WebBrowser
  90. def rangeField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#RangeField

    Permalink
    Definition Classes
    WebBrowser
  91. def reloadPage()(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  92. def runTests(testName: Option[String], args: Args): Status

    Permalink

    Invokes super.runTests, ensuring that the currently installed WebDriver (returned by webDriver) is closed, if necessary.

    Invokes super.runTests, ensuring that the currently installed WebDriver (returned by webDriver) is closed, if necessary. For more information on how this behavior fits into the big picture, see the documentatio for the withFixture method.

    testName

    an optional name of one test to run. If None, all relevant tests should be run. I.e., None acts like a wildcard that means run all relevant tests in this Suite.

    args

    the Args for this run

    returns

    a Status object that indicates when all tests and nested suites started by this method have completed, and whether or not a failure occurred.

    Definition Classes
    AllBrowsersPerSuite → SuiteMixin
  93. final def scaled(span: Span): Span

    Permalink
    Definition Classes
    ScaledTimeSpans
  94. def searchField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#SearchField

    Permalink
    Definition Classes
    WebBrowser
  95. def searchField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#SearchField

    Permalink
    Definition Classes
    WebBrowser
  96. def setCaptureDir(targetDirPath: String): Unit

    Permalink
    Definition Classes
    WebBrowser
  97. def setScriptTimeout(timeout: Span)(implicit driver: WebDriver): Unit

    Permalink
    Definition Classes
    WebBrowser
  98. def singleSel(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#SingleSel

    Permalink
    Definition Classes
    WebBrowser
  99. def singleSel(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#SingleSel

    Permalink
    Definition Classes
    WebBrowser
  100. def spanScaleFactor: Double

    Permalink
    Definition Classes
    ScaledTimeSpans
  101. def submit()(implicit driver: WebDriver, pos: Position): Unit

    Permalink
    Definition Classes
    WebBrowser
  102. def switchTo[T](target: (AllBrowsersPerSuite.this)#SwitchTarget[T])(implicit driver: WebDriver, pos: Position): T

    Permalink
    Definition Classes
    WebBrowser
  103. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  104. def tagName(tagName: String): (AllBrowsersPerSuite.this)#TagNameQuery

    Permalink
    Definition Classes
    WebBrowser
  105. def tags: Map[String, Set[String]]

    Permalink

    Automatically tag browser tests with browser tags based on the test name: if a test ends in a browser name in square brackets, it will be tagged as using that browser.

    Automatically tag browser tests with browser tags based on the test name: if a test ends in a browser name in square brackets, it will be tagged as using that browser. For example, if a test name ends in [Firefox], it will be tagged with org.scalatest.tags.FirefoxBrowser. The browser tags will be merged with tags returned from super.tags, so no existing tags will be lost when the browser tags are added.

    returns

    super.tags with additional browser tags added for any browser-specific tests

    Definition Classes
    AllBrowsersPerSuite → SuiteMixin
  106. def telField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#TelField

    Permalink
    Definition Classes
    WebBrowser
  107. def telField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#TelField

    Permalink
    Definition Classes
    WebBrowser
  108. def textArea(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#TextArea

    Permalink
    Definition Classes
    WebBrowser
  109. def textArea(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#TextArea

    Permalink
    Definition Classes
    WebBrowser
  110. def textField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#TextField

    Permalink
    Definition Classes
    WebBrowser
  111. def textField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#TextField

    Permalink
    Definition Classes
    WebBrowser
  112. def timeField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#TimeField

    Permalink
    Definition Classes
    WebBrowser
  113. def timeField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#TimeField

    Permalink
    Definition Classes
    WebBrowser
  114. def timeout(value: Span): Timeout

    Permalink
    Definition Classes
    PatienceConfiguration
  115. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  116. def urlField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#UrlField

    Permalink
    Definition Classes
    WebBrowser
  117. def urlField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#UrlField

    Permalink
    Definition Classes
    WebBrowser
  118. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  121. implicit def webDriver: WebDriver

    Permalink

    Implicit method to get the WebDriver for the current test.

  122. def weekField(queryString: String)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#WeekField

    Permalink
    Definition Classes
    WebBrowser
  123. def weekField(query: (AllBrowsersPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (AllBrowsersPerSuite.this)#WeekField

    Permalink
    Definition Classes
    WebBrowser
  124. def window(nameOrHandle: String): (AllBrowsersPerSuite.this)#WindowTarget

    Permalink
    Definition Classes
    WebBrowser
  125. def windowHandle(implicit driver: WebDriver): String

    Permalink
    Definition Classes
    WebBrowser
  126. def windowHandles(implicit driver: WebDriver): Set[String]

    Permalink
    Definition Classes
    WebBrowser
  127. def withFixture(test: (AllBrowsersPerSuite.this)#NoArgTest): Outcome

    Permalink

    Inspects the current test name and if it ends with the name of one of the BrowserInfos mentioned in the browsers IndexedSeq; if so, and a WebDriver of that type is already installed and being returned by webDriver, does nothing so that the current test can reuse the same browser used by the previous test; otherwise, closes the currently installed WebDriver, if necessary, and creates a new web driver by invoking createWebDriver on that BrowserInfo and, unless it is an UnavailableDriver, installs it so it will be returned by webDriver during the test.

    Inspects the current test name and if it ends with the name of one of the BrowserInfos mentioned in the browsers IndexedSeq; if so, and a WebDriver of that type is already installed and being returned by webDriver, does nothing so that the current test can reuse the same browser used by the previous test; otherwise, closes the currently installed WebDriver, if necessary, and creates a new web driver by invoking createWebDriver on that BrowserInfo and, unless it is an UnavailableDriver, installs it so it will be returned by webDriver during the test. (If the driver is unavailable on the host platform, the createWebDriver method will return UnavailableDriver, and this withFixture implementation will cancel the test automatically.) If the current test name does not end in a browser name, this withFixture method closes the currently installed WebDriver, if necessary, and installs BrowserInfo.UnneededDriver as the driver to be returned by webDriver during the test. If the test is not canceled because of an unavailable driver, this withFixture method invokes super.withFixture.

    Note that unlike AllBrowsersPerTest, this trait's withFixture method does not ensure that the WebDriver is closed after super.withFixture returns. Instead, this trait will close the currently installed WebDriver only when it needs to replace the currently installed driver with a new one. This just-in-time approach to closing WebDrivers is how this trait allows its shared tests to reuse the same browser, but will at the end of the day, leave the last WebDriver unclosed after withFixture returns for the last time. This last-used WebDriver will be closed, if necessary, by runTests instead.

    test

    the no-arg test function to run with a fixture

    returns

    the Outcome of the test execution

    Definition Classes
    AllBrowsersPerSuite → TestSuiteMixin
  128. def withScreenshot[T](fun: ⇒ T)(implicit driver: WebDriver): T

    Permalink
    Definition Classes
    WebBrowser
  129. def xpath(xpath: String): (AllBrowsersPerSuite.this)#XPathQuery

    Permalink
    Definition Classes
    WebBrowser

Inherited from IntegrationPatience

Inherited from Eventually

Inherited from PatienceConfiguration

Inherited from AbstractPatienceConfiguration

Inherited from ScaledTimeSpans

Inherited from WebBrowser

Inherited from TestSuiteMixin

Inherited from SuiteMixin

Inherited from AnyRef

Inherited from Any

Ungrouped