igal epshtein | 29 Dec 09:54 2015
Picon

StoryReporter being executed 3 times ...

Hi, 
I'm implementing my own Reporter by extending StoryReporter.

The thing is , each override method being executed 3 times (one after another) before the the execution moves to next method in the execution flow

For example : beforeStory (3 executions) ---> beforeScenario (3 executions) ---> afterScenario (3 executions)


The running file looks like :

public abstract class GenericScenario extends JUnitStories {
    //set system time property in order to be appended to the log file
    static {
        SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM yyyy - HH:mm:ss");
        System.setProperty("systemDate" , dateFormat.format(new Date()));
    }

    public GenericScenario(){
        Embedder embedder = configuredEmbedder();
        embedder.embedderControls().useStoryTimeouts(PropertiesSingelton.getInstance().getProperty("timeout"));
        embedder.useTimeoutParsers(new MyParser());
        embedder.configuration().useParameterConverters(
                configuration().parameterConverters().addConverters(
                        new ParameterConverters.EnumConverter()));

        //adding skip support
        configuredEmbedder().useMetaFilters(Arrays.asList("-skip"));
    }
    public class MyParser implements StoryTimeouts.TimeoutParser{
        public boolean isValid(String timeout) {
            return timeout.matches("(\\d+)sec");
        }

        public long asSeconds(String timeout) {
            return Long.parseLong(StringUtils.substringBefore(timeout, "sec"));
        }
    }

    <at> Override
    public Configuration configuration(){
        return new MostUsefulConfiguration().useStoryLoader(
                    new LoadFromClasspath(this.getClass()))
                .useStoryReporterBuilder(storyReporter.withDefaultFormats()
                        .withFormats(Format.TXT , Format.CONSOLE )
                        .withReporters(new MyStoryReporter()))
                .useStoryControls(new StoryControls().doSkipScenariosAfterFailure(true));
    }


    StoryReporterBuilder storyReporter = new StoryReporterBuilder() {
        /**
         * The builder is configured to build with the
         * StoryReporterBuilder.Format.STATS as default format. To change
         * the default formats the user can override the method:
         */
        <at> Override
        public StoryReporterBuilder withDefaultFormats() {
            return withFormats(Format.CONSOLE);
        }
    };

    <at> Override
    public InjectableStepsFactory stepsFactory(){
        return new InstanceStepsFactory(configuration(), new classes .... );
    }

    <at> Override
    protected abstract List<String> storyPaths();
}


Any idea how to overcome the issue ?

Thanks

--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/1c86948b-c814-43cd-8bfb-809d3eeda697%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Damien Grandemange | 18 Nov 20:11 2015
Picon

Scenario level declared meta data do not appear in generated XML report

Hi,
this is my first post, so i may quickly myself : Damien, french guy, using JBehave since a few month along Thucydides.
My config : JBehave 4.0.4, Thucydides 0.9.275

We would like to work with meta-infos, not only at Story level, but also at Scenario level, not for filtering concerns, but rather to see those meta infos be reported in the JBehave reports (and beyond that, be parsed by Thucydides).
Works like a charm when the meta-data is declared at the Story level. But when it comes to the Scenario level... Well, the meta infos simply do not appear in the XML report.

Considering the following scenario where :
1) a meta info is declared at the Story level : <at> tag requirements:R_FONC_TOTA
2) another meta info is declared at the Scenario level : <at> tags blurp:R_FONC_TOTO

Narrative:
In order to communicate effectively to the business some functionality
As a development team
I want to use Behaviour-Driven Development

Meta:
<at> tag requirements:R_FONC_TOTA

Scenario: some dummy scenario
Meta:
<at> tags blurp:R_FONC_TOTO
Given I have some step that implicitly requires meta params
When noaction
Then void


Then, the generated XML reports shows :

<story path="stories/R_FONC_HERCULE_01/R_FONC_HERCULE_01_01/001_login_sans_SUA.story" title="">
<meta>
<property keyword=" <at> " name="tag" value="requirements:R_FONC_TOTA"/>
</meta>
<narrative keyword="Narrative:">
  <inOrderTo keyword="In order to">communicate effectively to the business some functionality</inOrderTo>
  <asA keyword="As a">development team</asA>
  <iWantTo keyword="I want to">use Behaviour-Driven Development

Meta:
<at> tag requirements:R_FONC_TOTA</iWantTo>
</narrative>
<scenario keyword="Scenario:" title="some dummy scenario">
<step outcome="successful">Given I have some step that implicitly requires meta params</step>
<step outcome="successful">When noaction</step>
<step outcome="successful">Then void</step>
</scenario>
</story>


Well, there is no sign of my 'scenario level' meta info here (as far as i understand it , a <meta> child element is expected under the <scenario> element).

I 've dived into the code and found that the StoryReporter interface provide a scenariometa() method.
The thing is : StoryReporter.scenariometa() method is invoked by the now deprecated org.jbehave.core.embedder.StoryRunner in the runCancellable() method (see line 316). StoryRunner seems deprecated, and the PerformableTree is now preferred and used.
But looking at this PerformableTree class, and especially on the PerformableTree.PerformableScenario.perform(RunContext context) method (see line 866) , there is no more call to the StoryReporter.scenariometa(), as it was done in the StoryRunner.

Well, i may be wrong with all this.
Any help would be appreciated.

--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/81b54d49-efe6-4b52-9f2c-b642af5366a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mauro Talevi | 18 Nov 01:09 2015

Re: Eclipse+Maven+JBehave Project

All the examples provided by JBehave are Maven based.

Eclipse, IDEA and all major IDEs support Maven.

http://jbehave.org/reference/stable/running-examples.html

On 16/11/2015 06:38, Shiva Tej wrote:
Hi,

Could you please share the  Eclipse+Maven+JBehave sample Project?

Regards,
Shivatej k
--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user <at> googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/405df034-2408-4019-9e37-aaf7e9e5f908%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/564BC1B2.3040609%40aquilonia.org.
For more options, visit https://groups.google.com/d/optout.

Vivek Kulkarni | 5 Nov 12:17 2015
Picon

Roadmap for JBehave

Hi Group
Recently started implementing a framework with JBehave. Now its time to scale up. Wondering is there a road map defined for JBehave? Google does not return satisfactory answers otherthan JIRA link.
Appreciate any inputs on this.

Thanks
Vivek

--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/e5b1eda4-cfcd-4a37-87ef-5e5b32ae2a30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
igal epshtein | 4 Nov 08:54 2015
Picon

Jbehave reporting

Hi, 

I'm executing all my story files (6 in total) , each story has 3-4 scenarios , and for several scenarios I being using an Examples table in order to inject diffrent parameters (several flows)

In total , I've aprox 20-25 different tests, the thing is , I execute them from a single command.

protected List<String> storyPaths() {
return new StoryFinder().findPaths(
CodeLocations.codeLocationFromClass(this.getClass()) , "**/Test_*.story", "");
}

Eventually , the report I'm getting report only 1 test , the file itself which I've executed



Generating reports view to '/Users/000124/TeamCity/buildAgent/work/cdd94863/AppiumClient/target/jbehave' using formats '[stats, txt, html, xml, console]' and view properties '{navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, reports=ftl/jbehave-reports.ftl, nonDecorated=ftl/jbehave-report-non-decorated.ftl, decorated=ftl/jbehave-report-decorated.ftl, maps=ftl/jbehave-maps.ftl}'
[09:29:00][Step 2/3] Reports view generated with 6 stories (of which 0 pending) containing 6 scenarios (of which 0 pending)
[09:29:00][Step 2/3] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1,502.028 sec - in appium.client.tets_runners.IOScenario
[09:29:00][Step 2/3]
[09:29:00][Step 2/3] Results :
[09:29:00][Step 2/3]
[09:29:00][Step 2/3] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0


How I configure / design the execution process differently in order to get a real number of executed test ?

Thanks


--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/ce7259ac-5acc-4f5c-a5e7-08c91daf1885%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
igal epshtein | 29 Oct 09:17 2015
Picon

Stories fails while generating reports

Hi , 

sometimes my execution has a "fail" status with no errors during the execution itself ...

I assume it comes from the report generation 


(AfterStories)


Generating reports view to '/Users/ie54553/Automation/AutomationProject/target/jbehave' using formats '[stats, txt, html, xml, console]' and view properties '{navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, reports=ftl/jbehave-reports.ftl, nonDecorated=ftl/jbehave-report-non-decorated.ftl, decorated=ftl/jbehave-report-decorated.ftl, maps=ftl/jbehave-maps.ftl}'
Reports view generated with 4 stories (of which 0 pending) containing 3 scenarios (of which 0 pending)


org
.jbehave.core.embedder.Embedder$RunningStoriesFailed: Failures in running stories: ReportsCount[stories=4,storiesNotAllowed=0,storiesPending=0,scenarios=3,scenariosFailed=3,scenariosNotAllowed=0,scenariosPending=0,stepsFailed=7]
 at org
.jbehave.core.embedder.Embedder$ThrowingRunningStoriesFailed.handleFailures(Embedder.java:557)
 at org
.jbehave.core.embedder.Embedder.handleFailures(Embedder.java:279)
 at org
.jbehave.core.embedder.Embedder.generateReportsView(Embedder.java:266)
 at org
.jbehave.core.embedder.Embedder.generateReportsView(Embedder.java:247)
 at org
.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:223)
 at org
.jbehave.core.junit.JUnitStories.run(JUnitStories.java:20)
 at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at org
.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
 at org
.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 at org
.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
 at org
.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
 at org
.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
 at org
.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
 at org
.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
 at org
.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
 at org
.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
 at org
.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
 at org
.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
 at org
.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
 at org
.junit.runners.ParentRunner.run(ParentRunner.java:363)
 at org
.junit.runner.JUnitCore.run(JUnitCore.java:137)
 at com
.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)



Any idea how it may be fixed ?

thanks

--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/1f2e9b8c-732a-4a47-8f69-4040e9eed221%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
igal epshtein | 26 Oct 08:27 2015
Picon

GivenStories <at> the end of execution

Hi, 

I'm using a GivenStories for executing Login scenario which is located in different story.
I was wondering if there is a way to use something similar in order to execute a logout story which is also located in different story than one I actually executing.

I know that I can do some tricks with <at> before/after annotations , but the question is if I can execute a "post" story

Thanks

--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/eef87343-a404-4d78-8594-c727be533490%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Irko Kordirko | 3 Oct 13:28 2015
Picon

Custom StepMonitor doesn't work in version 4.xxx

I created a custom StepMonitor:
   private StepMonitor stp = new NullStepMonitor(){
     
public void performing(String step, boolean dryRun){
         
System.err.println("DEBUG - Monitor. Step = " + step);
     
}
and I use it in my configuration:
      return new MostUsefulConfiguration()
           
................
           
.useStepMonitor(stp);

On version 3,9,5 it works as expected, the result is like this:
Scenario: A scenario with some pending steps
DEBUG
- Monitor. Step = Given I am a pending step
Given I am a pending step
DEBUG
- Monitor. Step = And I am still pending step
And I am still pending step
DEBUG
- Monitor. Step = When a good soul will implement me
When a good soul will implement me
DEBUG
- Monitor. Step = Then I shall be happy
Then I shall be happy

But on version 4.0.4 it doesn't work, I have got:
Scenario: A scenario with some pending steps
Given I am a pending step

And I am still pending step

When a good soul will implement me

Then I shall be happy


--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/edcb29c4-1be3-450e-bcb3-0d004d528304%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Alex Filatau | 1 Oct 19:55 2015
Picon

How to share test data between steps from different classes

Hi,

I'm looking for recommended solution (best practices) on sharing test data (strings, Json Objects, POJO - anything) between steps, especially when they located in different classes. Let's consider following abstract example:

Given I am a user with '2' cars
When I'm logged in
Then I should see '
2' cars on Home screen

This case represents two approaches in sharing some test data between steps:
  • assuming that '2' is a variable - I pass this test data as parameter from actual scenario into 2 step implementations. There is no problem with that, looks good and reusable
  • but second step needs to know something that was defined in the previous (first) step, login credentials to be specific
This last case is what I'm trying to ask about. First step does some mages about creating user and it needs to communicate credentials to any other step that might need them. If first and second steps implementations are in the same class - well, we can use some instance or class variables to store that. But it's not always the case, and this information might be needed somewhere else outside of this class.

So what is the best practices to share such data given that propagate it through stories is not an option (it might be result for some calculations after all, not just an email) and given that Jbehave AFAIK does not have any object like "context" or "world" in Cucumber?

The implementations we consider now are Enum Singleton or static class wrapping around hash map, I got suggestions to look into ThreadLocal as well, but would love to learn about experiences.

--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/64f18407-6e84-4e88-ab75-748baada94ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Alex Filatau | 14 Sep 22:31 2015
Picon

Jbehave-junit-runner incorrectly shows scenarios being executed when mata keywords applied

Jbehave-junit-runner incorrectly shows scenarios being executed when mata keywords applied in Jbehave 4 version. See details https://github.com/codecentric/jbehave-junit-runner/issues/85

Posting it here to get more attention to this issue. I guess it's pretty commonly used plugin.

Plus if I'm not mistaken, with the very latest release of 4.0.4 it got even worse throwing NullPointerException when I try to run only one story with meta keyword.

--
You received this message because you are subscribed to the Google Groups "JBehave User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbehave-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to jbehave-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web, visit https://groups.google.com/d/msgid/jbehave-user/fedf0b58-d8c1-467e-93db-74c476a3653a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mauro Talevi | 21 May 19:32 2015

Migration of JBehave JIRA

The Codehaus JBehave JIRA instance 
(http://jira.codehaus.org/browse/JBEHAVE) has been disactivated.

JBehave JIRA has migrated from Codehaus to Atlassian Cloud:

https://jbehave.atlassian.net/projects/JBEHAVE

The existing user names have been maintained but no user information 
such as passwords and emails has been migrated.

You need to create an account on Atlassian Cloud via the link on the 
login page.

Mauro

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Gmane