https://github.com/wongelz/guidebook
Pretty reports for selenium
https://github.com/wongelz/guidebook
scalatest selenium
Last synced: 2 months ago
JSON representation
Pretty reports for selenium
- Host: GitHub
- URL: https://github.com/wongelz/guidebook
- Owner: wongelz
- License: other
- Created: 2017-08-22T13:21:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-06-16T12:08:22.000Z (about 4 years ago)
- Last Synced: 2025-05-21T07:47:34.992Z (about 1 year ago)
- Topics: scalatest, selenium
- Language: Scala
- Homepage:
- Size: 249 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Guidebook
=========
Guidebook is an extension library and style guide for [Scalatest Selenium DSL](http://www.scalatest.org/user_guide/using_selenium)
for even simpler regression testing and producing a guidebook-style report for your tests.
 
Examples
========
[Sample project](https://github.com/wongelz/guidebook-examples/)
[Sample report](https://wongelz.github.io/guidebook-examples/index.html)
Usage
-----
1. Add the following to your build.sbt
```
libraryDependencies ++= Seq(
"com.github.wongelz" %% "guidebook" % "0.4.5" % Test
)
testOptions in Test ++= Seq(
Tests.Argument(TestFrameworks.ScalaTest, "-o"),
Tests.Argument(TestFrameworks.ScalaTest, "-C", "com.github.wongelz.guidebook.GuidebookReporter")
)
```
(Optional) If parallel browser windows (suite executions) are causing problems
```
parallelExecution in Test := false
```
2. Your test classes should extend `Guidebook`
3. Run your tests using sbt. You need to specify a webdriver location for each browser you are testing.
eg. to test using Chrome and Firefox (gecko):
```
sbt -Dwebdriver.chrome.driver=/path/to/chromedriver -Dwebdriver.gecko.driver=/path/to/geckodriver test
```
4. Your test report will be available in `target/guidebook/index.html`.
Configuration
-------------
1. Changing the default screen size
```
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-Dscreen.default.size=640x1024")
```
2. Additional screen sizes
Guidebook can resize the browser to different sizes at the conclusion of each test and take a screenshot at each size.
An additional report will be generated for each additional size, giving you view of how your site appears on different screen sizes.
Note that there is no test execution under these sizes.
Up to 5 additional sizes can be configured.
```
testOptions in Test ++= Seq(
Tests.Argument(TestFrameworks.ScalaTest, "-Dscreen.1.size=640x1024"),
Tests.Argument(TestFrameworks.ScalaTest, "-Dscreen.2.size=600x400"),
...
Tests.Argument(TestFrameworks.ScalaTest, "-Dscreen.5.size=2000x1000")
)
```