Add Specflows

This commit is contained in:
jtkech
2016-03-28 23:47:39 +02:00
parent c1107b37bd
commit 5100009ff2
4 changed files with 359 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ Scenario: Creating and using Boolean fields
And I go to "Admin/Contents/Create/Event"
Then I should see "Check if the event is active"
# The default value should be selected
# The default value should be used on creation
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
@@ -80,4 +80,23 @@ Scenario: Creating and using Boolean fields
| name | value |
| Event.Active.Value | |
And I hit "Save"
Then I should see "The field Active is mandatory."
Then I should see "The field Active is mandatory."
# If required and no value, the default value should be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].BooleanFieldSettings.Optional | false |
| Fields[0].BooleanFieldSettings.DefaultValue | True |
And I fill in
| name | value |
| Fields[0].BooleanFieldSettings.SelectionMode | Dropdown list |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
And I fill in
| name | value |
| Event.Active.Value | |
And I hit "Save"
And I am redirected
Then I should see "Your Event has been created."
And I should see "selected=\"selected\" value=\"true\""

View File

@@ -233,6 +233,50 @@ this.ScenarioSetup(scenarioInfo);
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 83
testRunner.Then("I should see \"The field Active is mandatory.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 86
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table10.AddRow(new string[] {
"Fields[0].BooleanFieldSettings.Optional",
"false"});
table10.AddRow(new string[] {
"Fields[0].BooleanFieldSettings.DefaultValue",
"True"});
#line 87
testRunner.And("I fill in", ((string)(null)), table10, "And ");
#line hidden
TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table11.AddRow(new string[] {
"Fields[0].BooleanFieldSettings.SelectionMode",
"Dropdown list"});
#line 91
testRunner.And("I fill in", ((string)(null)), table11, "And ");
#line 94
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 95
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table12.AddRow(new string[] {
"Event.Active.Value",
""});
#line 96
testRunner.And("I fill in", ((string)(null)), table12, "And ");
#line 99
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 100
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 101
testRunner.Then("I should see \"Your Event has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 102
testRunner.And("I should see \"selected=\\\"selected\\\" value=\\\"true\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
this.ScenarioCleanup();
}

View File

@@ -107,3 +107,95 @@ Scenario: Creating and using Enumeration fields
And I go to "Admin/Contents/Create/Event"
And I hit "Save"
Then I should see "The field Location is mandatory."
# The default value should be used on creation
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].EnumerationFieldSettings.Options | Seattle |
| Fields[0].EnumerationFieldSettings.ListMode | Dropdown |
| Fields[0].EnumerationFieldSettings.DefaultValue | Seattle |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "selected=\"selected">Seattle"
# If not required and no value, the default value should be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].EnumerationFieldSettings.Required | false |
| Fields[0].EnumerationFieldSettings.Options | Boston |
| Fields[0].EnumerationFieldSettings.ListMode | Checkbox |
| Fields[0].EnumerationFieldSettings.DefaultValue | foo;Boston;bar |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "Location"
When I fill in
| name | value |
| Event.Location.SelectedValues | |
And I hit "Save"
And I am redirected
Then I should see "Your Event has been created."
When I go to "Admin/Contents/List"
Then I should see "Location:"
And I should see "Boston"
# If required and no value, the default value should be used
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].EnumerationFieldSettings.Required | true |
| Fields[0].EnumerationFieldSettings.Options | Phoenix |
| Fields[0].EnumerationFieldSettings.ListMode | Checkbox |
| Fields[0].EnumerationFieldSettings.DefaultValue | foo;Phoenix;bar |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "Location"
When I fill in
| name | value |
| Event.Location.SelectedValues | |
And I hit "Save"
And I am redirected
Then I should see "Your Event has been created."
When I go to "Admin/Contents/List"
Then I should see "Location:"
And I should see "Phoenix"
# If required and the default value is not valid, the value should be required
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].EnumerationFieldSettings.Required | true |
| Fields[0].EnumerationFieldSettings.Options | Phoenix |
| Fields[0].EnumerationFieldSettings.ListMode | Checkbox |
| Fields[0].EnumerationFieldSettings.DefaultValue | foo;bar |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "Location"
When I fill in
| name | value |
| Event.Location.SelectedValues | |
And I hit "Save"
Then I should see "The field Location is mandatory."
# If required and no default value, the list box should have the required attribute
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].EnumerationFieldSettings.Required | true |
| Fields[0].EnumerationFieldSettings.ListMode | Listbox |
| Fields[0].EnumerationFieldSettings.DefaultValue | |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should see "required=\"required\""
# If required and a default value is set, the list box should not have the required attribute
When I go to "Admin/ContentTypes/Edit/Event"
And I fill in
| name | value |
| Fields[0].EnumerationFieldSettings.Required | true |
| Fields[0].EnumerationFieldSettings.ListMode | Listbox |
| Fields[0].EnumerationFieldSettings.DefaultValue | Phoenix |
And I hit "Save"
And I go to "Admin/Contents/Create/Event"
Then I should not see "required=\"required\""

View File

@@ -273,6 +273,208 @@ this.ScenarioSetup(scenarioInfo);
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 109
testRunner.Then("I should see \"The field Location is mandatory.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 112
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table11.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Options",
"Seattle"});
table11.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.ListMode",
"Dropdown"});
table11.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.DefaultValue",
"Seattle"});
#line 113
testRunner.And("I fill in", ((string)(null)), table11, "And ");
#line 118
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 119
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 120
testRunner.Then("I should see \"selected=\\\"selected\">Seattle\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 123
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table12.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Required",
"false"});
table12.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Options",
"Boston"});
table12.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.ListMode",
"Checkbox"});
table12.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.DefaultValue",
"foo;Boston;bar"});
#line 124
testRunner.And("I fill in", ((string)(null)), table12, "And ");
#line 130
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 131
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 132
testRunner.Then("I should see \"Location\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table13.AddRow(new string[] {
"Event.Location.SelectedValues",
""});
#line 133
testRunner.When("I fill in", ((string)(null)), table13, "When ");
#line 136
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 137
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 138
testRunner.Then("I should see \"Your Event has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 139
testRunner.When("I go to \"Admin/Contents/List\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 140
testRunner.Then("I should see \"Location:\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 141
testRunner.And("I should see \"Boston\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 144
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table14.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Required",
"true"});
table14.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Options",
"Phoenix"});
table14.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.ListMode",
"Checkbox"});
table14.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.DefaultValue",
"foo;Phoenix;bar"});
#line 145
testRunner.And("I fill in", ((string)(null)), table14, "And ");
#line 151
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 152
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 153
testRunner.Then("I should see \"Location\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table15.AddRow(new string[] {
"Event.Location.SelectedValues",
""});
#line 154
testRunner.When("I fill in", ((string)(null)), table15, "When ");
#line 157
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 158
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 159
testRunner.Then("I should see \"Your Event has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 160
testRunner.When("I go to \"Admin/Contents/List\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 161
testRunner.Then("I should see \"Location:\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 162
testRunner.And("I should see \"Phoenix\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 165
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table16.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Required",
"true"});
table16.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Options",
"Phoenix"});
table16.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.ListMode",
"Checkbox"});
table16.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.DefaultValue",
"foo;bar"});
#line 166
testRunner.And("I fill in", ((string)(null)), table16, "And ");
#line 172
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 173
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 174
testRunner.Then("I should see \"Location\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table17.AddRow(new string[] {
"Event.Location.SelectedValues",
""});
#line 175
testRunner.When("I fill in", ((string)(null)), table17, "When ");
#line 178
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 179
testRunner.Then("I should see \"The field Location is mandatory.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 182
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table18.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Required",
"true"});
table18.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.ListMode",
"Listbox"});
table18.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.DefaultValue",
""});
#line 183
testRunner.And("I fill in", ((string)(null)), table18, "And ");
#line 188
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 189
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 190
testRunner.Then("I should see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 193
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table19.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.Required",
"true"});
table19.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.ListMode",
"Listbox"});
table19.AddRow(new string[] {
"Fields[0].EnumerationFieldSettings.DefaultValue",
"Phoenix"});
#line 194
testRunner.And("I fill in", ((string)(null)), table19, "And ");
#line 199
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 200
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 201
testRunner.Then("I should not see \"required=\\\"required\\\"\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}