Olena Shyshkova | 8 Mar 20:06 2016
Picon

Rerun failed test with Jbehave and WebDriver, Java

I want to rerun failed end-to-end tests. I'm using Jbehave and WebDriver, Java. Currently I'm using Maven but going to migrate to Gradle. Is there any solution?

--
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/f99ba951-5e95-424b-99ec-f104112d46e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
damian.ciocca | 25 Feb 18:38 2016

Why JBehave maintain data across steps Given/When/Then during a Scenario?

I am trying JBehave and I need to understand why maintains data (instance variables from the steps) across scenarios (testCases -> Given/When/Then).

I mean, is it possible to clear the instance variable maintained during the execution of each scenario (Given/When/Then) without using <at> BeforeScensario?

Example:

public class GenerateReportSteps {

private String a; private String b; private String c; <at> BeforeScenario public void beforeEachScenario() { a = null; b = null; c = null; }

.. .. }

If I'm not wrong, I understand that each scenario (Given/When/Then) have to be atomic, so the framework JBehave should initialize to null the instance variables before run each scenario per user 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/6806a298-8b2b-4ae3-a35b-bdad1a644d25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
igal epshtein | 13 Jan 08:07 2016
Picon

Maven execution pass although the story fail

Hi , 

Some times I've failed steps , but the in the end , I'm getting "success" in maven execution (Build Success)

Do I miss something in my configuration ?

Thanks 

_______________________________________________________________________________________

Then confirmation message is shown with default data (FAILED)
And the trade blotter shows next data : EURUSD Sell Base Spot (NOT PERFORMED)

Maven output

[INFO] Reactor Summary:
[INFO] AppiumClient ....................................... SUCCESS [06:06 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 06:15 min
[INFO] Finished at: 2016-01-13T08:31:25+02:00
[INFO] Final Memory: 70M/416M
[INFO] ------------------------------------------------------------------------


The jbehave execution file



package appium.client.test_runners;


import appium.client.stepsImpl.LogInOut;
import appium.client.stepsImpl.common.Connectivity;
import appium.client.stepsImpl.common.Util;
import org.apache.commons.lang.StringUtils;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.configuration.MostUsefulConfiguration;
import org.jbehave.core.embedder.Embedder;
import org.jbehave.core.embedder.StoryControls;
import org.jbehave.core.embedder.StoryTimeouts;
import org.jbehave.core.io.LoadFromClasspath;
import org.jbehave.core.junit.JUnitStories;
import org.jbehave.core.model.*;
import org.jbehave.core.reporters.Format;
import org.jbehave.core.reporters.StoryReporter;
import org.jbehave.core.reporters.StoryReporterBuilder;
import org.jbehave.core.steps.InjectableStepsFactory;
import org.jbehave.core.steps.InstanceStepsFactory;
import org.jbehave.core.steps.ParameterConverters;
import util.PropertiesSingelton;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;

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 Util() ,new Connectivity(), new LogInOut());
}

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

--
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/0644dba2-357c-47e1-a0ac-e2d4f707da03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Gergely Puskas | 8 Jan 15:47 2016

jbehave-maven-plugin to be able to use -Djava.library.path special system property

Hi,

I tried to use -Djava.library.path with jbehave-maven-plugin in different ways but was unsuccessful (Linking error).

Is there a way to do so?

http://jbehave.org/reference/stable/maven-goals.html doesn't support argLine compare to Failsafe: http://maven.apache.org/surefire/maven-failsafe-plugin/examples/system-properties.html as far as I see.

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/3633a89d-5a4f-4b28-a702-9cb5dcf5f80c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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.

Gmane