trait OneBrowserPerSuite extends TestSuiteMixin with WebBrowser with Eventually with IntegrationPatience with BrowserFactory
Trait that provides a new Selenium WebDriver
instance per ScalaTest Suite
.
This TestSuiteMixin
trait's overridden run
method
places a reference to the WebDriver
provided by webDriver
under the key org.scalatestplus.play.webDriver
.
This allows any nested Suite
s to access the Suite
's
WebDriver
as well, most easily by having the nested Suite
s mix in the
ConfiguredBrowser trait. On the status returned by super.run
, this
trait's overridden run
method registers a block of code to close the WebDriver
to be executed when the Status
completes, and returns the same Status
. This ensures the WebDriver
will continue to be available until
all nested suites have completed, after which the WebDriver
will be closed.
This trait also overrides Suite.withFixture
to cancel tests automatically if the related
WebDriver
is not available on the host platform.
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, OneServerPerTest,
ConfiguredServer before you mix in this trait. Your choice among these three
ServerProvider
s will determine the extent to which one or more TestServer
s are shared by multiple tests.
Here's an example that shows demonstrates of the services provided by this trait. Note that to use this trait, you must mix in one of the driver factories (this example mixes in FirefoxFactory):
package org.scalatestplus.play.examples.onebrowserpersuite import org.scalatest.tags.FirefoxBrowser import org.scalatestplus.play._ import play.api.{Play, Application} import play.api.inject.guice._ import play.api.routing._ @FirefoxBrowser class ExampleSpec extends PlaySpec with OneServerPerSuite with OneBrowserPerSuite with FirefoxFactory { // Override fakeApplication() if you need a Application with other than non-default parameters. def fakeApplication(): Application = new GuiceApplicationBuilder() .configure("foo" -> "bar", "ehcacheplugin" -> "disabled") .router(TestRoutes.router) .build() "The OneBrowserPerSuite trait" must { "provide an Application" in { app.configuration.getOptional[String]("ehcacheplugin") mustBe Some("disabled") } "make the Application available implicitly" in { def getConfig(key: String)(implicit app: Application) = app.configuration.getOptional[String](key) getConfig("ehcacheplugin") mustBe Some("disabled") } "provide an http endpoint" in { runningServer.endpoints.httpEndpoint must not be empty } "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() } "provide a web driver" in { go to ("http://localhost:" + port + "/testing") pageTitle mustBe "Test Page" click on find(name("b")).value eventually { pageTitle mustBe "scalatest" } } } }
If you have many tests that can share the same Application
, TestServer
, and WebDriver
, and you don't want to put them all into one
test class, you can place them into different "nested" Suite
classes.
Create a master suite that extends OneServerPerSuite
and declares the nested
Suite
s. Annotate the nested suites with @DoNotDiscover
and have them extend ConfiguredBrowser
. Here's an example:
package org.scalatestplus.play.examples.onebrowserpersuite import org.scalatest._ import tags.FirefoxBrowser import org.scalatestplus.play._ import play.api.{Play, Application} // This is the "master" suite class NestedExampleSpec extends Suites( new OneSpec, new TwoSpec, new RedSpec, new BlueSpec ) with OneServerPerSuite with OneBrowserPerSuite with FirefoxFactory { // Override fakeApplication() if you need a Application with other than non-default parameters. def fakeApplication(): Application = new GuiceApplicationBuilder( additionalConfiguration = Map("ehcacheplugin" -> "disabled"), withRoutes = TestRoute ).build() } // These are the nested suites @DoNotDiscover class OneSpec extends PlaySpec with ConfiguredServer with ConfiguredBrowser @DoNotDiscover class TwoSpec extends PlaySpec with ConfiguredServer with ConfiguredBrowser @DoNotDiscover class RedSpec extends PlaySpec with ConfiguredServer with ConfiguredBrowser @DoNotDiscover class BlueSpec extends PlaySpec with ConfiguredServer with ConfiguredBrowser { "The OneBrowserPerSuite trait" must { "provide an Application" in { app.configuration.getOptional[String]("ehcacheplugin") mustBe Some("disabled") } "make the Application available implicitly" in { def getConfig(key: String)(implicit app: Application) = app.configuration.getOptional[String](key) getConfig("ehcacheplugin") mustBe Some("disabled") } "provide an http endpoint" in { runningServer.endpoints.httpEndpoint must not be empty } "provide an actual running server" in { import Helpers._ 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() } } }
It is possible to use OneBrowserPerSuite
to run the same tests in more than one browser. Nevertheless,
you should consider the approach taken by AllBrowsersPerSuite
and AllBrowsersPerTest
instead, as it requires a bit less boilerplate code than OneBrowserPerSuite
to test in multiple browsers.
If you prefer to use OneBrowserPerSuite
, however, simply place your tests in an abstract superclass, then define concrete subclasses
for each browser you wish to test against. Here's an example:
package org.scalatestplus.play.examples.onebrowserpersuite import play.api.test._ import org.scalatest._ import tags._ import org.scalatestplus.play._ import play.api.{Play, Application} // Place your tests in an abstract class abstract class MultiBrowserExampleSpec extends PlaySpec with OneServerPerSuite with OneBrowserPerSuite { // Override app if you need an Application with other than non-default parameters. def fakeApplication(): Application = new GuiceApplicationBuilder( additionalConfiguration = Map("ehcacheplugin" -> "disabled"), withRoutes = TestRoute ).build "The OneBrowserPerSuite trait" must { "provide an Application" in { app.configuration.getOptional[String]("ehcacheplugin") mustBe Some("disabled") } "make the Application available implicitly" in { def getConfig(key: String)(implicit app: Application) = app.configuration.getOptional[String](key) getConfig("ehcacheplugin") mustBe Some("disabled") } "provide an http endpoint" in { runningServer.endpoints.httpEndpoint must not be empty } "provide an actual running server" in { import Helpers._ 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() } "provide a web driver" in { go to ("http://localhost:" + port + "/testing") pageTitle mustBe "Test Page" click on find(name("b")).value eventually { pageTitle mustBe "scalatest" } } } } // Then make a subclass that mixes in the factory for each // Selenium driver you want to test with. @FirefoxBrowser class FirefoxExampleSpec extends MultiBrowserExampleSpec with FirefoxFactory @SafariBrowser class SafariExampleSpec extends MultiBrowserExampleSpec with SafariFactory @InternetExplorerBrowser class InternetExplorerExampleSpec extends MultiBrowserExampleSpec with InternetExplorerFactory @ChromeBrowser class ChromeExampleSpec extends MultiBrowserExampleSpec with ChromeFactory @HtmlUnitBrowser class HtmlUnitExampleSpec extends MultiBrowserExampleSpec with HtmlUnitFactory
The concrete subclasses include tag annotations describing the browser used to make it easier to include or exclude browsers in specific runs. This is not strictly necessary since if a browser is not supported on the host platform the tests will be automatically canceled. For example, here's how the output would look if you ran the above tests on a platform that did not support Selenium drivers for Chrome or Internet Explorer using sbt:
> test-only *onebrowserpersuite* [info] FirefoxExampleSpec: [info] The OneBrowserPerSuite trait [info] - must provide an Application [info] - must make the Application available implicitly [info] - must start the Application [info] - must provide the port number [info] - must provide an actual running server [info] - must provide a web driver [info] SafariExampleSpec: [info] The OneBrowserPerSuite trait [info] - must provide an Application [info] - must make the Application available implicitly [info] - must start the Application [info] - must provide the port number [info] - must provide an actual running server [info] - must provide a web driver [info] InternetExplorerExampleSpec: [info] The OneBrowserPerSuite trait [info] - must provide an Application !!! CANCELED !!! [info] Was unable to create a Selenium InternetExplorerDriver on this platform. (OneBrowserPerSuite.scala:201) [info] - must make the Application available implicitly !!! CANCELED !!! [info] Was unable to create a Selenium InternetExplorerDriver on this platform. (OneBrowserPerSuite.scala:201) [info] - must start the Application !!! CANCELED !!! [info] Was unable to create a Selenium InternetExplorerDriver on this platform. (OneBrowserPerSuite.scala:201) [info] - must provide the port number !!! CANCELED !!! [info] Was unable to create a Selenium InternetExplorerDriver on this platform. (OneBrowserPerSuite.scala:201) [info] - must provide an actual running server !!! CANCELED !!! [info] Was unable to create a Selenium InternetExplorerDriver on this platform. (OneBrowserPerSuite.scala:201) [info] - must provide a web driver !!! CANCELED !!! [info] Was unable to create a Selenium InternetExplorerDriver on this platform. (OneBrowserPerSuite.scala:201) [info] ChromeExampleSpec: [info] The OneBrowserPerSuite trait [info] - must provide an Application !!! CANCELED !!! [info] Was unable to create a Selenium ChromeDriver on this platform. (OneBrowserPerSuite.scala:201) [info] - must make the Application available implicitly !!! CANCELED !!! [info] Was unable to create a Selenium ChromeDriver on this platform. (OneBrowserPerSuite.scala:201) [info] - must start the Application !!! CANCELED !!! [info] Was unable to create a Selenium ChromeDriver on this platform. (OneBrowserPerSuite.scala:201) [info] - must provide the port number !!! CANCELED !!! [info] Was unable to create a Selenium ChromeDriver on this platform. (OneBrowserPerSuite.scala:201) [info] - must provide an actual running server !!! CANCELED !!! [info] Was unable to create a Selenium ChromeDriver on this platform. (OneBrowserPerSuite.scala:201) [info] - must provide a web driver !!! CANCELED !!! [info] Was unable to create a Selenium ChromeDriver on this platform. (OneBrowserPerSuite.scala:201) [info] HtmlUnitExampleSpec: [info] The OneBrowserPerSuite trait [info] - must provide an Application [info] - must make the Application available implicitly [info] - must start the Application [info] - must provide the port number [info] - must provide an actual running server [info] - must provide a web driver
For comparison, here is what the output would look like if you just selected tests tagged with FirefoxBrowser
in sbt:
> test-only *onebrowserpersuite* -- -n org.scalatest.tags.FirefoxBrowser [info] FirefoxExampleSpec: [info] The OneBrowserPerSuite trait [info] - must provide an Application [info] - must make the Application available implicitly [info] - must start the Application [info] - must provide the port number [info] - must provide an actual running server [info] - must provide a web driver [info] SafariExampleSpec: [info] The OneBrowserPerSuite trait [info] InternetExplorerExampleSpec: [info] The OneBrowserPerSuite trait [info] ChromeExampleSpec: [info] The OneBrowserPerSuite trait [info] HtmlUnitExampleSpec: [info] The OneBrowserPerSuite trait
- Self Type
- OneBrowserPerSuite with TestSuite with ServerProvider
- Source
- OneBrowserPerSuite.scala
- Alphabetic
- By Inheritance
- OneBrowserPerSuite
- BrowserFactory
- IntegrationPatience
- Eventually
- PatienceConfiguration
- AbstractPatienceConfiguration
- ScaledTimeSpans
- WebBrowser
- TestSuiteMixin
- SuiteMixin
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
final
class
ActiveElementTarget extends SwitchTarget[Element]
- Definition Classes
- WebBrowser
-
final
class
AlertTarget extends SwitchTarget[Alert]
- Definition Classes
- WebBrowser
-
final
class
Checkbox extends Element
- Definition Classes
- WebBrowser
-
case class
ClassNameQuery extends Query with Product with Serializable
- Definition Classes
- WebBrowser
-
final
class
ColorField extends ValueElement
- Definition Classes
- WebBrowser
-
class
CookiesNoun extends AnyRef
- Definition Classes
- WebBrowser
-
case class
CssSelectorQuery extends Query with Product with Serializable
- Definition Classes
- WebBrowser
-
final
class
DateField extends ValueElement
- Definition Classes
- WebBrowser
-
final
class
DateTimeField extends ValueElement
- Definition Classes
- WebBrowser
-
final
class
DateTimeLocalField extends ValueElement
- Definition Classes
- WebBrowser
-
final
class
DefaultContentTarget extends SwitchTarget[WebDriver]
- Definition Classes
- WebBrowser
-
case class
Dimension extends Product with Serializable
- Definition Classes
- WebBrowser
-
sealed
trait
Element extends AnyRef
- Definition Classes
- WebBrowser
-
final
class
EmailField extends ValueElement
- Definition Classes
- WebBrowser
-
final
class
FrameElementTarget extends SwitchTarget[WebDriver]
- Definition Classes
- WebBrowser
-
final
class
FrameIndexTarget extends SwitchTarget[WebDriver]
- Definition Classes
- WebBrowser
-
final
class
FrameNameOrIdTarget extends SwitchTarget[WebDriver]
- Definition Classes
- WebBrowser
-
final
class
FrameWebElementTarget extends SwitchTarget[WebDriver]
- Definition Classes
- WebBrowser
-
case class
IdQuery extends Query with Product with Serializable
- Definition Classes
- WebBrowser
-
case class
LinkTextQuery extends Query with Product with Serializable
- Definition Classes
- WebBrowser
-
final
class
MonthField extends ValueElement
- Definition Classes
- WebBrowser
-
class
MultiSel extends Element
- Definition Classes
- WebBrowser
-
class
MultiSelOptionSeq extends IndexedSeq[String]
- Definition Classes
- WebBrowser
-
case class
NameQuery extends Query with Product with Serializable
- Definition Classes
- WebBrowser
-
final
class
NumberField extends ValueElement
- Definition Classes
- WebBrowser
-
case class
PartialLinkTextQuery extends Query with Product with Serializable
- Definition Classes
- WebBrowser
-
final
class
PasswordField extends ValueElement
- Definition Classes
- WebBrowser
-
final
case class
PatienceConfig extends Product with Serializable
- Definition Classes
- AbstractPatienceConfiguration
-
case class
Point extends Product with Serializable
- Definition Classes
- WebBrowser
-
sealed
trait
Query extends Product with Serializable
- Definition Classes
- WebBrowser
-
final
class
RadioButton extends Element
- Definition Classes
- WebBrowser
-
final
class
RadioButtonGroup extends AnyRef
- Definition Classes
- WebBrowser
-
final
class
RangeField extends ValueElement
- Definition Classes
- WebBrowser
-
final
class
SearchField extends ValueElement
- Definition Classes
- WebBrowser
-
class
SingleSel extends Element
- Definition Classes
- WebBrowser
-
sealed abstract
class
SwitchTarget[T] extends AnyRef
- Definition Classes
- WebBrowser
-
case class
TagNameQuery extends Query with Product with Serializable
- Definition Classes
- WebBrowser
-
final
class
TelField extends ValueElement
- Definition Classes
- WebBrowser
-
final
class
TextArea extends ValueElement
- Definition Classes
- WebBrowser
-
final
class
TextField extends ValueElement
- Definition Classes
- WebBrowser
-
final
class
TimeField extends ValueElement
- Definition Classes
- WebBrowser
-
final
class
UrlField extends ValueElement
- Definition Classes
- WebBrowser
-
trait
ValueElement extends Element
- Definition Classes
- WebBrowser
-
final
class
WeekField extends ValueElement
- Definition Classes
- WebBrowser
-
final
class
WindowTarget extends SwitchTarget[WebDriver]
- Definition Classes
- WebBrowser
-
final
class
WrappedCookie extends AnyRef
- Definition Classes
- WebBrowser
-
case class
XPathQuery extends Query with Product with Serializable
- Definition Classes
- WebBrowser
Abstract Value Members
-
abstract
def
createWebDriver(): WebDriver
Creates a new instance of a valid Selenium
WebDriver
, or if a driver is unavailable on the host platform, returns a BrowserFactory.UnavailableDriver that includes the exception that indicated the driver was not supported on the host platform and an appropriate error message.Creates a new instance of a valid Selenium
WebDriver
, or if a driver is unavailable on the host platform, returns a BrowserFactory.UnavailableDriver that includes the exception that indicated the driver was not supported on the host platform and an appropriate error message.- returns
an new instance of a Selenium
WebDriver
, or a BrowserFactory.UnavailableDriver if the desiredWebDriver
is not available on the host platform.
- Definition Classes
- BrowserFactory
-
abstract
def
expectedTestCount(filter: Filter): Int
- Definition Classes
- SuiteMixin
-
abstract
def
nestedSuites: IndexedSeq[Suite]
- Definition Classes
- SuiteMixin
-
abstract
def
rerunner: Option[String]
- Definition Classes
- SuiteMixin
-
abstract
def
runNestedSuites(args: Args): Status
- Attributes
- protected
- Definition Classes
- SuiteMixin
-
abstract
def
runTest(testName: String, args: Args): Status
- Attributes
- protected
- Definition Classes
- SuiteMixin
-
abstract
def
runTests(testName: Option[String], args: Args): Status
- Attributes
- protected
- Definition Classes
- SuiteMixin
-
abstract
val
styleName: String
- Definition Classes
- SuiteMixin
-
abstract
def
suiteId: String
- Definition Classes
- SuiteMixin
-
abstract
def
suiteName: String
- Definition Classes
- SuiteMixin
-
abstract
def
tags: Map[String, Set[String]]
- Definition Classes
- SuiteMixin
-
abstract
def
testDataFor(testName: String, theConfigMap: ConfigMap): TestData
- Definition Classes
- SuiteMixin
-
abstract
def
testNames: Set[String]
- Definition Classes
- SuiteMixin
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
activeElement: (OneBrowserPerSuite.this)#ActiveElementTarget
- Definition Classes
- WebBrowser
-
def
addCookie(name: String, value: String, path: String, expiry: Date, domain: String, secure: Boolean)(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
val
alertBox: (OneBrowserPerSuite.this)#AlertTarget
- Definition Classes
- WebBrowser
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
captureTo(fileName: String)(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
checkbox(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#Checkbox
- Definition Classes
- WebBrowser
-
def
checkbox(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#Checkbox
- Definition Classes
- WebBrowser
-
def
className(className: String): (OneBrowserPerSuite.this)#ClassNameQuery
- Definition Classes
- WebBrowser
-
def
clickOn(element: (OneBrowserPerSuite.this)#Element): Unit
- Definition Classes
- WebBrowser
-
def
clickOn(queryString: String)(implicit driver: WebDriver, pos: Position): Unit
- Definition Classes
- WebBrowser
-
def
clickOn(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
clickOn(element: WebElement): Unit
- Definition Classes
- WebBrowser
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
close()(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
colorField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#ColorField
- Definition Classes
- WebBrowser
-
def
colorField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#ColorField
- Definition Classes
- WebBrowser
-
def
cookie(name: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#WrappedCookie
- Definition Classes
- WebBrowser
-
val
cookies: (OneBrowserPerSuite.this)#CookiesNoun
- Definition Classes
- WebBrowser
-
def
cssSelector(cssSelector: String): (OneBrowserPerSuite.this)#CssSelectorQuery
- Definition Classes
- WebBrowser
-
def
currentUrl(implicit driver: WebDriver): String
- Definition Classes
- WebBrowser
-
def
dateField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#DateField
- Definition Classes
- WebBrowser
-
def
dateField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#DateField
- Definition Classes
- WebBrowser
-
def
dateTimeField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#DateTimeField
- Definition Classes
- WebBrowser
-
def
dateTimeField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#DateTimeField
- Definition Classes
- WebBrowser
-
def
dateTimeLocalField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#DateTimeLocalField
- Definition Classes
- WebBrowser
-
def
dateTimeLocalField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#DateTimeLocalField
- Definition Classes
- WebBrowser
-
val
defaultContent: (OneBrowserPerSuite.this)#DefaultContentTarget
- Definition Classes
- WebBrowser
-
def
deleteAllCookies()(implicit driver: WebDriver, pos: Position): Unit
- Definition Classes
- WebBrowser
-
def
deleteCookie(name: String)(implicit driver: WebDriver, pos: Position): Unit
- Definition Classes
- WebBrowser
-
def
emailField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#EmailField
- Definition Classes
- WebBrowser
-
def
emailField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#EmailField
- Definition Classes
- WebBrowser
-
def
enter(value: String)(implicit driver: WebDriver, pos: Position): Unit
- Definition Classes
- WebBrowser
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
eventually[T](fun: ⇒ T)(implicit config: (OneBrowserPerSuite.this)#PatienceConfig, pos: Position): T
- Definition Classes
- Eventually
-
def
eventually[T](interval: Interval)(fun: ⇒ T)(implicit config: (OneBrowserPerSuite.this)#PatienceConfig, pos: Position): T
- Definition Classes
- Eventually
-
def
eventually[T](timeout: Timeout)(fun: ⇒ T)(implicit config: (OneBrowserPerSuite.this)#PatienceConfig, pos: Position): T
- Definition Classes
- Eventually
-
def
eventually[T](timeout: Timeout, interval: Interval)(fun: ⇒ T)(implicit pos: Position): T
- Definition Classes
- Eventually
-
def
executeAsyncScript(script: String, args: AnyRef*)(implicit driver: WebDriver): AnyRef
- Definition Classes
- WebBrowser
-
def
executeScript[T](script: String, args: AnyRef*)(implicit driver: WebDriver): AnyRef
- Definition Classes
- WebBrowser
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
find(queryString: String)(implicit driver: WebDriver): Option[(OneBrowserPerSuite.this)#Element]
- Definition Classes
- WebBrowser
-
def
find(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver): Option[(OneBrowserPerSuite.this)#Element]
- Definition Classes
- WebBrowser
-
def
findAll(queryString: String)(implicit driver: WebDriver): Iterator[(OneBrowserPerSuite.this)#Element]
- Definition Classes
- WebBrowser
-
def
findAll(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver): Iterator[(OneBrowserPerSuite.this)#Element]
- Definition Classes
- WebBrowser
-
def
frame(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#FrameWebElementTarget
- Definition Classes
- WebBrowser
-
def
frame(element: (OneBrowserPerSuite.this)#Element): (OneBrowserPerSuite.this)#FrameElementTarget
- Definition Classes
- WebBrowser
-
def
frame(element: WebElement): (OneBrowserPerSuite.this)#FrameWebElementTarget
- Definition Classes
- WebBrowser
-
def
frame(nameOrId: String): (OneBrowserPerSuite.this)#FrameNameOrIdTarget
- Definition Classes
- WebBrowser
-
def
frame(index: Int): (OneBrowserPerSuite.this)#FrameIndexTarget
- Definition Classes
- WebBrowser
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
goBack()(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
goForward()(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
goTo(page: Page)(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
goTo(url: String)(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
id(elementId: String): (OneBrowserPerSuite.this)#IdQuery
- Definition Classes
- WebBrowser
-
def
implicitlyWait(timeout: Span)(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
interval(value: Span): Interval
- Definition Classes
- PatienceConfiguration
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isScreenshotSupported(implicit driver: WebDriver): Boolean
- Definition Classes
- WebBrowser
-
def
linkText(linkText: String): (OneBrowserPerSuite.this)#LinkTextQuery
- Definition Classes
- WebBrowser
-
def
monthField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#MonthField
- Definition Classes
- WebBrowser
-
def
monthField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#MonthField
- Definition Classes
- WebBrowser
-
def
multiSel(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#MultiSel
- Definition Classes
- WebBrowser
-
def
multiSel(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#MultiSel
- Definition Classes
- WebBrowser
-
def
name(elementName: String): (OneBrowserPerSuite.this)#NameQuery
- Definition Classes
- WebBrowser
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
numberField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#NumberField
- Definition Classes
- WebBrowser
-
def
numberField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#NumberField
- Definition Classes
- WebBrowser
-
def
pageSource(implicit driver: WebDriver): String
- Definition Classes
- WebBrowser
-
def
pageTitle(implicit driver: WebDriver): String
- Definition Classes
- WebBrowser
-
def
partialLinkText(partialLinkText: String): (OneBrowserPerSuite.this)#PartialLinkTextQuery
- Definition Classes
- WebBrowser
-
implicit
val
patienceConfig: (OneBrowserPerSuite.this)#PatienceConfig
- Definition Classes
- IntegrationPatience → AbstractPatienceConfiguration
-
def
pressKeys(value: String)(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
pwdField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#PasswordField
- Definition Classes
- WebBrowser
-
def
pwdField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#PasswordField
- Definition Classes
- WebBrowser
-
def
quit()(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
radioButton(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#RadioButton
- Definition Classes
- WebBrowser
-
def
radioButton(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#RadioButton
- Definition Classes
- WebBrowser
-
def
radioButtonGroup(groupName: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#RadioButtonGroup
- Definition Classes
- WebBrowser
-
def
rangeField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#RangeField
- Definition Classes
- WebBrowser
-
def
rangeField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#RangeField
- Definition Classes
- WebBrowser
-
def
reloadPage()(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
run(testName: Option[String], args: Args): Status
Places the
WebDriver
provided bywebDriver
into theConfigMap
under the keyorg.scalatestplus.play.webDriver
to make it available to nested suites; callssuper.run
; and lastly ensures theWebDriver
is stopped after all tests and nested suites have completed.Places the
WebDriver
provided bywebDriver
into theConfigMap
under the keyorg.scalatestplus.play.webDriver
to make it available to nested suites; callssuper.run
; and lastly ensures theWebDriver
is stopped after all tests and nested suites have completed.- 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 thisSuite
.- 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
- OneBrowserPerSuite → SuiteMixin
-
final
def
scaled(span: Span): Span
- Definition Classes
- ScaledTimeSpans
-
def
searchField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#SearchField
- Definition Classes
- WebBrowser
-
def
searchField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#SearchField
- Definition Classes
- WebBrowser
-
def
setCaptureDir(targetDirPath: String): Unit
- Definition Classes
- WebBrowser
-
def
setScriptTimeout(timeout: Span)(implicit driver: WebDriver): Unit
- Definition Classes
- WebBrowser
-
def
singleSel(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#SingleSel
- Definition Classes
- WebBrowser
-
def
singleSel(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#SingleSel
- Definition Classes
- WebBrowser
-
def
spanScaleFactor: Double
- Definition Classes
- ScaledTimeSpans
-
def
submit()(implicit driver: WebDriver, pos: Position): Unit
- Definition Classes
- WebBrowser
-
def
switchTo[T](target: (OneBrowserPerSuite.this)#SwitchTarget[T])(implicit driver: WebDriver, pos: Position): T
- Definition Classes
- WebBrowser
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tagName(tagName: String): (OneBrowserPerSuite.this)#TagNameQuery
- Definition Classes
- WebBrowser
-
def
telField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#TelField
- Definition Classes
- WebBrowser
-
def
telField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#TelField
- Definition Classes
- WebBrowser
-
def
textArea(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#TextArea
- Definition Classes
- WebBrowser
-
def
textArea(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#TextArea
- Definition Classes
- WebBrowser
-
def
textField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#TextField
- Definition Classes
- WebBrowser
-
def
textField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#TextField
- Definition Classes
- WebBrowser
-
def
timeField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#TimeField
- Definition Classes
- WebBrowser
-
def
timeField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#TimeField
- Definition Classes
- WebBrowser
-
def
timeout(value: Span): Timeout
- Definition Classes
- PatienceConfiguration
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
urlField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#UrlField
- Definition Classes
- WebBrowser
-
def
urlField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#UrlField
- Definition Classes
- WebBrowser
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
implicit
lazy val
webDriver: WebDriver
An implicit instance of
WebDriver
, created by callingcreateWebDriver
.An implicit instance of
WebDriver
, created by callingcreateWebDriver
. If there is an error when creating theWebDriver
,UnavailableDriver
will be assigned instead. -
def
weekField(queryString: String)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#WeekField
- Definition Classes
- WebBrowser
-
def
weekField(query: (OneBrowserPerSuite.this)#Query)(implicit driver: WebDriver, pos: Position): (OneBrowserPerSuite.this)#WeekField
- Definition Classes
- WebBrowser
-
def
window(nameOrHandle: String): (OneBrowserPerSuite.this)#WindowTarget
- Definition Classes
- WebBrowser
-
def
windowHandle(implicit driver: WebDriver): String
- Definition Classes
- WebBrowser
-
def
windowHandles(implicit driver: WebDriver): Set[String]
- Definition Classes
- WebBrowser
-
def
withFixture(test: (OneBrowserPerSuite.this)#NoArgTest): Outcome
Automatically cancels tests with an appropriate error message when the
webDriver
field is aUnavailableDriver
, else callssuper.withFixture(test)
Automatically cancels tests with an appropriate error message when the
webDriver
field is aUnavailableDriver
, else callssuper.withFixture(test)
- Definition Classes
- OneBrowserPerSuite → TestSuiteMixin
-
def
withScreenshot[T](fun: ⇒ T)(implicit driver: WebDriver): T
- Definition Classes
- WebBrowser
-
def
xpath(xpath: String): (OneBrowserPerSuite.this)#XPathQuery
- Definition Classes
- WebBrowser