Package net.thucydides.core.model
Class Story
java.lang.Object
net.thucydides.core.model.Story
public class Story
extends java.lang.Object
Represents a given user story or feature.
Used to record test results and so on.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Story(java.lang.Class<?> userStoryClass)
Story(java.lang.String id, java.lang.String storyName, java.lang.String storyClassName, java.lang.String path, ApplicationFeature feature)
Story(java.lang.String id, java.lang.String storyName, java.lang.String storyClassName, java.lang.String path, ApplicationFeature feature, java.lang.String narrative)
Story(java.lang.String id, java.lang.String storyName, java.lang.String storyClassName, java.lang.String path, ApplicationFeature feature, java.lang.String narrative, java.lang.String type)
protected
Story(java.lang.String id, java.lang.String storyName, ApplicationFeature feature, java.lang.String path)
-
Method Summary
Modifier and Type Method Description Story
asFeature()
TestTag
asQualifiedTag()
TestTag
asTag()
static Story
called(java.lang.String storyName)
boolean
equals(java.lang.Object o)
static Story
from(java.lang.Class<?> userStoryClass)
Obtain a story instance from a given story class.java.lang.String
getDisplayName()
ApplicationFeature
getFeature()
static java.lang.Class<?>
getFeatureClass(java.lang.Class<?> userStoryClass)
What feature does this story belong to?java.lang.String
getId()
java.lang.String
getName()
Each story has a descriptive name.java.lang.String
getNarrative()
java.lang.String
getNarrativeSummary()
java.lang.String
getPath()
java.lang.String
getReportName()
java.lang.String
getReportName(ReportType type)
Find the name of the report for this story for the specified report type (XML, HTML,...).java.lang.String
getStoryClassName()
java.lang.String
getStoryName()
java.lang.String
getType()
int
hashCode()
static java.lang.Class<?>
testedInTestCase(java.lang.Class<?> testClass)
Returns the class representing the story that is tested by a given test class This is indicated by the Story annotation.static Story
withId(java.lang.String storyId, java.lang.String storyName)
Create a story using a full class name as an id.static Story
withId(java.lang.String storyId, java.lang.String storyName, java.lang.String featureClassName, java.lang.String featureName)
static Story
withIdAndPath(java.lang.String storyId, java.lang.String storyName, java.lang.String storyPath)
static Story
withIdAndPathAndFeature(java.lang.String storyId, java.lang.String storyName, java.lang.String storyPath, java.lang.String featureClassName, java.lang.String featureName)
Story
withNarrative(java.lang.String narrative)
Story
withPath(java.lang.String path)
Story
withType(java.lang.String type)
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Story
protected Story(java.lang.Class<?> userStoryClass) -
Story
public Story(java.lang.String id, java.lang.String storyName, java.lang.String storyClassName, java.lang.String path, ApplicationFeature feature) -
Story
public Story(java.lang.String id, java.lang.String storyName, java.lang.String storyClassName, java.lang.String path, ApplicationFeature feature, java.lang.String narrative) -
Story
public Story(java.lang.String id, java.lang.String storyName, java.lang.String storyClassName, java.lang.String path, ApplicationFeature feature, java.lang.String narrative, java.lang.String type) -
Story
protected Story(java.lang.String id, java.lang.String storyName, ApplicationFeature feature, java.lang.String path)
-
-
Method Details
-
getId
public java.lang.String getId() -
from
Obtain a story instance from a given story class. Story instances are used for recording and reporting test results. -
withId
Create a story using a full class name as an id. Note that the class may no longer exist, so the story needs to be able to exist beyond the life of the original story class. This is used to deserialize stories from XML files. -
withNarrative
-
withType
-
withIdAndPath
public static Story withIdAndPath(java.lang.String storyId, java.lang.String storyName, java.lang.String storyPath) -
called
-
withId
public static Story withId(java.lang.String storyId, java.lang.String storyName, java.lang.String featureClassName, java.lang.String featureName) -
withIdAndPathAndFeature
public static Story withIdAndPathAndFeature(java.lang.String storyId, java.lang.String storyName, java.lang.String storyPath, java.lang.String featureClassName, java.lang.String featureName) -
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
getFeatureClass
public static java.lang.Class<?> getFeatureClass(java.lang.Class<?> userStoryClass)What feature does this story belong to? -
testedInTestCase
public static java.lang.Class<?> testedInTestCase(java.lang.Class<?> testClass)Returns the class representing the story that is tested by a given test class This is indicated by the Story annotation. -
getName
public java.lang.String getName()Each story has a descriptive name. This name is usually a human-readable version of the class name, or the story name for an easyb story. -
getDisplayName
public java.lang.String getDisplayName() -
getStoryClassName
public java.lang.String getStoryClassName() -
getReportName
Find the name of the report for this story for the specified report type (XML, HTML,...). -
getReportName
public java.lang.String getReportName() -
getFeature
-
getPath
public java.lang.String getPath() -
getStoryName
public java.lang.String getStoryName() -
getNarrative
public java.lang.String getNarrative() -
getNarrativeSummary
public java.lang.String getNarrativeSummary() -
getType
public java.lang.String getType() -
withPath
-
asFeature
-
asTag
-
asQualifiedTag
-