This is an automated email from the ASF dual-hosted git repository.

jonnybot pushed a commit to branch bugfix/288-driver-cache
in repository https://gitbox.apache.org/repos/asf/groovy-geb.git

commit 6866f20ed27a2f3a567dbbe194e16c4cbdde0e7f
Author: Jonny Carter <[email protected]>
AuthorDate: Thu Sep 25 23:13:43 2025 -0500

    Return global or per thread cache from clearCache method
---
 .../geb-core/src/main/groovy/geb/driver/CachingDriverFactory.groovy  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/module/geb-core/src/main/groovy/geb/driver/CachingDriverFactory.groovy 
b/module/geb-core/src/main/groovy/geb/driver/CachingDriverFactory.groovy
index f4550123..44df6bdb 100644
--- a/module/geb-core/src/main/groovy/geb/driver/CachingDriverFactory.groovy
+++ b/module/geb-core/src/main/groovy/geb/driver/CachingDriverFactory.groovy
@@ -44,8 +44,9 @@ class CachingDriverFactory implements DriverFactory {
     }
 
     static WebDriver clearCache() {
-        GLOBAL_CACHE.get { null }?.clear()
-        PER_THREAD_CACHE.get { null }?.clear()
+        def globalDriver = GLOBAL_CACHE.get { null }?.clear()
+        def perThreadDriver = PER_THREAD_CACHE.get { null }?.clear()
+        return globalDriver ?: perThreadDriver
     }
 
     static WebDriver clearCacheAndQuitDriver() {

Reply via email to