sbabcoc / Selenium-Foundation

Selenium Foundation is an automation framework designed to extend and enhance the capabilities provided by Selenium (WebDriver).
Apache License 2.0
59 stars 16 forks source link

Fix JUnit 4 support #269

Closed sbabcoc closed 5 months ago

sbabcoc commented 6 months ago

It appears that support for JUnit 4 got broken at some point. It's possible that I'm just not formulating the commands or JVM arguments properly, but the RunListener doesn't appear to be firing events anymore.

sbabcoc commented 6 months ago

I've been tracing through the execution, and the JUnit Foundation method interceptors aren't getting called for some reason. Without those being invoked, the lifecycle handlers fail.

sbabcoc commented 6 months ago

Yup... it's Gradle, which is apparently using JUnit directly to execute the tests. By the time the agent runs, all of the classes I need to add hooks to have been loaded into the class cache, which means that the agent accomplishes precisely nothing. I'm searching the interweb for a way to configure Gradle to run the tests like Maven does - in a separate thread with its own class loader.

sbabcoc commented 5 months ago

I upgraded JUnit Foundation to the latest Byte Buddy, and this appears to do the trick.