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

Mauro Talevi | 17 May 13:52 2015

Migration of JBehave mailing lists

As Codehaus is closing down, the JBehave mailing lists have been 
migrated to Google Groups.

Unfortunately, Google Groups imposes a limit on the number of members 
that can be manually added each day.

So you should subscribe to the new lists of interest:

https://groups.google.com/forum/#!forum/jbehave-announce
https://groups.google.com/forum/#!forum/jbehave-dev
https://groups.google.com/forum/#!forum/jbehave-scm
https://groups.google.com/forum/#!forum/jbehave-user

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

    http://xircles.codehaus.org/manage_email

Brian Jordan | 13 May 19:38 2015

Jbehave4, Spring4, and Java 1.8

Hi,

We have a walking skeleton using Jbehave, Spring4, and Java 1.8.  We had to modify the Spring release to 4.1.1.RELEASE in jbehave-spring as opposed to Spring 3.1.1.RELEASE in order to compile with Java 1.8.  The readme states Jbehave works with 1.7+ so we wanted you to be aware of this issue.

Below is the maven dependency tree info:

[INFO] +- org.jbehave:jbehave-spring:jar:4.0-beta-11:compile

[INFO] |  +- org.springframework:spring-context:jar:3.1.1.RELEASE:compile


We get an error from Spring context because of the changes to handling casting arrays in Java 1.8.  Below is the stacktrace:

2015-05-13 12:28:22.827:INFO:/:main: Initializing Spring root WebApplicationContext

12:28:23 [main] ERROR o.s.w.c.ContextLoader - Context initialization failed

java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String

at org.springframework.context.annotation.AnnotationBeanNameGenerator.determineBeanNameFromAnnotation(AnnotationBeanNameGenerator.java:91) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]

at org.springframework.context.annotation.AnnotationBeanNameGenerator.generateBeanName(AnnotationBeanNameGenerator.java:69) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]

at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:246) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]

at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]

at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1427) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1417) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:174) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:144) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:100) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:510) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:392) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

... 64 common frames omitted

Wrapped by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [jar:file:/Users/brianjordan/.m2/repository/org/resthub/resthub-jpa/2.2.0/resthub-jpa-2.2.0.jar!/resthubContext.xml]; nested exception is java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187) ~[spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) ~[spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) ~[spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436) ~[spring-context-3.1.1.RELEASE.jar:3.1.1.RELEASE]

at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) ~[spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) ~[spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.1.RELEASE.jar:4.1.1.RELEASE]

at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:798) [jetty-server-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:444) [jetty-servlet-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:789) [jetty-server-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294) [jetty-servlet-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1341) [jetty-webapp-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.maven.plugin.JettyWebAppContext.startWebapp(JettyWebAppContext.java:296) [jetty-maven-plugin-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1334) [jetty-webapp-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741) [jetty-server-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:497) [jetty-webapp-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.maven.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:365) [jetty-maven-plugin-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) [jetty-util-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) [jetty-util-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) [jetty-server-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163) [jetty-server-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) [jetty-util-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) [jetty-util-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) [jetty-server-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) [jetty-util-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.server.Server.start(Server.java:380) [jetty-server-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) [jetty-util-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) [jetty-server-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.server.Server.doStart(Server.java:347) [jetty-server-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.maven.plugin.JettyServer.doStart(JettyServer.java:76) [jetty-maven-plugin-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:543) [jetty-maven-plugin-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.maven.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:360) [jetty-maven-plugin-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.eclipse.jetty.maven.plugin.JettyRunMojo.execute(JettyRunMojo.java:167) [jetty-maven-plugin-9.2.2.v20140723.jar:9.2.2.v20140723]

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133) [maven-core-3.2.1.jar:3.2.1]

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) [maven-core-3.2.1.jar:3.2.1]

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [maven-core-3.2.1.jar:3.2.1]

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [maven-core-3.2.1.jar:3.2.1]

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108) [maven-core-3.2.1.jar:3.2.1]

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76) [maven-core-3.2.1.jar:3.2.1]

at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) [maven-core-3.2.1.jar:3.2.1]

at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116) [maven-core-3.2.1.jar:3.2.1]

at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361) [maven-core-3.2.1.jar:3.2.1]

at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155) [maven-core-3.2.1.jar:3.2.1]

at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584) [maven-embedder-3.2.1.jar:3.2.1]

at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213) [maven-embedder-3.2.1.jar:3.2.1]

at org.apache.maven.cli.MavenCli.main(MavenCli.java:157) [maven-embedder-3.2.1.jar:3.2.1]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_25]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_25]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_25]

at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_25]

at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) [plexus-classworlds-2.5.1.jar:na]

at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) [plexus-classworlds-2.5.1.jar:na]

at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) [plexus-classworlds-2.5.1.jar:na]

at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [plexus-classworlds-2.5.1.jar:na]




Thank you,

Brian

Brian Jordan
Senior Architect and Software Engineer


Attila Franczen | 6 May 19:03 2015
Picon

Fwd: jbehave localization

Hello guys,

Is it possible to assign to one keyword multiple localized variants of the translation just like in cucumber? And=LocalizedAnd1|LocalizedAnd2

Currently I see only one to one mapping.

Regards,
Attila


tran, phong | 17 Mar 22:39 2015

Story duration are not calculated correctly in multi-thread execution

When I ran stories with a single thread (serial), the story duration in reports looked correct. The duration time is in minutes as expected. See the attached report (single-thread-reports.png). However, when stories are executed with multiple threads (currently), the story duration is not calculated correctly (See Multiple-Thread-Reports.png). The duration time is in in sub-seconds and is not what expected. I’m using JBehave 3.9.2 and thought this problem could be related to https://jira.codehaus.org/browse/JBEHAVE-1041 but upgrading to the latest JBehave 3.9.5 does not seem to help with this problem.

 

Here is the code fragment for building story report.

 

.useStoryReporterBuilder(new StoryReporterBuilder()

                .withDefaultFormats()

                .withFormats(CONSOLE, TXT, HTML_WEB)

                .withFailureTrace(true)

                .withFailureTraceCompression(false)

                .withViewResources(viewResources)

                .withCrossReference(xref)

                );

 

Does anyone have an idea what’s could be the problem here?

 

Thanks in advance,

Phong

 

 


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

    http://xircles.codehaus.org/manage_email
Teriblus | 12 Mar 15:37 2015
Picon

Problem with parametrized stories

Hi everyone,

I posted something on stackoverflow regarding an issue my team is having with jBehave. Can someone have a look at it?

http://stackoverflow.com/questions/28971436/jbehave-parametrized-alias-ambiguity

Thank you :)
Tristan
Brent Barker | 5 Mar 16:30 2015
Picon

License

Hi Everyone,
Who would I contact to talk about the license of JBehave? The license specifically states:

Neither the name of JBehave nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

What we are trying to do is offer Selenium Automation consulting services to to other companies using different automation framework tools, including JBehave.

We simply want to say we will help you get started with automation. We have some pre-built examples they can pull from, and let them pick from this list of different tools, then we would help them implement some tests. JBehave is one of the tools we want to offer help with to get started. Is this allowed? Or can we get the written permission to use JBehave's name?

Thanks!
-Brent
Stephen de Vries | 12 Feb 16:46 2015
Picon

JBehave and Bamboo


Hi,

I’m using Ant’s JUnit task to run my JBehave stories and it outputs the result to single xml file in JUnit
format which looks fine.
But when Bamboo picks this up it changes the order of the testsuites, and therefore completely mangles the
stories.  I realise this is ultimately an issue with Bamboo, but was wondering whether other users of
JBehave have managed to get it working properly with Bamboo?

regards,
Stephen

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

    http://xircles.codehaus.org/manage_email

Mark Derricutt | 9 Feb 23:37 2015
Gravatar

Failed to convert <status> for Enum ...

Hi all,

I'm using 4.0-beta-11 in our tests and on one of our developers machine we seem to randomly get the following enum conversion error:

When we update the agreement with: SAME_DATEPERIOD Then the last update was <status> (FAILED) org.jbehave.core.steps.ParameterConverters$ParameterConvertionFailed: Failed to convert <status> for Enum specifications.customer.AgreementTest$AgreementUpdateResultType at org.jbehave.core.steps.ParameterConverters$EnumConverter.convertValue(ParameterConverters.java:573) at org.jbehave.core.steps.ParameterConverters.convert(ParameterConverters.java:151) at org.jbehave.core.steps.StepCreator.convertParameterValues(StepCreator.java:305) at org.jbehave.core.steps.StepCreator.access$1100(StepCreator.java:37) at org.jbehave.core.steps.StepCreator$ParametrisedStep.parametriseStep(StepCreator.java:643)

This doesn't happen all the time, but seems to happen about 66% of the time on this one developers machine. It looks like the text <status> is being passed into the converter class. The scenario text reads:

Scenario: Agreement updates Given an initial customer agreement for INBOUND_SCRUB When we update the agreement with: <updates> Then the last update was <status> Examples: |updates|status| |SAME_DATEPERIOD|UPDATED| ...more examples....

has anyone seen something like this before?

Cheers
Mark

--
Mark Derricutt
http://www.theoryinpractice.net
http://www.chaliceofblood.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt


Gmane