Skip to content

Commit

Permalink
Update readme (#45)
Browse files Browse the repository at this point in the history
* 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
matrei authored Dec 20, 2023
1 parent b74bc74 commit 536b396
Showing 1 changed file with 36 additions and 29 deletions.
65 changes: 36 additions & 29 deletions README.md
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
```

0 comments on commit 536b396

Please sign in to comment.