Skip to content

Commit 536b396

Browse files
authored
Update readme (#45)
* 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
1 parent b74bc74 commit 536b396

File tree

1 file changed

+36
-29
lines changed

1 file changed

+36
-29
lines changed

README.md

+36-29
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
1-
Grails Geb Plugin
2-
=================
1+
# Grails Geb Plugin
32

4-
[![Java CI](https://github.com/grails/geb/actions/workflows/gradle.yml/badge.svg)](https://github.com/grails/geb/actions/workflows/gradle.yml)
3+
[![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)
4+
[![Java CI](https://github.com/grails/geb/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/grails/geb/actions/workflows/gradle.yml)
55

6-
Geb Functional Testing for Grails® framework
6+
Geb Functional Testing for the Grails® framework.
77

8+
This plugin provides the Geb dependencies and a `create-functional-test` command for generating Geb tests in a Grails app.
89

9-
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)
10+
For further reference please see the [Geb documentation](https://www.gebish.org).
1011

11-
Examples
12-
--------
12+
## Examples
1313

14-
If you are looking for examples check:
14+
If you are looking for examples on how to write Geb tests, check:
1515

16-
[Geb/Grails example project](https://github.com/grails-samples/geb-example-grails)
16+
[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.
1717

18-
or [Grails functional test suite](https://github.com/grails/grails3-functional-tests) where Geb tests are used extensively.
18+
## Additional Drivers
1919

20-
Additional Drivers
21-
==================
20+
Grails comes with a set of pre-installed browser drivers.
21+
To set up additional drivers you need to add the driver to your `build.gradle` for example:
22+
```groovy
23+
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-edge-driver:$seleniumVersion"
24+
```
2225

23-
To setup additional drivers you need to add the driver to your `build.gradle` for example:
26+
You also need to add it to the `GebConfig.groovy` file in the `src/test/resources/` directory. For example:
27+
```groovy
28+
/*
29+
This is the Geb configuration file.
2430
25-
testRuntime 'com.github.detro:phantomjsdriver:1.2.0'
26-
27-
Then you need to create a `GebConfig.groovy` file to your `src/test/resources/` directory. For example:
31+
See: http://www.gebish.org/manual/current/#configuration
32+
*/
2833
29-
/*
30-
This is the Geb configuration file.
31-
32-
See: http://www.gebish.org/manual/current/#configuration
33-
*/
34-
import org.openqa.selenium.chrome.ChromeDriver
35-
import org.openqa.selenium.firefox.FirefoxDriver
36-
import org.openqa.selenium.phantomjs.PhantomJSDriver
37-
38-
waiting {
39-
timeout = 2
40-
}
41-
driver = { new PhantomJSDriver() }
34+
/* ... */
35+
import org.openqa.selenium.edge.EdgeDriver
4236
37+
environments {
38+
39+
/* ... */
40+
41+
edge {
42+
driver = { new EdgeDriver() }
43+
}
44+
}
45+
```
4346

47+
Now you can run your tests with the new driver by specifying the Geb environment:
48+
```console
49+
./gradlew integrationTest -Dgeb.env=edge
50+
```

0 commit comments

Comments
 (0)