Hi all,

I worked on this problem and found out the following (commented in line).


On 4 December 2013 09:32, Olmo Rigolo <olmorig...@gmail.com> wrote:

> Hi all,
>
> in none of the example I could found an example using
> the SauceContextStoryReporter.
>
> 1. I would like to know if the use of SauceContextStoryReporter solves my
> problem beeing able to populate the scenario/story name to saucelabs?
>

SauceContextStoryReporter reports story based information to saucelabs when
running a webdriver per story strategy
If you have a fresh webdriver per scenario strategy, then you may need to
implement your own SauceContextScenarioReporter in order to post the
updates per scenario to saucelabs.

What I found out too, is that I have to initialise the webdriver in the
storyReporter because it uses the web driver instance.
I experienced that SauceContextStoryReporter does not work together with
WebDriverPerScenario / WebdriverPerStory etc. WebSteps classes,


>
> 2. What (else) is the SauceContextStoryReporter good for?
>

> 3. How do I us it?
>

I added the line of code:


> I am wondering how I create the storyMaps.This is the code I have so far:
>
> ----------------------------------------------------------------------------------------------------------------------------
>
> public class WebStoriesRunner extends JUnitStories {
>
> public WebStoriesRunner() {
>
> [....]
>
>             HashMap<String,String> *story2SauceUrlMap* *= new
> HashMap<String, String>();* // this list is getting filled by the
> storyreporter itself. you do not need to build it up beforehands.
>
>              *reporter *= new SauceContextStoryReporter(driverProvider,
> context, story2SauceUrlMap);
>
> [....]
>
> }
>
> @Override
>     public Configuration configuration() {
>         Class<? extends Embeddable> embeddableClass = this.getClass();
>         return new SeleniumConfiguration()
>                 .useSeleniumContext(context)
>                 .useWebDriverProvider(driverProvider)
>                 .useStepMonitor(new SeleniumStepMonitor(contextView,
> context, new SilentStepMonitor()))
>                 .useStoryLoader(new LoadFromClasspath(embeddableClass))
>                 .useStoryReporterBuilder(new StoryReporterBuilder()
>
> .withCodeLocation(codeLocationFromClass(embeddableClass))
>                         .withDefaultFormats().withFormats(formats)
>                         .withFailureTrace(true)
>                         .withReporters(*reporter*)
>                         .withFailureTraceCompression(true));
>     }
> }
>
>
> ----------------------------------------------------------------------------------------------------------------------------
>
> Thanks for your help,
>
> Olmo
>

Reply via email to