Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs for Grails 7 #929

Merged
merged 11 commits into from
Dec 20, 2024
33 changes: 32 additions & 1 deletion src/en/guide/introduction/whatsNew.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,35 @@ Grails framework 7 updates Spring Boot to version 3.4. We recommend checking the

* https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.4-Release-Notes[Spring Boot 3.4]

The minimum Java version required to run Grails 7 has been updated to Java 17.
The minimum Java version required to run Grails 7 has been updated to Java 17.

=== Ubiquitous Containerized Browser Testing with Geb

The https://github.com/grails/geb[Grails Geb Plugin] has received a significant update, introducing test fixtures that enable ubiquitous containerized browser testing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we support it, isn't the erdi web driver plugin being abandoned? Should we clarify why we containerized this? The largest reason being that because the selenium & browser combination is a moving target, containers allow us to fix to a specific version and not break as browsers are updated over time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Web Driver Plugin limits you to max Gradle 8.6, which limits you to max Java 19. Plus the browser version matching the driver version is a large pain.

This new approach is now the recommended way to write functional tests in Grails. However, the previous method using WebDriver binaries remains supported for backward compatibility.

==== Key Features

By extending your test classes with `ContainerGebSpec`, your tests will automatically leverage a containerized browser provided by https://www.testcontainers.org[Testcontainers]. This setup eliminates the need for managing browser versions and ensures consistent test environments.

==== Requirements

To use `ContainerGebSpec`, ensure that you have a compatible container runtime installed. Supported options include:

- **Docker Desktop**
- **OrbStack** (macOS only)
- **Rancher Desktop**
- **Podman Desktop**
- **Colima** (macOS and Linux)

==== How It Works

Once a compatible container runtime is installed, no additional configuration is needed. Simply extend your test classes with `ContainerGebSpec` (instead of `GebSpec`), and the following will happen:

1. A container will be started automatically when you run your integration tests.
2. The container will be configured to launch a browser capable of accessing your application under test.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be mentioned, that GebReportingSpec is also replaceable by ContainerGebSpec with the added static boolean reportingSpec = true (I might remember wrong what the prop name is)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an annotation to turn on reporting on ContainerGebSpec now.


With this setup, you gain the benefits of containerized testing, such as isolation, reproducibility, and reduced setup complexity.


Loading