# Stash Smoke Tests

This modules is for smoke testing Stash.

## Running

To run the smoke tests you need to specify the following:

    mvn -am -Pit.smoke -pl func-test/smoke -Dtest.url=[url] -Dtest.username=[username] -Dtest.password=[password] -Dtest.version=[version] -Dtest.reviewer=[username] test

Where `version` is the major version of Stash expected to be used under the Help menu (ie 2.6) but can be longer (i.e. 2.6.0-rc1)
`test.reviewer` must be different to `test.username` so they can be added to their review.

## Testing

Scala comes with a nice REPL, which you can use to play with the Stash page objects. To get starts:

    mvn -Pit.smoke -pl func-test/smoke org.scala-tools:maven-scala-plugin:console

And then:

    import com.atlassian.stash.smoke.SmokeTest._
    init("http://localhost:7990/bitbucket")
    val projectPage = loginAs(classOf[com.atlassian.webdriver.bitbucket.page.ProjectListPage], "admin", "admin")

If you want to list all of the project keys:

    import scala.collection.JavaConverters._
    projectPage.getProjectTable.getProjects.asScala.map(_.getProjectKey)

And so on...
