play.api.test

package play.api.test

Contains test helpers.

Attributes

Members list

Type members

Classlikes

Mixin with helpers for creating ApplicationFactory objects.

Mixin with helpers for creating ApplicationFactory objects.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ApplicationFactory.type

Creates an Application. Usually created by a helper in ApplicationFactories.

Creates an Application. Usually created by a helper in ApplicationFactories.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Helpers.type

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Creates a server for an application with a random HTTP port bound. To change the HTTP port you can pass a testserver.port system property. The HTTPS port by default is not bound, but can be enabled by passing the testserver.httpsport system property. If it gets bound it will be using a self-signed certificate.

Creates a server for an application with a random HTTP port bound. To change the HTTP port you can pass a testserver.port system property. The HTTPS port by default is not bound, but can be enabled by passing the testserver.httpsport system property. If it gets bound it will be using a self-signed certificate.

Most logic in this class is in a protected method so that users can extend the class and override its logic.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Helpers.type
Self type
case class FakeHeaders(data: Seq[(String, String)]) extends Headers

Fake HTTP headers implementation.

Fake HTTP headers implementation.

Value parameters

data

Headers data.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Headers
class Object
trait Matchable
class Any
Show all
class FakeRequest[+A](request: Request[A]) extends Request[A]

A Request with a few extra methods that are useful for testing.

A Request with a few extra methods that are useful for testing.

Type parameters

A

the body content type.

Value parameters

request

The original request that this FakeRequest wraps.

Attributes

Companion
object
Supertypes
trait Request[A]
class Object
trait Matchable
class Any

Object with helper methods for building FakeRequest values. This object uses a play.api.mvc.request.DefaultRequestFactory with default configuration to build the requests.

Object with helper methods for building FakeRequest values. This object uses a play.api.mvc.request.DefaultRequestFactory with default configuration to build the requests.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class FakeRequestFactory(requestFactory: RequestFactory)

Helper methods for building FakeRequest values.

Helper methods for building FakeRequest values.

Value parameters

requestFactory

Used to construct the wrapped requests.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object FakeRequest.type
trait FutureAwaits

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Helpers.type
Self type
final class HttpServerEndpointRecipe(val description: String, val serverProvider: ServerProvider, extraServerConfiguration: Configuration, expectedHttpVersions: Set[String], expectedServerAttr: Option[String]) extends ServerEndpointRecipe

Provides a recipe for making an HTTP ServerEndpoint.

Provides a recipe for making an HTTP ServerEndpoint.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
final class HttpsServerEndpointRecipe(val description: String, val serverProvider: ServerProvider, extraServerConfiguration: Configuration, expectedHttpVersions: Set[String], expectedServerAttr: Option[String]) extends ServerEndpointRecipe

Provides a recipe for making an HTTPS ServerEndpoint.

Provides a recipe for making an HTTPS ServerEndpoint.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
trait Injecting

A trait declared on a class that contains an def app: Application, and can provide instances of a class. Useful in integration tests.

A trait declared on a class that contains an def app: Application, and can provide instances of a class. Useful in integration tests.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

A temporary file creator with no implementation.

A temporary file creator with no implementation.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
trait PlayRunners extends HttpVerbs

Helper functions to run tests.

Helper functions to run tests.

Attributes

Companion
object
Supertypes
trait HttpVerbs
class Object
trait Matchable
class Any
Known subtypes
object Helpers.type
object PlayRunners

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Helpers.type
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Helpers.type
Self type
final case class RunningServer(app: Application, endpoints: ServerEndpoints, stopServer: AutoCloseable)

Contains information about a running TestServer. This object can be used by tests to find out about the running server, e.g. port information.

Contains information about a running TestServer. This object can be used by tests to find out about the running server, e.g. port information.

We use a separate class to avoid including mutable state, such as methods for closing the server.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

A recipe for making a ServerEndpoint. Recipes are often used when describing which tests to run. The recipe can be used to start servers with the correct ServerEndpoints.

A recipe for making a ServerEndpoint. Recipes are often used when describing which tests to run. The recipe can be used to start servers with the correct ServerEndpoints.

Attributes

See also
Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
Known subtypes
object Helpers.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class TestBrowser(webDriver: WebDriver, baseUrl: Option[String]) extends FluentAdapter

A test browser (Using Selenium WebDriver) with the FluentLenium API (https://github.com/Fluentlenium/FluentLenium).

A test browser (Using Selenium WebDriver) with the FluentLenium API (https://github.com/Fluentlenium/FluentLenium).

Value parameters

webDriver

The WebDriver instance to use.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class FluentAdapter
trait IFluentAdapter
class FluentControlImpl
trait FluentControl
trait ChromiumControl
trait Configuration
trait ConfigurationMutator
trait ConfigurationProperties
trait PerformanceTimingControl
trait CapabilitiesControl
trait ComponentInstantiator
trait FluentInjectControl
trait CssControl
trait SeleniumDriverControl
trait NavigationControl
trait EventsControl
trait SnapshotControl
trait AlertControl
trait JavascriptControl
trait InputControl
trait AwaitControl
trait SearchControl[FluentWebElement]
class Object
trait Matchable
class Any
Show all
object TestBrowser

Helper utilities to build TestBrowsers

Helper utilities to build TestBrowsers

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class TestServer(config: ServerConfig, application: Application, serverProvider: Option[ServerProvider])

A test web server.

A test web server.

Value parameters

application

The Application to load in this server.

config

The server configuration.

serverProvider

The type of server to use. If not provided, uses Play's default provider.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TestServer

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
TestServer.type

Creates a server for an application.

Creates a server for an application.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
trait Writeables

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Helpers.type

Types

type HasApp = { def app: Application; }

A structural type indicating there is an application.

A structural type indicating there is an application.

Attributes

type Port = Int

Provided as an implicit by WithServer and WithBrowser.

Provided as an implicit by WithServer and WithBrowser.

Attributes