Skip to content
jesseeichar edited this page Jun 14, 2011 · 8 revisions

WebSpecs

WebSpecs is a way to write comprehensive tests that can exercise all aspects of a web application from server side service style interfaces to driving the user interface via a browser.

Running a test

The easiest way to run a test is to launch sbt (the build tool):

./xsbt -Dadmin.user=<username> -Dadmin.pass=<password> -Dwebspecs.config=<path to configuration>

Then execute the test using the form:

<project>/test-only <package and name of test to execute>

or if you want to run all tests:

<project>/test

or if you want the HTML output

<project>/run-test-suite

Configuration

WebSpecs is a generic framework for testing web application and there for the server under test must be specified. As does several parameters depending on the service.

To boot strap the configuration loading at minimum a directive is required to indicate either the strategy for loading the configuration (webspecs.config.resolver) or a path to the configuration to load if the default resolve is used (webspecs.config). Typically only the path to the configuration file is required but there may be situations where the configuration is stored in a database, in that case an alternative ConfigFileResolver is required. Let us assume for now that the DefaultFileResolver is to be used. In this case -Dwebspecs.config=<path to config> can be used to load the configuration files.

The normally the configuration is as follows:

  • admin.user - the username for the administrator of the webapp. This is often required but depending on the tests may not be.
  • admin.pass - the password for said administrator
  • webspecs.config - a file
Clone this wiki locally