:wave: I was half expecting kotest to play nice wi...
# kotest
m
👋 I was half expecting kotest to play nice with Junit5 extensions (such as Selenium-Jupiter) with at least
AnnotationSpec
but it doesn't appear kotest supports
ParameterResolver
(Junit docs). Am I understanding this correctly?
s
No it's not compatible with junit rules. What are you trying to do as there might be a kotest way
m
I was trying to figure out if I could convert a JUnit annotation style test to use kotest and still use the Selenium-Jupiter extension with
@ExtendWith
(not old style JUnit4 rules). Here's the test in question. I assumed that if I used kotest's JUnit5 engine/runner that the extension would work with
AnnotationSpec
. I was able to get the engine/runner working and convert the test to look like so:
Copy code
@ExtendWith(SeleniumJupiter::class)
class EmailAndPasswordRegistrationWorkflowSpec : AnnotationSpec() {

  @Test
  fun happyPath(driver: WebDriver) {
      ...
  }
}
But the
driver: WebDriver
parameter is not supplied and the runner/engine fails when trying to execute the test.
I know I could use
testcontainers
to manage webdriver containers, but browsers in containers aren't easy to work with when you want to run tests against something on
localhost
😛
s
Yeah the ExtendWith isn't supported I'm afraid.
m
Gotcha. I figured as much but wanted to confirm.
I stumbled onto JunitExtensionAdapter. Any thoughts on if it could support the ParameterResolver extension?
s
Yes in theory it should work, but it's not really tested fully yet.
✅ 1
a
@Matthew Wright Looks like you’re wanting to write a webdriver based test? did you consider FluentLenium? it provides a kotest integration • https://fluentlenium.com/docs/test-runners/#kotest • example test
m
No! Hadn't seen this before. I'll check it out