Is anyone currently using <https://github.com/kote...
# kotest
t
Is anyone currently using https://github.com/kotest/kotest-extensions-gherkin with success? I'm getting an error when trying to run my skeleton test but since there are no docs I'm not sure if im doing it correctly.
Test:
Copy code
package glimpse.e2e

import io.kotest.core.spec.style.FreeSpec
import io.kotest.extensions.gherkin.GherkinExtension
import io.kotest.matchers.booleans.shouldBeTrue

class HelloWorld : FreeSpec({
    extension(GherkinExtension("HelloWorld.feature"))

    "its alive" - {
        "A" - {
            "B" {
                true.shouldBeTrue()
            }
        }
    }
})
s
@LeoColman
l
I am using it successfully. Let me check your stacktrace
🙏 1
t
does it matter what kotest version i'm using (currently on 4.6.0)?
l
It doesn't. Could you show me the classpath? How are your resources organized?
at least it shouldn't xD
t
2 mo i was trying to follow the cucumber guide so will need to roll back some changes
l
I'd just like to make sure that "HelloWorld.feature" is at the path we expect it to be
It should be directly under
resources
directory from your test source set. You can also provide relative path
t
its in
src/test/kotlin/resources/HelloWorld.feature
l
If having files from outside your project (eg. via absolute path) is something you need, we would need to tweak the extension a little bit, as currently it reads from classpath
Well, it seems correct. Let me check some more th ings
t
having them inside the resources folder works fine for us ... we're creating a project just for e2e tests so hoping to not be pulling in / minimizing external dependencies
l
The big deal here is line 30 from `GherkinExtension`:
javaClass.classLoader.getResourceAsStream(featureFilePath)!!.bufferedReader().readText()
Could you check if youcan load the file this way?
t
ya that fails
heres the folder structure for context
s
Try with a leading slash
Eg /my.feature
t
no joy
l
Just for testing, could you place your file in
src/main/resources
? I'm trying to check something with the classpath
t
yep
okay that works
doesn't work in
src/main/kotlin/resources
though
s
You can't put resources inside the Kotlin folder and then use /
They should be in src/mainortest/language
t
okay so this is working now
s
src/test/resources should work too
t
yep all good
thanks for your help 🙏
l
Great! If any more problems come up, feel free to ping me 😄
t
while you here ... should an earlier fail stop subsequent test from running? I.e. something like this
l
Not at the moment, no. The extension currently only verifies if all test names are present in your file
t
cool