PHP 클래스 DataSift\Storyplayer\PlayerLib\Story

저자: Stuart Herbert ([email protected])
파일 보기 프로젝트 열기: datasift/storyplayer 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$actionsCallbacks array this is an array of callbacks. Each callback is a single set of actions to execute the story. Each callback is an alternative way to execute the story. Each callback is meant to be equivalent; ie they achieve the same thing, just in different ways. If any of the callbacks has different outcomes, then they belong in separate user stories. NO EXCEPTIONS. This is a fundamental assumption of Storyplayer; ignore it, and Storyplayer's no use to you!
$category string the category that this story belongs to
$compatibleVersion integer you HAVE to set this in your story, otherwise we will skip your story
$deviceSetupCallback array the function that provides any story-specific setup work that happens when we start a device
$deviceTeardownCallback array the function that provides any story-specific teardown work that happens just before we stop a device
$group array the group that this story belongs to
$hintsCallback callable the function that provides hints about how this story changes the state of the system or user
$name string the name of this story
$params array the parameters that get passed into virtual machines et al, and which can be overridden on the command-line
$parserTrees array the raw parser tree of this story, and of any templates that we use
$perPhaseSetupCallback array the function that provides any story-specific setup work that happens before each phase of the test
$perPhaseTeardownCallback array the function that provides any story-specific teardown work that happens at the end of each phase of the test
$persistDevice boolean does the story want the test device kept open between phases?
$postTestInspectionCallback array the callback used to see if the action *did* change the state of the system under test
$preTestInspectionCallback array the callback used to remember the state of the system *before* the action occurs
$preTestPredictionCallback array the callback that dynamically determines in advance whether the story actions should succeed or fail
$reportTestResultsCallback array the callback that dynamically determines afterwards whether or not the story actions actually did succeed
$requiredTestEnvRoles array a list of the roles that the test environment must have defined, otherwise we cannot run
$roleChangesCallback array the function that provides information about how this story has changed the state of the system or user
$storyFilename string the file that contains the story
$storyResult Story_Result what happened to this story?
$storyTemplates array a list of the StoryTemplates that this story is based on. can be empty
$testCanRunCheckCallback array the function that checks to see if the test should run at all, or should be skipped
$testSetupCallback array the function that provides any story-specific setup work
$testTeardownCallback array the function that provides any story-specific teardown action
$whitelistedEnvironments by default, a story is allowed to run on all environments, *but* if an environment's config sets 'mustBeWhitelisted' to TRUE, then the story is only allowed to run on that environment if the story declares itself safe to run we believe that this is the safest approach to handling those stories that simply aren't safe to run absolutely everywhere

공개 메소드들

메소드 설명
__toString ( ) : string return a string representation of the story, for things like logging
addAction ( $newCallback ) : void
addActions ( $newCallback ) : void
addDeviceSetup ( $newCallback ) : void
addDeviceTeardown ( $newCallback ) : void
addHints ( $newCallback ) : void
addPerPhaseSetup ( $newCallback ) : void
addPerPhaseTeardown ( $newCallback ) : void
addPostTestInspection ( $newCallback ) : void
addPreTestInspection ( $newCallback ) : void
addPreTestPrediction ( $newCallback ) : void
addTestCanRunCheck ( $newCallback ) : void
addTestEnvironmentSetup ( $newCallback )
addTestEnvironmentTeardown ( $newCallback )
addTestSetup ( $newCallback )
addTestTeardown ( $newCallback ) : void
addValidRole ( $role ) --------------------------------------------------------------------
andOn ( $envName ) : Story
andValidRole ( $role ) Synonym for addValidRole()
basedOn ( StoryTemplate $tmpl ) : Story set up any templated methods from a predefined class
called ( $userStoryText ) : Story
determineStoryFilename ( ) : void
generateGroup ( ) : Story Set the group name as the file system path of the directory where the test is located
generateName ( ) : Story Set the name as the filename of the test
getCategory ( ) : string Get the category that this story belongs to
getDeviceSetup ( ) : array get the callback for device setup work
getDeviceTeardown ( ) : array get the callback for device teardown work
getGroup ( ) : array Get the group that this story belongs to
getGroupAsString ( ) : string return the story's group as a printable string
getHints ( ) : callable get the hints callback
getName ( ) : string Get the name of this story
getOneAction ( ) : callable pick one action at random, and return it to the caller
getParams ( ) : array
getPerPhaseSetup ( ) : array get the callback for per-phase setup work
getPerPhaseTeardown ( ) : array get the callback for per-phase teardown work
getPersistDevice ( ) : boolean does this story want to keep the web browser open between phases?
getPostTestInspection ( ) : array get the callback to use to work out the test results
getPreTestInspection ( ) : array get the callback to use to perform the preflight checkpoint
getPreTestPrediction ( ) : array get the callback to use to perform the preflight checks
getRequiredStoryplayerVersion ( ) : integer
getRequiredTestEnvironmentRoles ( ) : array
getResult ( ) : Story_Result
getRoleChanges ( ) get the role changes callback
getStoryFilename ( ) : string
getStoryTemplates ( ) : array get a list of the templates that this story is based on, in order or precedence
getTestCanRunCheck ( ) : array get the callback which allows the story to be skipped
getTestSetup ( ) : array get the callback for per-story setup work
getTestTeardown ( ) : array get the callback for post-story teardown work
getWhitelistedEnvironments ( ) : array
hasActions ( ) : boolean does this story have any actions?
hasDeviceSetup ( ) : boolean do we have a device setup callback?
hasDeviceTeardown ( ) : boolean do we have a device teardown callback?
hasHints ( ) : boolean have any hints been set?
hasPerPhaseSetup ( ) : boolean do we have a per-phase setup callback?
hasPerPhaseTeardown ( ) : boolean do we have a per-phase teardown callback?
hasPostTestInspection ( ) : boolean
hasPreTestInspection ( ) : boolean do we have a callback
hasPreTestPrediction ( ) : boolean do we have a callback
hasRole ( $roleName )
hasRoleChanges ( ) has the role changes callback been set?
hasTestCanRunCheck ( ) : boolean do we have a 'check story can run' callback?
hasTestSetup ( ) : boolean do we have a pre-story setup callback?
hasTestTeardown ( ) : boolean do we have a post-story teardown callback?
inGroup ( array | string $groupName ) : Story which group of tests does this story belong to?
requiresStoryplayerVersion ( $version ) : Story
requiresTestEnvironmentWithRoles ( $roles ) : void
runsOn ( $envName ) : Story
setCategory ( string $newCategory ) : Story Set the category that this story belongs to
setDefaultCallbacks ( ) : void
setGroup ( array $newGroup ) : Story Set the group that this story belongs to
setHints ( $newCallback ) : void
setName ( string $newName ) : Story Set the name of this story
setParams ( array $defaults ) Set the parameters for this story
setPersistDevice ( ) tell Storyplayer to keep the web browser open between test phases
setRoleChanges ( $newCallback )
setTestEnvironmentSetup ( $newCallback ) --------------------------------------------------------------------
setTestEnvironmentTeardown ( $newCallback )

메소드 상세

__toString() 공개 메소드

return a string representation of the story, for things like logging
public __toString ( ) : string
리턴 string

addAction() 공개 메소드

public addAction ( $newCallback ) : void
리턴 void

addActions() 공개 메소드

public addActions ( $newCallback ) : void
리턴 void

addDeviceSetup() 공개 메소드

public addDeviceSetup ( $newCallback ) : void
리턴 void

addDeviceTeardown() 공개 메소드

public addDeviceTeardown ( $newCallback ) : void
리턴 void

addHints() 공개 메소드

public addHints ( $newCallback ) : void
리턴 void

addPerPhaseSetup() 공개 메소드

public addPerPhaseSetup ( $newCallback ) : void
리턴 void

addPerPhaseTeardown() 공개 메소드

public addPerPhaseTeardown ( $newCallback ) : void
리턴 void

addPostTestInspection() 공개 메소드

public addPostTestInspection ( $newCallback ) : void
리턴 void

addPreTestInspection() 공개 메소드

public addPreTestInspection ( $newCallback ) : void
리턴 void

addPreTestPrediction() 공개 메소드

public addPreTestPrediction ( $newCallback ) : void
리턴 void

addTestCanRunCheck() 공개 메소드

public addTestCanRunCheck ( $newCallback ) : void
리턴 void

addTestEnvironmentSetup() 공개 메소드

public addTestEnvironmentSetup ( $newCallback )

addTestEnvironmentTeardown() 공개 메소드

public addTestEnvironmentTeardown ( $newCallback )

addTestSetup() 공개 메소드

public addTestSetup ( $newCallback )

addTestTeardown() 공개 메소드

public addTestTeardown ( $newCallback ) : void
리턴 void

addValidRole() 공개 메소드

--------------------------------------------------------------------
public addValidRole ( $role )

andOn() 공개 메소드

public andOn ( $envName ) : Story
리턴 Story

andValidRole() 공개 메소드

Synonym for addValidRole()
또한 보기: Story::addValidRole
public andValidRole ( $role )

basedOn() 공개 메소드

set up any templated methods from a predefined class
public basedOn ( StoryTemplate $tmpl ) : Story
$tmpl StoryTemplate
리턴 Story

called() 공개 메소드

public called ( $userStoryText ) : Story
리턴 Story

determineStoryFilename() 공개 메소드

public determineStoryFilename ( ) : void
리턴 void

generateGroup() 공개 메소드

Set the group name as the file system path of the directory where the test is located
public generateGroup ( ) : Story
리턴 Story $this for fluent interface

generateName() 공개 메소드

Set the name as the filename of the test
public generateName ( ) : Story
리턴 Story $this for fluent interface

getCategory() 공개 메소드

Systems under test can grow to encompass hundreds, if not thousands of user stories. To make this manageable at scale, we break down each user story like this: Name : Starts as a free user with 10 USD in credit Category: Billing User Stories Group : User States The 'name' is the summary text of the user story itself, which should be no longer than a single sentence, please. The 'category' is the general group that the user story belongs to. These are the top-level groups, such as 'Registration', 'Billing' and so forth. The 'group' is the specific group _inside_ the category that the user story belongs to. The groups are specific to the category.
public getCategory ( ) : string
리턴 string the category that this story belongs to

getDeviceSetup() 공개 메소드

get the callback for device setup work
public getDeviceSetup ( ) : array
리턴 array

getDeviceTeardown() 공개 메소드

get the callback for device teardown work
public getDeviceTeardown ( ) : array
리턴 array

getGroup() 공개 메소드

Systems under test can grow to encompass hundreds, if not thousands of user stories. To make this manageable at scale, we break down each user story like this: Name : Starts as a free user with 10 USD in credit Category: Billing User Stories Group : User States The 'name' is the summary text of the user story itself, which should be no longer than a single sentence, please. The 'category' is the general group that the user story belongs to. These are the top-level groups, such as 'Registration', 'Billing' and so forth. The 'group' is the specific group _inside_ the category that the user story belongs to. The groups are specific to the category.
public getGroup ( ) : array
리턴 array

getGroupAsString() 공개 메소드

return the story's group as a printable string
public getGroupAsString ( ) : string
리턴 string

getHints() 공개 메소드

get the hints callback
public getHints ( ) : callable
리턴 callable

getName() 공개 메소드

Systems under test can grow to encompass hundreds, if not thousands of user stories. To make this manageable at scale, we break down each user story like this: Name : Starts as a free user with 10 USD in credit Category: Billing User Stories Group : User States The 'name' is the summary text of the user story itself, which should be no longer than a single sentence, please. The 'category' is the general group that the user story belongs to. These are the top-level groups, such as 'Registration', 'Billing' and so forth. The 'group' is the specific group _inside_ the category that the user story belongs to. The groups are specific to the category.
public getName ( ) : string
리턴 string the name of this story

getOneAction() 공개 메소드

pick one action at random, and return it to the caller
public getOneAction ( ) : callable
리턴 callable

getParams() 공개 메소드

public getParams ( ) : array
리턴 array

getPerPhaseSetup() 공개 메소드

get the callback for per-phase setup work
public getPerPhaseSetup ( ) : array
리턴 array

getPerPhaseTeardown() 공개 메소드

get the callback for per-phase teardown work
public getPerPhaseTeardown ( ) : array
리턴 array

getPersistDevice() 공개 메소드

does this story want to keep the web browser open between phases?
public getPersistDevice ( ) : boolean
리턴 boolean

getPostTestInspection() 공개 메소드

get the callback to use to work out the test results
public getPostTestInspection ( ) : array
리턴 array

getPreTestInspection() 공개 메소드

get the callback to use to perform the preflight checkpoint
public getPreTestInspection ( ) : array
리턴 array

getPreTestPrediction() 공개 메소드

get the callback to use to perform the preflight checks
public getPreTestPrediction ( ) : array
리턴 array

getRequiredStoryplayerVersion() 공개 메소드

getRequiredTestEnvironmentRoles() 공개 메소드

getResult() 공개 메소드

public getResult ( ) : Story_Result
리턴 Story_Result

getRoleChanges() 공개 메소드

get the role changes callback
public getRoleChanges ( )

getStoryFilename() 공개 메소드

public getStoryFilename ( ) : string
리턴 string

getStoryTemplates() 공개 메소드

can be empty
public getStoryTemplates ( ) : array
리턴 array

getTestCanRunCheck() 공개 메소드

get the callback which allows the story to be skipped
public getTestCanRunCheck ( ) : array
리턴 array

getTestSetup() 공개 메소드

get the callback for per-story setup work
public getTestSetup ( ) : array
리턴 array

getTestTeardown() 공개 메소드

get the callback for post-story teardown work
public getTestTeardown ( ) : array
리턴 array

getWhitelistedEnvironments() 공개 메소드

public getWhitelistedEnvironments ( ) : array
리턴 array

hasActions() 공개 메소드

does this story have any actions?
public hasActions ( ) : boolean
리턴 boolean true if this story has any actions

hasDeviceSetup() 공개 메소드

do we have a device setup callback?
public hasDeviceSetup ( ) : boolean
리턴 boolean true if there is a device setup callback

hasDeviceTeardown() 공개 메소드

do we have a device teardown callback?
public hasDeviceTeardown ( ) : boolean
리턴 boolean true if there is a device teardown callback

hasHints() 공개 메소드

have any hints been set?
public hasHints ( ) : boolean
리턴 boolean true if the callback has been set

hasPerPhaseSetup() 공개 메소드

do we have a per-phase setup callback?
public hasPerPhaseSetup ( ) : boolean
리턴 boolean true if there is a per-phase setup callback

hasPerPhaseTeardown() 공개 메소드

do we have a per-phase teardown callback?
public hasPerPhaseTeardown ( ) : boolean
리턴 boolean true if there is a per-phase teardown callback

hasPostTestInspection() 공개 메소드

public hasPostTestInspection ( ) : boolean
리턴 boolean

hasPreTestInspection() 공개 메소드

do we have a callback
public hasPreTestInspection ( ) : boolean
리턴 boolean [description]

hasPreTestPrediction() 공개 메소드

do we have a callback
public hasPreTestPrediction ( ) : boolean
리턴 boolean [description]

hasRole() 공개 메소드

public hasRole ( $roleName )

hasRoleChanges() 공개 메소드

has the role changes callback been set?
public hasRoleChanges ( )

hasTestCanRunCheck() 공개 메소드

do we have a 'check story can run' callback?
public hasTestCanRunCheck ( ) : boolean
리턴 boolean true if the callback exists

hasTestSetup() 공개 메소드

do we have a pre-story setup callback?
public hasTestSetup ( ) : boolean
리턴 boolean true if there is a pre-story setup callback

hasTestTeardown() 공개 메소드

do we have a post-story teardown callback?
public hasTestTeardown ( ) : boolean
리턴 boolean true if there is a post-story teardown callback

inGroup() 공개 메소드

which group of tests does this story belong to?
public inGroup ( array | string $groupName ) : Story
$groupName array | string the group to use
리턴 Story $this for fluent interface

requiresStoryplayerVersion() 공개 메소드

public requiresStoryplayerVersion ( $version ) : Story
리턴 Story

requiresTestEnvironmentWithRoles() 공개 메소드

public requiresTestEnvironmentWithRoles ( $roles ) : void
리턴 void

runsOn() 공개 메소드

public runsOn ( $envName ) : Story
리턴 Story

setCategory() 공개 메소드

Systems under test can grow to encompass hundreds, if not thousands of user stories. To make this manageable at scale, we break down each user story like this: Name : Starts as a free user with 10 USD in credit Category: Billing User Stories Group : User States The 'name' is the summary text of the user story itself, which should be no longer than a single sentence, please. The 'category' is the general group that the user story belongs to. These are the top-level groups, such as 'Registration', 'Billing' and so forth. The 'group' is the specific group _inside_ the category that the user story belongs to. The groups are specific to the category.
public setCategory ( string $newCategory ) : Story
$newCategory string the category that this story belongs to
리턴 Story $this

setDefaultCallbacks() 공개 메소드

public setDefaultCallbacks ( ) : void
리턴 void

setGroup() 공개 메소드

Systems under test can grow to encompass hundreds, if not thousands of user stories. To make this manageable at scale, we break down each user story like this: Name : Starts as a free user with 10 USD in credit Category: Billing User Stories Group : User States The 'name' is the summary text of the user story itself, which should be no longer than a single sentence, please. The 'category' is the general group that the user story belongs to. These are the top-level groups, such as 'Registration', 'Billing' and so forth. The 'group' is the specific group _inside_ the category that the user story belongs to. The groups are specific to the category.
public setGroup ( array $newGroup ) : Story
$newGroup array
리턴 Story $this

setHints() 공개 메소드

public setHints ( $newCallback ) : void
리턴 void

setName() 공개 메소드

Systems under test can grow to encompass hundreds, if not thousands of user stories. To make this manageable at scale, we break down each user story like this: Name : Starts as a free user with 10 USD in credit Category: Billing User Stories Group : User States The 'name' is the summary text of the user story itself, which should be no longer than a single sentence, please. The 'category' is the general group that the user story belongs to. These are the top-level groups, such as 'Registration', 'Billing' and so forth. The 'group' is the specific group _inside_ the category that the user story belongs to. The groups are specific to the category.
public setName ( string $newName ) : Story
$newName string the name of this story
리턴 Story $this

setParams() 공개 메소드

Parameters are a way of passing settings between Stories and StoryTemplates. Order of precedence: 1) Story 2) StoryTemplates (in 'basedOn()' order) (templates cannot override each other)
public setParams ( array $defaults )
$defaults array a list of the parameters for this story

setPersistDevice() 공개 메소드

by default, we close the browser after every phase, to make sure that the next phase always starts with a browser in a known state
public setPersistDevice ( )

setRoleChanges() 공개 메소드

public setRoleChanges ( $newCallback )

setTestEnvironmentSetup() 공개 메소드

--------------------------------------------------------------------
public setTestEnvironmentSetup ( $newCallback )

setTestEnvironmentTeardown() 공개 메소드

public setTestEnvironmentTeardown ( $newCallback )

프로퍼티 상세

$actionsCallbacks 보호되어 있는 프로퍼티

this is an array of callbacks. Each callback is a single set of actions to execute the story. Each callback is an alternative way to execute the story. Each callback is meant to be equivalent; ie they achieve the same thing, just in different ways. If any of the callbacks has different outcomes, then they belong in separate user stories. NO EXCEPTIONS. This is a fundamental assumption of Storyplayer; ignore it, and Storyplayer's no use to you!
protected array $actionsCallbacks
리턴 array

$category 보호되어 있는 프로퍼티

the category that this story belongs to
protected string $category
리턴 string

$compatibleVersion 보호되어 있는 프로퍼티

you HAVE to set this in your story, otherwise we will skip your story
protected int $compatibleVersion
리턴 integer

$deviceSetupCallback 보호되어 있는 프로퍼티

the function that provides any story-specific setup work that happens when we start a device
protected array $deviceSetupCallback
리턴 array

$deviceTeardownCallback 보호되어 있는 프로퍼티

the function that provides any story-specific teardown work that happens just before we stop a device
protected array $deviceTeardownCallback
리턴 array

$group 보호되어 있는 프로퍼티

the group that this story belongs to
protected array $group
리턴 array

$hintsCallback 보호되어 있는 프로퍼티

the function that provides hints about how this story changes the state of the system or user
protected callable $hintsCallback
리턴 callable

$name 보호되어 있는 프로퍼티

the name of this story
protected string $name
리턴 string

$params 보호되어 있는 프로퍼티

the parameters that get passed into virtual machines et al, and which can be overridden on the command-line
protected array $params
리턴 array

$parserTrees 보호되어 있는 프로퍼티

the raw parser tree of this story, and of any templates that we use
protected array $parserTrees
리턴 array

$perPhaseSetupCallback 보호되어 있는 프로퍼티

the function that provides any story-specific setup work that happens before each phase of the test
protected array $perPhaseSetupCallback
리턴 array

$perPhaseTeardownCallback 보호되어 있는 프로퍼티

the function that provides any story-specific teardown work that happens at the end of each phase of the test
protected array $perPhaseTeardownCallback
리턴 array

$persistDevice 보호되어 있는 프로퍼티

does the story want the test device kept open between phases?
protected bool $persistDevice
리턴 boolean

$postTestInspectionCallback 보호되어 있는 프로퍼티

the callback used to see if the action *did* change the state of the system under test
protected array $postTestInspectionCallback
리턴 array

$preTestInspectionCallback 보호되어 있는 프로퍼티

the callback used to remember the state of the system *before* the action occurs
protected array $preTestInspectionCallback
리턴 array

$preTestPredictionCallback 보호되어 있는 프로퍼티

the callback that dynamically determines in advance whether the story actions should succeed or fail
protected array $preTestPredictionCallback
리턴 array

$reportTestResultsCallback 보호되어 있는 프로퍼티

the callback that dynamically determines afterwards whether or not the story actions actually did succeed
protected array $reportTestResultsCallback
리턴 array

$requiredTestEnvRoles 보호되어 있는 프로퍼티

a list of the roles that the test environment must have defined, otherwise we cannot run
protected array $requiredTestEnvRoles
리턴 array

$roleChangesCallback 보호되어 있는 프로퍼티

the function that provides information about how this story has changed the state of the system or user
protected array $roleChangesCallback
리턴 array

$storyFilename 보호되어 있는 프로퍼티

the file that contains the story
protected string $storyFilename
리턴 string

$storyResult 보호되어 있는 프로퍼티

what happened to this story?
protected Story_Result,DataSift\Storyplayer\PlayerLib $storyResult
리턴 Story_Result

$storyTemplates 보호되어 있는 프로퍼티

a list of the StoryTemplates that this story is based on. can be empty
protected array $storyTemplates
리턴 array

$testCanRunCheckCallback 보호되어 있는 프로퍼티

the function that checks to see if the test should run at all, or should be skipped
protected array $testCanRunCheckCallback
리턴 array

$testSetupCallback 보호되어 있는 프로퍼티

the function that provides any story-specific setup work
protected array $testSetupCallback
리턴 array

$testTeardownCallback 보호되어 있는 프로퍼티

the function that provides any story-specific teardown action
protected array $testTeardownCallback
리턴 array

$whitelistedEnvironments 보호되어 있는 프로퍼티

by default, a story is allowed to run on all environments, *but* if an environment's config sets 'mustBeWhitelisted' to TRUE, then the story is only allowed to run on that environment if the story declares itself safe to run we believe that this is the safest approach to handling those stories that simply aren't safe to run absolutely everywhere
protected $whitelistedEnvironments