Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unic/scalawebtest
ScalaWebTest is a library for writing ScalaTest/Selenium based integration tests for web applications. It helps you with your basic setup and provides a new and very efficient approach to testing.
https://github.com/unic/scalawebtest
integration-testing scalatest selenium
Last synced: 3 months ago
JSON representation
ScalaWebTest is a library for writing ScalaTest/Selenium based integration tests for web applications. It helps you with your basic setup and provides a new and very efficient approach to testing.
- Host: GitHub
- URL: https://github.com/unic/scalawebtest
- Owner: unic
- License: apache-2.0
- Created: 2016-09-26T13:19:25.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-02-10T08:42:13.000Z (almost 2 years ago)
- Last Synced: 2024-09-29T02:05:45.152Z (3 months ago)
- Topics: integration-testing, scalatest, selenium
- Language: Scala
- Homepage: https://scalawebtest.org
- Size: 93.5 MB
- Stars: 29
- Watchers: 9
- Forks: 9
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [![ScalaWebTest](https://www.scalawebtest.org/images/swt-logo-light.png)](http://www.scalawebtest.org)
## [![Build Status](https://travis-ci.org/unic/ScalaWebTest.svg?branch=main)](https://travis-ci.org/unic/ScalaWebTest) [![Join the chat at https://gitter.im/ScalaWebTest/Lobby](https://badges.gitter.im/ScalaWebTest/Lobby.svg)](https://gitter.im/ScalaWebTest/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
ScalaWebTest is a library for writing ScalaTest/Selenium based integration tests for websites. It helps you with your basic setup and provides a new and very efficient approach to testing.
In manufacturing, it is common to use gauges (also called checking gauges or testing gauges) to verify whether a workpiece meets predefined criteria and tolerances. ScalaWebTest transfers this concept to the world of web integration testing. You can define a gauge in HTML, and use it to verify your web application. This greatly improves the readability, simplicity of your integration tests.
Read the full documentation on our website
## Getting Started with development
### Prerequisites
* Java >= 8
* SBT 1.x
* [ChromeDriver](http://chromedriver.chromium.org/)Get familiar with the sbt build tool because this is used to manage the project.
See [Getting Started Guide](https://www.scala-sbt.org/1.x/docs/Getting-Started.html)
### Compile, test, package
```bash
$ sbt compile test package
```### Run whole integration test
Before running the integration tests, you will need to configure `WEBDRIVER_CHROME_DRIVER` environment variable. To do so, run the following command:
```bash
$ export WEBDRIVER_CHROME_DRIVER="$(which chromedriver)"
```Then run the tests using the command below:
```bash
$ sbt inttest
```This will start a Jetty server, executes the integration tests and stops the server again.
### Start Jetty server and run single tests
If you would like to run the Jetty server and in parallel work on integration tests, and some code changes,
you can do the following:```bash
# Enter the sbt console first, enter 'sbt' in root folder
$ sbt# Start Jetty server
sbt> jetty:start# Or if you would like that sbt automatically restarts Jetty after code changes then do:
sbt> ~jetty:start# Open separate command window and enter the sbt console agains
# Run a single integration tests
sbt> it:testOnly org.scalawebtest.integration.gauge.ContainsSpec
```## How to Release
### Prerequisites
1. Create the file `~/.sbt/1.0/plugins/gpg.sbt` and add the following line `addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")`
1. Create the file `~/sbt/1.0/global.sbt` and add the following line `Global / useGpg := false` or install gpg according to the [sbt-pgp documentation](https://github.com/sbt/sbt-pgp).
1. Copy the private key (Sonatype PGP Private and Public Key from our company password store), to `~/.sbt/gpg/secring.asc`
1. Create the file `~/.sbt/1.0/sonatype.sbt` and add the following content, then replace username and password with your personal oss.sonatype credentials
```scalas
credentials += Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
"",
"")
```### Release
The release process of ScalaWebTest is currently done manually. The process is as follows:
1. Switch the version in `build.sbt` to that which is to be released (e.g. from `0.0.1-SNAPSHOT` to `1.0.0`)
1. In your command line type in the following:
1. navigate to the root folder of the ScalaWebTest git repository
1. `sbt` - enters the sbt interactive mode
1. `+ clean` - deletes all generated files (target)
1. `+ test` - compiles and tests the main sources
1. `+ doc` - generate scaladoc
1. `mimaReportBinaryIssues` - execute the Migration Manager to verify binary compatibility
1. `inttest` - compile and run the integration tests
1. `+ publishSigned` - publishes all packages, sources and poms
1. Enter the Sonatype PGP Key Password as stored in our company password store
1. Go to close and release the staging repository
1. `exit` - exits the sbt interactive mode
1. Commit your changes with the commit message "Release x.x.x" (e.g. `Release 1.0.0`)
1. Tag this commit with the release version `git tag -a x.x.x -m "x.x.x"`
1. Switch the version in `build.sbt` to the snapshot version (e.g. from `1.0.0` to `1.0.0-SNAPSHOT`) and update the documentation if needed
1. Finally, commit those changes with the commit message "Bump version to x.x.x-SNAPSHOT" (e.g. `Bump version to 1.0.0-SNAPSHOT`)
1. Push your changes, and the tag### Website
The website's parts are found in the `docs`-folder of this project.
It is built using `jekyll`, please see the `serve_local-files` for local serving. Or use the following command:
```
bundle exec jekyll build
```The website is deployed through Netlify. It's deployment configurations are found in `netlify.tom`.
Please find the login in our company password store.