Coder Social home page Coder Social logo

Comments (6)

AndreasEK avatar AndreasEK commented on June 12, 2024

Okay, this probably won't work yet. Another complication in the logic for the scenarioReporter :) Thanks for reporting this!

Just out of curiosity: what's your use-case for combining given stories and examples tables?

from jbehave-junit-runner.

jopombar avatar jopombar commented on June 12, 2024

Hi Andreas,
Thank you for working on such a great tool. I went ahead and cleaned up my flow, there was no need to have examples tables in the GivenStories only on the story using the GivenStories. Here how to reproduce now:

  • Have a story that uses GivenStories that is parameterized with an example table
  • Have the GivenStory also parameterized with the values coming from the example table from the parent story

This flow works just fine with jBehave-Web but it throws the exception above when using JUnitReportingRunner. My use case is the following:

  • I'm testing a webApp
  • I'm testing a feature of the webApp for example generateReports functionality. I can select different type of reports (this is where I use the parent's parameterization)
  • To do anything in the webApp the user needs to login first. Here is where I call GivenStories: baseLogin.story
  • We have different types of users in the webApp (admin, regular, etc). This is where I need GivenStory parameterization, to provide the user type in the parent story

from jbehave-junit-runner.

dschneller avatar dschneller commented on June 12, 2024

Intriguing. Could you post the relevant sections of your story files? I haven't used parameterized GivenStories yet, would like to see what you have done. Also, it would give is a test case :)

from jbehave-junit-runner.

AndreasEK avatar AndreasEK commented on June 12, 2024

At the same time I noticed, that the test suite AfterStories is not green anymore. Somewhere the test case counting went haywire. Opening new bug for that.

from jbehave-junit-runner.

jopombar avatar jopombar commented on June 12, 2024

@daniel, take a look at "given_stories_parametrised_by_examples.story" on the jbehave-trader-example (jbehave-core/examples/trader). This story has the structure I'm taking about. There are other good GivenStories examples there as well. Let me know if you still want me to post my stories

@andreas,
The fix works and my stories run. Thanks a lot! :-)
If I want to be picky I do have the following to report:

  • Multi level GivenStories don't show on the JUnit window. Only the first GivenStory shows but if this GivenStory has a GivenStory that one doesn't show
  • The steps of the GivenStory don't show. There is only 1 line with the story name and it doesn't have a check mark even though it ran successfully.

I would consider these "enhancements" since the feature now works. This might be related Issue #16 you opened. Let me know if you want me to add that detail there or open a new issue

from jbehave-junit-runner.

AndreasEK avatar AndreasEK commented on June 12, 2024

Hi,

glad that this is fixed for you :)

About your pickiness. You are absolutely right. I knew about the second point, but haven't even thought about nesting Given Stories :) The technical background is, that while we're building the test execution tree for JUnit prior to executing it, we only get the given story as a path, so we would have to somehow parse it. I don't know yet how to do that with JBehave. Maybe it's not that difficult. So please, if you don't mind, create two enhancements.

Thanks and enjoy your weekend. Hope you have such a great weather as we in Germany do.

Andreas

from jbehave-junit-runner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.