-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Feature Request: JUnit 5 TestSource (IDE "jump to source" feature) #1329
Comments
@bkahlert BTW I'm re-writing the core of karate ref #1281 - so if you have any more things you'd like to improve, this is a good time, feel free to add comments. here is one example of upcoming improvements: #1311 (comment) |
@ptrthomas - this looks an interesting enhancement- if its ok I would like to take a initial jab at it? Thank you. any pointers to get started wrt karate to implement this will be appreciated (though not mandatory) 😀 ! |
@chaudharydeepak go for it, any research findings will help I still don't understand what OP meant by |
@ptrthomas - let me know if any documentation needs to be updated to highlight this. Thank you. |
@chaudharydeepak this is great, I think the IDE auto experience is good enough |
@ptrthomas wish list:
I already worked on these features and attached what I got far :) @chaudharydeepak I'm tagging you too in the hope, that the attached code is of use to you. |
@bkahlert great, (2) is certainly happening in 1281 - I thought the |
@ptrthomas Can't wait to see how you're going to solve the problem of finding the original feature file. I'm using this heuristic approach
which works in my IntelliJ but not guaranteed to work everywhere. Concerning the builder pattern: My background: I'm working on a tiny lib to make using Karate for E2E testing as easy as thinkable for me, my colleagues and other developers. The easiest I came up with are the @E2E
class E2ETests : KarateTestTemplate() {
override fun KarateConfig.tests() {
val application = SpringApplication.run(NotificationApp::class.java)
val port = application.environment["local.server.port"]
withServerPort(port)
withFeaturesFoundAt {
classPath("e2e")
}
// TODO set num threads
}
override fun KarateReporter.reports() {
generateCucumberHtmlReport("Notification API") {
addClassifications("Project", "You name it")
...
}
}
} I hope that helps: What to me is the biggest difference (and advantage) of Kotlin to Java:
|
yes will take care of this in 1281 - another reason is so that you can even run multiple "suites" in parallel, which we are designing for
sounds like you are using spring boot, please do be aware of #751 and maybe you can advise / help test - also there is this classpath scanner lib that may help with your first point: #1317 (comment) |
yes. one option is to have the user specify an optional config file or system property which will make karate look in e.g. |
Hi @ptrthomas - regarding configuration - i think it will make sense to have a global or module specific config file (kafka.props etc) pre-configured to load on runtime - & as well supports different profiles - for ex test env1 / test env 2 etc. Let me know if I am on wrong track altogether on this requirement. |
@chaudharydeepak yes I haven't thought this through - actually we may be overthinking this - what if this was just yet another param we can pass into the |
1.0 released |
Karate has a nice JUnit 5 support. IntelliJ has a nice JUnit 5 support. What is missing is support for JUnit 5 TestSource (https://junit.org/junit5/docs/current/user-guide/#writing-tests-dynamic-tests-uri-test-source) which would allow clicking on a failed test...
to jump to the corresponding scenario:
![image](https://user-images.githubusercontent.com/1170054/96033771-d51c8f00-0e60-11eb-831a-a73faaa1925d.png)
Currently we implement that feature on our own:
Though it works, implementation could be more robust and also for that to work we virtually had to turn Karate upside down as the URI is required during the DynamicTest instantiation.
The text was updated successfully, but these errors were encountered: