clearing screen - web viewthis is a *significant* word. 1. ordered #1. 2. ordered #2. 3. ordered #3...

27
Contents

Upload: vuongmien

Post on 31-Jan-2018

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Contents

Page 2: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Clearing ScreenIn order to restart a new set of calculationsAs a math idiotI want to be able to clear the screen

Clear the screenGiven I have entered 50 into the calculatorAnd I have entered 70 into the calculatorWhen I press CThen the screen should be empty

Page 3: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Interactive DHTML ViewIn order to increase stakeholder engagement with pickled specsAs a SpecFlow evangelistI want to adjust the level of detail in the DHTML view to suit my audienceSo that I do not overwhelm them.

Scenario with large data tableGiven a feature with a large table of data:heading page #Chapter 1 1Chapter 2 5Chapter 3 10Chapter 4 15Chapter 5 20Chapter 6 25Chapter 7 30Chapter 8 35Chapter 9 40Chapter 10 45Chapter 11 50Chapter 12 55Chapter 13 60Chapter 14 65Chapter 15 70Chapter 16 75Chapter 17 80Chapter 18 85Chapter 19 90Chapter 20 95Chapter 21 100Chapter 22 105When I click on the table headingThen the table body should collapse

Page 4: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Sample Markdown FeatureHeader 1========Header 2--------This is a *significant* word1. Ordered #12. Ordered #23. Ordered #3- Unordered #1- Unordered #2- Unordered #3Horizontal Rule:- - -Table example:| First Header | Second Header || ------------- | ------------- || Content Cell | Content Cell || Content Cell | Content Cell |- - -Including a picture: ![](./image.png)

BackgroundThis is the *coolest* backgroundGiven I have initialized the Sum-variable to 0When I add 1 to the Sum-variable

Sample Markdown Scenario ExampleThis is **important** text Code Block: ``` var x = 2; ``` Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae. : An American computer company. Orange : The fruit of an evergreen tree of the genus Citrus.Given thisThen that

Sample Markdown Scenario Outline ExampleThis is [an example link to pickles](https://github.com/picklesdoc/pickles/wiki "Pickles") inline link. [This link to pickles](https://github.com/picklesdoc/pickles/wiki) has no title attribute.Given this: <test>Then that: <test2>

Page 5: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Examples: This __message__ is important too and is for an *Example* table.test test2value value2

Page 6: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Multiline Feature ExampleIn order capture this particular Gherkin featureAs a Pickles contributerI want to demonstrate an example of using multiline text in a Scenario

Mutliline OutputGiven I have read in some text from the userThis is line 1.This is line 2!This is line 3!!When I process this inputThen the result will be saved to the multiline text data store

Page 7: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Nested Folder ExampleIn order to test nested folder outputAs a silly contributerI want to create an example of something several folders deep

Nested - Add two numbersGiven I have entered 50 into the calculatorAnd I have entered 70 into the calculatorWhen I press addThen the result should be 120 on the screen

Page 8: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Injecting context into step specificationsIn order to don't have to rely on the global shared stateand to be able to define the contexts required for each scenario.As a SpecFlow EvanglistI would like to have the system automatically inject an instance of any class asdefined in the constructor of a step file

Feature with no contextGiven a feature which requires no contextThen everything is dandy

Feature with a single contextGiven a feature which requires a single contextThen the context is set

Feature with multiple contextsGiven a feature which requires multiple contextsThen the contexts are set

Feature with recursive contextsGiven a feature which requires a recursive contextThen the context is setAnd its sub-context is set

Feature with a dependent contextGiven a feature which requires a single contextThen the context is setAnd the context was created by the feature with a single context scenario

Page 9: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Step Argument TransformationsIn order to reduce the amount of code and repetitive tasks in my stepsAs a SpecFlow evanglistI want to define reusable transformations for my step arguments

Steps with non-string argumentsGiven Dan has been registered at date 2003/03/13And Aslak has been registered at terminal 2Then I should be able to see Aslak at terminal 2

Page 10: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Calling Steps from StepDefinitionsIn order to create steps of a higher abstractionAs a SpecFlow evangelistI want reuse other steps in my step definitions

Log inGiven I am on the index pageWhen I enter my unsername nad passwordAnd I click the login buttonThen the welcome page should be displayed

Do something meaningfulGiven I am logged inWhen I dosomething meaningfulThen I should get rewarded

Page 11: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Attribute overloadingIn order to show that steps can be used with multiple attributesAs a SpecFlow EvangelistI want to show that similar attributes can be applied to the same step definition

Checking number for evennessGiven I have this simple stepAnd this simple stepAnd also this stepWhen I do somethingThen I could validate that the number 2 is evenAnd that the number 4 is evenBut the number 3 is odd

Page 12: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

SummeringFör att slippa att göra dumma felSom räknareVill jag kunna lägga summera

Summera 5 och 7 ska vara 12Givet att jag har knappat in 5Och att jag har knappat in 7När jag summerarSå ska resultatet vara 12

Page 13: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Show the compare to featureIn order to show the compare to features of SpecFlow AssistAs a SpecFlow evanglistI want to show how the different versions of compareTo works

CompareToInstanceGiven I have the following personField ValueName MarcusStyle ButchBirth date 1972-10-09Then CompareToInstance should match this guyField ValueName MarcusStyle ButchBirthDate 10/9/1972 12:00:00 AMAnd CompareToInstance should match this guyField ValueName MarcusBirthDate 10/9/1972 12:00:00 AMBut CompareToInstance should not match this guy# CompareToSet will test only the properties that you define in the table.# CompareToSet does not test the order of the objects, only that one was found that matches

FieldValue

Name AndersStyle very coolBirthDate 10/9/1974 12:00:00 AM

CompareToSetGiven I have the following persons using assistName Style Birth dateMarcus Cool 1972-10-09Anders Butch 1977-01-01Jocke Soft 1974-04-04Then CompareToSet should match thisName Style BirthDateMarcus Cool 10/9/1972 12:00:00 AMAnders Butch 1/1/1977 12:00:00 AMJocke Soft 4/4/1974 12:00:00 AMBut CompareToSet should not match thisName Style BirthDateMarcus Cool 10/9/1972 12:00:00 AM

Page 14: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Anders Butch 1/1/1977 12:00:00 AM

Page 15: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Showing table usageIn order to show how to use tablesAs a SpecFlow evanglistI want to write some simple scenarios that uses tables tables

Using tablesGiven I have the following personsName Style Birth date CredMarcus Cool 1972-10-09 50Anders Butch 1977-01-01 500Jocke Soft 1974-04-04 1000When I search for JockeThen the following person should be returnedName Style Birth date CredJocke Soft 1974-04-04 1000

Using tables with SpecFlow AssistGiven I have the following persons using assistName Style Birth date CredMarcus Very cool 1972-10-09 50Anders Butch 1977-01-01 500Jocke Soft 1974-04-04 1000When I search for JockeThen the following person should be returned using assistName Style Birth date CredJocke Soft 1974-04-04 1000

Creating a entity from field valueWhen I fill out the form like thisField ValueName MarcusStyle very coolBirth date 1972-10-09Cred 100Then the following person should be returned using assistName Style Birth date CredMarcus Very cool 1972-10-09 1000

Example of a wide tableGiven this wide tableName

Styl

Birt

Cred

Name

Styl

Birt

Cred

Name

Styl

Birt

Cred

Name

Styl

Birt

Cred

Name

Styl

Birt

Cred

Name

Styl

Birt

Cred

Name

Styl

Birt

Cred

Name

Styl

Birt

Cred

Page 16: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

e h date

e h date

e h date

e h date

e h date

e h date

e h date

e h date

Marcus

Very cool

10/9/1972

1000

Marcus

Very cool

10/9/1972

1000

Marcus

Very cool

10/9/1972

1000

Marcus

Very cool

10/9/1972

1000

Marcus

Very cool

10/9/1972

1000

Marcus

Very cool

10/9/1972

1000

Marcus

Very cool

10/9/1972

1000

Marcus

Very cool

10/9/1972

1000

Page 17: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Show the use of backgroundIn order to show how to use the Background keyword of GherkinAs a SpecFlow evanglistI want to show that background steps are called before any scenario step

BackgroundGiven I have initialized the Sum-variable to 0When I add 1 to the Sum-variable

Add 1 to the sumWhen I add 1 to the Sum-variableThen the total sum should be 2

Add 2 to the sumWhen I add 2 to the Sum-variableThen the total sum should be 3

Page 18: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Scenario outlineIn order to not have to type the same scenario over and overAs a SpecFlow evangelistI want to show how to use ScenarioOutline

Add two positive numbers with many examplesGiven I enter <number 1> into the calculatorAnd I enter <number 2> into the calculatorWhen I perform addThen the result should be <result># This is called Abstrakt Scenario in Swedish (!!!)

Examples:number 1 number 2 result10 20 3020 20 4020 30 50

Examples:number 1 number 2 result100 20 1201000 20 1020

Add two negative numbers with many examplesGiven I enter <number 1> into the calculatorAnd I enter <number 2> into the calculatorWhen I perform addThen the result should be <result>

Examples:number 1 number 2 result10 20 3020 20 4020 30 50

Examples:number 1 number 2 result100 20 1201000 20 1020

Page 19: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

FeatureContext featuresIn order to show how to use FeatureContextAs a SpecFlow evangelistI want to write some simple scenarios with data in FeatureContext

Store and retrive Person Marcus from FeatureContext CurrentWhen I store a person called Marcus in the current FeatureContextThen a person called Marcus can easily be retrieved from the current FeatureContext

Showing information of the featureWhen I execute any scenario in the featureThen the FeatureInfo contains the following informationField ValueTags showUpInScenarioInfo, andThisTooTitle FeatureContext featuresTargetLanguage CSharpLanguage en-USDescription In order to

Page 20: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Scenario Context featuresIn order to show how to use ScenarioContextAs a SpecFlow evangelistI want to write some simple scenarios with data in ScenarioContext

Store and retrive Person Marcus from ScenarioContextWhen I store a person called Marcus in the Current ScenarioContextThen a person called Marcus can easily be retrieved

Showing information of the scenarioWhen I execute any scenarioThen the ScenarioInfo contains the following informationField ValueTags showUpInScenarioInfo, andThisTooTitle Showing information of the scenario

Show the type of step we're currently onGiven I have a Given stepAnd I have another Given stepWhen I have a When stepThen I have a Then step#This is not so easy to write a scenario for but I've created an AfterScenario-hook#To see this in action remove the @ignore tag below

Display error information in AfterScenarioWhen an error occurs in a step

Pending stepWhen I set the ScenarioContext.Current to pendingThen this step will not even be executed

Page 21: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Tag demonstratorIn order to show the capabilities of tags in SpecFlowAs a SpecFlow evanglistI want to write scenarios that has tags and show their usage in code

Ignored scenarioGiven that my scenario has the @ignore tagWhen I run the scenarioThen the scenario is ignoredAnd the missing step definitions are not reported

A scenario without tagsGiven that my scenario has 0 tagsWhen I run the scenarioThen before scenario hook with '' is run

A scenario with 1 tagGiven that my scenario has 1 tagsWhen I run the scenarioThen before scenario hook with 'testTag1' is run

A scenario with 3 tagsGiven that my scenario has 3 tagsWhen I run the scenarioThen before scenario hook with 'testTag1, testTag2, testTag3' is run

A scenario with 2 tagsGiven that my scenario has 2 tagsWhen I run the scenarioThen before scenario hook with 'testTag1, testTag3' is run

Page 22: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

AdditionIn order to explain the order in which hooks are runAs a SpecFlow evanglistI wan to be able to hook into pre and post conditions in SpecFlow

Hooking into pre conditions for Test Runs in SpecFlowGiven the scenario is runningThen the BeforeTestRun hook should have been executed

Hooking into pre conditions for Features in SpecFlowGiven the scenario is runningThen the BeforeFeature hook should have been executed

Hooking into pre conditions for Scenarios in SpecFlowGiven the scenario is runningThen the BeforeScenario hook should have been executed

Hooking into pre conditions for ScenarioBlocks in SpecFlowGiven the scenario is runningThen the BeforeScenarioBlock hook should have been executed

Hooking into pre conditions for Steps in SpecFlowGiven the scenario is runningThen the BeforeStep hook should have been executed

Page 23: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

The test runner is not (very) importantIn order to show that the test runner is just for the autogenerated stuff in SpecFlowAs a SpecFlow evanglistI want to be able to call my steps in the same manner inspite of the testrunner configured

A couple of simple stepsGiven I have step defintions in placeWhen I call a stepThen the step should have been called

Page 24: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

Showing basic gherkin syntaxIn order to see that gherkin is a very simple languageAs a SpecFlow evangelistI want to show that basic syntax![Test Image](test.jpg)

Simple GWTGiven the initial state of the application is RunningWhen I ask what the application state isThen I should see Running as the answer

Using And and ButGiven the initial state of the application is RunningAnd I have authorization to ask application stateWhen I ask what the application state isThen I should see Running as the answerAnd I should see the time of the applicationBut the state of the application should not be Stopped

Page 25: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

TrigonometryIn order to avoid perform more advanced calculationsAs a math idiotI want to be able to use trigonometric functions

SineGiven I have entered 90 into the calculatorWhen I press sinThen the result should be 1 on the screen

CosineGiven I have entered 0 into the calculatorWhen I press cosThen the result should be 1 on the screen

TangentGiven I have entered 45 into the calculatorWhen I press tanThen the result should be 1 on the screen

Page 26: Clearing Screen - Web viewThis is a *significant* word. 1. Ordered #1. 2. Ordered #2. 3. Ordered #3 - Unordered #1 ... I enter my unsername nad password. And . I click the login button

ArithmeticIn order to avoid silly mistakesAs a math idiotI want to be able to perform arithmetic on the calculatorWhen $a \ne 0$, there are two solutions to $\(ax^2 + bx + c = 0\)$ and they are$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

Add two numbers$50 + 70 = 120$# In the DHTML version, the description will be rendered with mathematical formulas if the experimental features are enabled.Given I have entered 50 into the calculatorAnd I have entered 70 into the calculatorWhen I press addThen the result should be 120 on the screen

Subtract two numbersGiven I have entered 50 into the calculatorAnd I have entered 70 into the calculatorWhen I press subtractThen the result should be -20 on the screen

Multiply two numbersGiven I have entered 50 into the calculatorAnd I have entered 70 into the calculatorWhen I press multiplyThen the result should be 3500 on the screen

Divide two numbersGiven I have entered 50 into the calculatorAnd I have entered 2 into the calculatorWhen I press divideThen the result should be 25 on the screen