PageObject is a Page Object Pattern implementation written in Scala.
PageObject is a free, open-source (Apache Licence v2) extension for test runners implementing the Page Object Pattern. Currently only ScalaTest 3 is supported, but other testing frameworks should be easy to add.
The PageObject library was developed with this goals in mind:
- PageObject should be easy to use
- A clear structure
- PageObjects for pages
- PageModules for page content
- write just tests, not infrastructure
- prevent boilerplate code where possible
- no need to manage browsers yourself
- browser selection at runtime, not at class level
- direct selenium access should not be needed (but possible if wanted)
We created an overview presentation showing you how to use PageObject to create tests using ScalaTest:
- Google Slides: PageObject Tour (online, you can send us comments)
- Download as PDF (download hosted on pageobject.org).
You can find the Changelog here: https://github.com/agido/pageobject/blob/master/CHANGELOG.md.
The current version of PageObject is 0.3.0. This Version is available at maven central.
Scala versions 2.11.x and 2.12.x are supported.
To use PageObject, add this lines to yours build.sbt:
libraryDependencies += "org.pageobject" %% "scalatest" % "0.3.0"
pageobject requires Selenium 3. Because Selenium 3 requires Java 8 pageobject also requires Java 8.
You can also use maven to run your tests. See maven-howto for a small maven howto.
The code is hosted and developed in the PageObject GitHub repository.
If you want to use a development version you can find a list of all snapshot versions here. Alternative you can checkout this repository and run
$ sbt publishLocal if you want to modify or try it out.
If you want to use a SNAPSHOT version add this lines to your build config:
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" libraryDependencies += "org.pageobject" %% "scalatest" % "0.4.0-SNAPSHOT"
<!-- to allow snapshot versions --> <repositories> <repository> <id>sonatype-oss-snapshots</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories>