org.jbehave.web.selenium
Class SauceContextStoryReporter

java.lang.Object
  extended by org.jbehave.core.reporters.NullStoryReporter
      extended by org.jbehave.web.selenium.SeleniumContextStoryReporter
          extended by org.jbehave.web.selenium.SauceContextStoryReporter
All Implemented Interfaces:
org.jbehave.core.reporters.StoryReporter

public class SauceContextStoryReporter
extends SeleniumContextStoryReporter

A StoryReporter that passes back to SauceLabs the executed job results.


Constructor Summary
SauceContextStoryReporter(WebDriverProvider webDriverProvider, SeleniumContext seleniumContext, Map<String,String> storyToSauceUrlMap)
           
 
Method Summary
 void afterScenario()
           
 void afterStory(boolean givenStory)
           
 void beforeScenario(String title)
           
 void beforeStory(org.jbehave.core.model.Story story, boolean givenStory)
           
 void failed(String step, Throwable cause)
           
protected  String getBuildId()
           
protected  String getJobName()
          The name of the job.
protected  String getJobTags()
          A set of tags to apply to the job, like so: "foo", "bar"
 void pending(String step)
           
protected  String processSauceLabsResponseLine(String responseLineFromSauceLabs)
          By deault, this prints a URL to the Job on SauceLabs.
protected  String readResponseLinesFromSauceLabToGetJobUrl(BufferedReader reader)
           
 
Methods inherited from class org.jbehave.core.reporters.NullStoryReporter
afterExamples, beforeExamples, beforeStep, dryRun, example, failedOutcomes, givenStories, givenStories, ignorable, narrative, notPerformed, pendingMethods, restarted, scenarioMeta, scenarioNotAllowed, storyCancelled, storyNotAllowed, successful
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SauceContextStoryReporter

public SauceContextStoryReporter(WebDriverProvider webDriverProvider,
                                 SeleniumContext seleniumContext,
                                 Map<String,String> storyToSauceUrlMap)
Method Detail

beforeStory

public void beforeStory(org.jbehave.core.model.Story story,
                        boolean givenStory)
Specified by:
beforeStory in interface org.jbehave.core.reporters.StoryReporter
Overrides:
beforeStory in class org.jbehave.core.reporters.NullStoryReporter

beforeScenario

public void beforeScenario(String title)
Specified by:
beforeScenario in interface org.jbehave.core.reporters.StoryReporter
Overrides:
beforeScenario in class SeleniumContextStoryReporter

failed

public void failed(String step,
                   Throwable cause)
Specified by:
failed in interface org.jbehave.core.reporters.StoryReporter
Overrides:
failed in class org.jbehave.core.reporters.NullStoryReporter

pending

public void pending(String step)
Specified by:
pending in interface org.jbehave.core.reporters.StoryReporter
Overrides:
pending in class org.jbehave.core.reporters.NullStoryReporter

afterScenario

public void afterScenario()
Specified by:
afterScenario in interface org.jbehave.core.reporters.StoryReporter
Overrides:
afterScenario in class org.jbehave.core.reporters.NullStoryReporter

afterStory

public void afterStory(boolean givenStory)
Specified by:
afterStory in interface org.jbehave.core.reporters.StoryReporter
Overrides:
afterStory in class org.jbehave.core.reporters.NullStoryReporter

readResponseLinesFromSauceLabToGetJobUrl

protected String readResponseLinesFromSauceLabToGetJobUrl(BufferedReader reader)
                                                   throws IOException
Throws:
IOException

processSauceLabsResponseLine

protected String processSauceLabsResponseLine(String responseLineFromSauceLabs)
By deault, this prints a URL to the Job on SauceLabs. Refer https://saucelabs.com/docs/sauce-ondemand

Parameters:
responseLineFromSauceLabs - a line from the response

getBuildId

protected String getBuildId()

getJobName

protected String getJobName()
The name of the job. By default this is the story name.

Returns:
the job name

getJobTags

protected String getJobTags()
A set of tags to apply to the job, like so: "foo", "bar"

Returns:
a string of comma separated strings in quotes


Copyright © 2012. All Rights Reserved.