-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change heading markup * Add maven central badge and push event param to CI badge * Fix links * Improve text and switch example driver as PhantomJS development has stopped. * Improve text
- Loading branch information
Showing
1 changed file
with
36 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,50 @@ | ||
Grails Geb Plugin | ||
================= | ||
# Grails Geb Plugin | ||
|
||
[![Java CI](https://github.com/grails/geb/actions/workflows/gradle.yml/badge.svg)](https://github.com/grails/geb/actions/workflows/gradle.yml) | ||
[![Maven Central](https://img.shields.io/maven-central/v/org.grails.plugins/geb.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/org.grails.plugins/geb) | ||
[![Java CI](https://github.com/grails/geb/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/grails/geb/actions/workflows/gradle.yml) | ||
|
||
Geb Functional Testing for Grails® framework | ||
Geb Functional Testing for the Grails® framework. | ||
|
||
This plugin provides the Geb dependencies and a `create-functional-test` command for generating Geb tests in a Grails app. | ||
|
||
This plugin just provides the Geb dependencies and a `create-functional-test` command for generating Geb tests in a Grails app. For further reference please see the [Geb documentation](http://www.gebish.org) | ||
For further reference please see the [Geb documentation](https://www.gebish.org). | ||
|
||
Examples | ||
-------- | ||
## Examples | ||
|
||
If you are looking for examples check: | ||
If you are looking for examples on how to write Geb tests, check: | ||
|
||
[Geb/Grails example project](https://github.com/grails-samples/geb-example-grails) | ||
[Geb/Grails example project](https://github.com/grails-samples/geb-example-grails) or [Grails functional test suite](https://github.com/grails/grails-functional-tests) where Geb tests are used extensively. | ||
|
||
or [Grails functional test suite](https://github.com/grails/grails3-functional-tests) where Geb tests are used extensively. | ||
## Additional Drivers | ||
|
||
Additional Drivers | ||
================== | ||
Grails comes with a set of pre-installed browser drivers. | ||
To set up additional drivers you need to add the driver to your `build.gradle` for example: | ||
```groovy | ||
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-edge-driver:$seleniumVersion" | ||
``` | ||
|
||
To setup additional drivers you need to add the driver to your `build.gradle` for example: | ||
You also need to add it to the `GebConfig.groovy` file in the `src/test/resources/` directory. For example: | ||
```groovy | ||
/* | ||
This is the Geb configuration file. | ||
testRuntime 'com.github.detro:phantomjsdriver:1.2.0' | ||
|
||
Then you need to create a `GebConfig.groovy` file to your `src/test/resources/` directory. For example: | ||
See: http://www.gebish.org/manual/current/#configuration | ||
*/ | ||
/* | ||
This is the Geb configuration file. | ||
|
||
See: http://www.gebish.org/manual/current/#configuration | ||
*/ | ||
import org.openqa.selenium.chrome.ChromeDriver | ||
import org.openqa.selenium.firefox.FirefoxDriver | ||
import org.openqa.selenium.phantomjs.PhantomJSDriver | ||
|
||
waiting { | ||
timeout = 2 | ||
} | ||
driver = { new PhantomJSDriver() } | ||
/* ... */ | ||
import org.openqa.selenium.edge.EdgeDriver | ||
environments { | ||
/* ... */ | ||
edge { | ||
driver = { new EdgeDriver() } | ||
} | ||
} | ||
``` | ||
|
||
Now you can run your tests with the new driver by specifying the Geb environment: | ||
```console | ||
./gradlew integrationTest -Dgeb.env=edge | ||
``` |