Hi, Thanks for your feedback. A couple of notes:
1) a scenario without steps is not executed, with or without given stories. 2) yes, as already noted. Cheers On 3 Sep 2013, at 22:15, David Gray <[email protected]> wrote: > Hi, > > Just to follow up, I did a little more research and found, I needed to make > two changes: > > 1) I cannot have a Scenario: line before a GivenStories: line, unless the > line following it is a Given,When or Then. If the line following > is another Scenario: line, it will not load the GivenStories story > > Good: > > Scenario: my scenario > > GivenStories: my_pre.story > > Given I do something > Then I see something > > Good: > > GivenStories: my_pre.story > > Scenario: my scenario > > Given I do something > Then I see something > > Bad: > > > Scenario: my pre scenario > > GivenStories: my_pre.story > > Scenario: my scenario > > Given I do something > Then I see something > > > > 2) When setting up the configuration, I needed to add > .usePathCalculator(new RelativePathCalculator()) to the configuration > definition in order to use relative paths when specifying the GivenStories > > @Override > public Configuration configuration() { > return new > SeleniumConfiguration().useSeleniumContext(SELENIUM_CONTEXT) > .usePendingStepStrategy(PENDING_STEP_STRATEGY) > .useStoryControls(new > StoryControls().doResetStateBeforeScenario(false)).useStepMonitor(STEP_MONITOR) > .useStoryLoader(new > LoadFromClasspath(Stories.class)).useStoryReporterBuilder(REPORTER_BUILDER) > .useParameterConverters(new > ParameterConverters().addConverters(stringConverter())) > .usePathCalculator(new RelativePathCalculator()); > } > > With these two changes, GivenStories is now working now me. > > Dave > > From: Mauro Talevi [mailto:[email protected]] > Sent: Wednesday, August 28, 2013 6:18 AM > To: [email protected] > Subject: Re: [jbehave-user] Cannot get GivenStories to work as documented > > Hi Dave, > > for starters, here's the doc page on given stories: > http://jbehave.org/reference/stable/given-stories.html > > Do note that by default you need to use the full story path, unless you use > the LoadFromRelativeFile StoryLoader. > > For us to help you further you'd need to provide a fully working sample mvn > project that reproduces your problem. > > Cheers > > On 28/08/2013 00:41, David Gray wrote: > Hi, > > The stories we are developing for end-to-end testing are highly depended on > each other, and the GivenStories > Feature sounds absolutely fantastic, however, I cannot get it to work, so I > was wondering if some type of > configuration needed for GivenStories to work? > > I cannot find anything in the documentation or online indicating that it > does, and > I have found success stories in other forums that this feature works with > jbehave.core.version 3.8, so I am at > a complete loss as to what is wrong, any help would be greatly appreciated. > > Dave > > PS. Sorry for the long problem description. > > I am seeing variations of the same issue > > 1) When meta tags are used I am getting a Failed to execute goal > org.jbehave:jbehave-maven-plugin:3.8:run-stories-as-embeddables error > 2) If I remove the meta tags, the specified Given Story is skipped > > Currently we have the following versions installed, as defined in the pom.xml > file > > <jbehave.core.version>3.8</jbehave.core.version> > <jbehave.web.version>3.5.5</jbehave.web.version> > <jbehave.site.version>3.1.1</jbehave.site.version> > > Both stories run fine on their own. > > Scenario 1A: I am running smoke_arp_actions.story which wants to run > smoke_arp_assets.story, both have meta tags, > both stories are in the same directory (specifying the full path has the same > error result). I get the error, and the run hangs. > I need to manually terminate the chromedriver > > Scenario 1B: If I remove the meta tag from the Given Story, > smoke_arp_assets.story, I see the same embeddables error, the > Story hangs and I need to manually terminate the chromedriver > > Scenario 1C: If I remove the comment, “!-- execute given story prior to test” > from smoke_arp_actions.story, the test fails, but runs to completion > And the run-stories-as-embeddables error is reported at the end of the run > log. > > Scenario 1D: No comment and No Meta Tags: the test fails, but runs to > completion > And the run-stories-as-embeddables error is reported at the end of the run > log. > > > smoke_arp_assets.story > --------------------------------- > Meta: > @automation > @story smoke_arp_assets > > Scenario: Go to Asset Page > > Given I am on the page assets > > > Scenario: Creating an asset (1) (upload) > When I create an asset by uploading an image file <filename> > > Examples: > |filename| > |HTML assets/atest1.html| > > > smoke_arp_actions.story > ---------------------------------- > Meta: > @automation > @story smoke_arp_actions > > Scenario: Configure Assets > GivenStories: smoke_arp_assets.story > > !-- execute given story prior to test > > Scenario: Go to Action Page > > Given I am on the page actions > > > Scenario: Creating an action (1) (Dynamic Content, with asset) > When I create an action named <name> with attached asset <asset> > > Examples: > |name|asset| > |a_test1|atest1.html| > > > Stack Trace: > > [ERROR] Failed to execute goal > org.jbehave:jbehave-maven-plugin:3.8:run-stories-as-embeddables > (embeddable-stories) on project juice-test-behaviour: Failed to run stories > as embeddables: Failures in running embeddables: > [ERROR] com.thunderhead.juice.integration.jbehave.THXStories: > org.jbehave.core.embedder.Embedder$RunningStoriesFailed: Failures in running > stories: > [ERROR] individuals/touchpoints/actionRequestPoints/smoke_arp_actions.story: > org.jbehave.core.embedder.StoryManager$StoryExecutionFailed: > individuals/touchpoints/actionRequestPoints/smoke_arp_actions.story > [ERROR] at > org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:234) > [ERROR] at > org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:201) > [ERROR] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) > [ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:166) > [ERROR] at > com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293) > [ERROR] at > com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:61) > [ERROR] at > com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:45) > [ERROR] at > org.jbehave.core.embedder.StoryManager.submit(StoryManager.java:198) > [ERROR] at > org.jbehave.core.embedder.StoryManager.runningStory(StoryManager.java:132) > [ERROR] at > org.jbehave.core.embedder.StoryManager.filterRunning(StoryManager.java:116) > [ERROR] at > org.jbehave.core.embedder.StoryManager.runningStoriesAsPaths(StoryManager.java:101) > [ERROR] at > org.jbehave.core.embedder.StoryManager.runStories(StoryManager.java:78) > [ERROR] at > org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:202) > [ERROR] at org.jbehave.core.junit.JUnitStories.run(JUnitStories.java:20) > [ERROR] at > org.jbehave.core.embedder.Embedder.runAsEmbeddables(Embedder.java:122) > [ERROR] at > org.jbehave.mojo.RunStoriesAsEmbeddables.execute(RunStoriesAsEmbeddables.java:18) > [ERROR] at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) > [ERROR] at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) > [ERROR] at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) > [ERROR] at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) > [ERROR] at > org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) > [ERROR] at > org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) > [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) > [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) > [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) > [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) > [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) > [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > [ERROR] at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > [ERROR] at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > [ERROR] at java.lang.reflect.Method.invoke(Method.java:601) > [ERROR] at > org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) > [ERROR] at > org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) > [ERROR] at > org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) > [ERROR] at > org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) > [ERROR] Caused by: org.jbehave.core.io.StoryResourceNotFound: Story path > 'smoke_arp_assets.story' not found by class loader > EmbedderClassLoader[urls=[/C:/th/thx/trunk/juice-test/juice-test-behaviour/target/classes/, > gag-1.0.1.jar, rest-assured-1.7.2.jar, groovy-1.8.4.jar, antlr-2.7.7.jar, > asm-3.2.jar, asm-commons-3.2.jar, asm-util-3.2.jar, asm-analysis-3.2.jar, > asm-tree-3.2.jar, httpclient-4.2.1.jar, httpcore-4.2.1.jar, > commons-codec-1.6.jar, httpmime-4.2.1.jar, commons-collections-3.2.1.jar, > commons-lang3-3.1.jar, tagsoup-1.2.1.jar, jbehave-core-3.8.jar, > junit-dep-4.8.2.jar, hamcrest-integration-1.1.jar, commons-io-2.4.jar, > commons-lang-2.6.jar, plexus-utils-3.0.10.jar, freemarker-2.3.19.jar, > paranamer-2.4.jar, xstream-1.4.4.jar, xmlpull-1.1.3.1.jar, > xpp3_min-1.1.4c.jar, jbehave-web-selenium-3.5.5.jar, > fluent-selenium-1.7.1.jar, selenium-java-2.33.0.jar, > selenium-android-driver-2.33.0.jar, selenium-remote-driver-2.33.0.jar, > cglib-nodep-2.1_3.jar, selenium-chrome-driver-2.33.0.jar, > selenium-htmlunit-driver-2.33.0.jar, htmlunit-2.12.jar, xalan-2.7.1.jar, > serializer-2.7.1.jar, htmlunit-core-js-2.12.jar, xercesImpl-2.10.0.jar, > xml-apis-1.4.01.jar, nekohtml-1.9.18.jar, cssparser-0.9.9.jar, sac-1.3.jar, > jetty-websocket-8.1.9.v20130131.jar, jetty-util-8.1.9.v20130131.jar, > jetty-io-8.1.9.v20130131.jar, jetty-http-8.1.9.v20130131.jar, > selenium-firefox-driver-2.33.0.jar, commons-exec-1.1.jar, > selenium-ie-driver-2.33.0.jar, jna-3.4.0.jar, platform-3.4.0.jar, > selenium-iphone-driver-2.33.0.jar, selenium-safari-driver-2.33.0.jar, > selenium-support-2.33.0.jar, selenium-api-2.33.0.jar, webbit-0.4.14.jar, > netty-3.5.2.Final.jar, jbehave-spring-3.8.jar, > spring-context-3.1.1.RELEASE.jar, spring-aop-3.1.1.RELEASE.jar, > aopalliance-1.0.jar, spring-beans-3.1.1.RELEASE.jar, > spring-core-3.1.1.RELEASE.jar, spring-expression-3.1.1.RELEASE.jar, > spring-asm-3.1.1.RELEASE.jar, spring-test-3.1.1.RELEASE.jar, > mockito-core-1.9.5.jar, objenesis-1.0.jar, jmock-2.5.1.jar, > juice-runtime-adapters-core-3.1.0-SNAPSHOT.jar, ehcache-core-2.6.3.jar, > commons-beanutils-1.8.3.jar, juice-runtime-data-3.1.0-SNAPSHOT.jar, > juice-shared-3.1.0-SNAPSHOT.jar, aspectjrt-1.7.2.jar, > juice-runtime-events-3.1.0-SNAPSHOT.jar, > juice-runtime-model-3.1.0-SNAPSHOT.jar, antlr-3.5.jar, antlr-runtime-3.5.jar, > stringtemplate-3.2.1.jar, ST4-4.0.7.jar, > hibernate-entitymanager-4.2.4.Final.jar, dom4j-1.6.1.jar, > jboss-transaction-api_1.1_spec-1.0.1.Final.jar, > hibernate-commons-annotations-4.0.2.Final.jar, javassist-3.15.0-GA.jar, > joda-time-2.2.jar, gson-2.2.2.jar, spring-data-jpa-1.3.0.patched.jar, > spring-data-commons-1.5.0.patched.jar, spring-orm-3.2.2.RELEASE.jar, > spring-jdbc-3.2.2.RELEASE.jar, spring-tx-3.2.2.RELEASE.jar, > hibernate-ehcache-4.2.4.Final.jar, juice-util-3.1.0-SNAPSHOT.jar, > hibernate-core-4.2.4.Final.jar, shiro-core-1.2.1.jar, json-20090211.jar, > jersey-server-1.17.1.jar, jsr305-2.0.1.jar, imgscalr-lib-4.2.jar, > spring-jms-3.2.2.RELEASE.jar, hornetq-core-client-2.2.14.Final.jar, > hornetq-jms-client-2.2.14.Final.jar, jms-api-1.1-rev-1.jar, > jboss-logging-3.1.2.GA.jar, th-common-11.14.4.jar, > spring-security-core-3.1.3.RELEASE.jar, > spring-security-web-3.1.3.RELEASE.jar, spring-web-3.0.7.RELEASE.jar, > wss4j-1.5.0.jar, quartz-2.1.7.jar, c3p0-0.9.1.1.jar, > hibernate-jpa-2.0-api-1.0.1.Final.jar, jersey-client-1.17.1.jar, > jersey-core-1.17.1.jar, jersey-json-1.17.1.jar, jettison-1.1.jar, > jaxb-impl-2.2.3-1.jar, jaxb-api-2.2.2.jar, stax-api-1.0-2.jar, > activation-1.1.jar, jackson-core-asl-1.9.2.jar, jackson-mapper-asl-1.9.2.jar, > jackson-jaxrs-1.9.2.jar, jackson-xc-1.9.2.jar, guava-14.0.1.jar, > javax.inject-1.jar, hsqldb-2.3.0-patched.jar, slf4j-api-1.7.5.jar, > jcl-over-slf4j-1.7.5.jar, commons-logging-1.1.1.jar, jul-to-slf4j-1.7.5.jar, > logback-classic-1.0.12.jar, logback-core-1.0.12.jar, > liquibase-core-2.0.5.jar],parent=ClassRealm[plugin>org.jbehave:jbehave-maven-plugin:3.8, > parent: sun.misc.Launcher$AppClassLoader@6d9bf996]]
