mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00
Adding more Widget spec tests (progress...)
--HG-- branch : 1.x
This commit is contained in:
@@ -16,3 +16,28 @@ Scenario: I can edit a default layer
|
||||
Then I should see "Your Layer has been saved"
|
||||
When I follow "Edit"
|
||||
Then I should see "<textarea[^>]*>\s*This is the default layer.\s*</textarea>"
|
||||
|
||||
Scenario: I can add a new layer and that layer is active when I'm redirected to the widget management page
|
||||
Given I have installed Orchard
|
||||
When I go to "admin/widgets"
|
||||
And I follow "Add a new layer..."
|
||||
Then I should see "<h1[^>]*>Add Layer</h1>"
|
||||
When I fill in
|
||||
| name | value |
|
||||
| Name | For awesome stuff |
|
||||
| LayerRule | url "~/awesome*" |
|
||||
And I hit "Save"
|
||||
And I am redirected
|
||||
Then I should see "Your Layer has been created."
|
||||
And I should see "<option[^>]+selected="selected"[^>]+value="\d+">For awesome stuff</option>"
|
||||
|
||||
Scenario: I can delete a layer
|
||||
Given I have installed Orchard
|
||||
When I go to "admin/widgets"
|
||||
Then I should see "<option[^>]*>Default</option>"
|
||||
When I follow "Edit"
|
||||
Then I should see "<input[^>]*name="Name"[^>]*value="Default"[^>]*>"
|
||||
When I hit "Delete"
|
||||
And I am redirected
|
||||
Then I should see "Layer was successfully deleted"
|
||||
And I should not see "<option[^>]*>Default</option>"
|
||||
|
73
src/Orchard.Specs/Widgets.feature.cs
generated
73
src/Orchard.Specs/Widgets.feature.cs
generated
@@ -2,7 +2,7 @@
|
||||
// <auto-generated>
|
||||
// This code was generated by SpecFlow (http://www.specflow.org/).
|
||||
// SpecFlow Version:1.4.0.0
|
||||
// Runtime Version:4.0.30319.1
|
||||
// Runtime Version:4.0.30319.225
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -87,6 +87,77 @@ this.ScenarioSetup(scenarioInfo);
|
||||
testRunner.When("I follow \"Edit\"");
|
||||
#line 18
|
||||
testRunner.Then("I should see \"<textarea[^>]*>\\s*This is the default layer.\\s*</textarea>\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
|
||||
[NUnit.Framework.TestAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("I can add a new layer and that layer is active when I\'m redirected to the widget " +
|
||||
"management page")]
|
||||
public virtual void ICanAddANewLayerAndThatLayerIsActiveWhenIMRedirectedToTheWidgetManagementPage()
|
||||
{
|
||||
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can add a new layer and that layer is active when I\'m redirected to the widget " +
|
||||
"management page", ((string[])(null)));
|
||||
#line 20
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 21
|
||||
testRunner.Given("I have installed Orchard");
|
||||
#line 22
|
||||
testRunner.When("I go to \"admin/widgets\"");
|
||||
#line 23
|
||||
testRunner.And("I follow \"Add a new layer...\"");
|
||||
#line 24
|
||||
testRunner.Then("I should see \"<h1[^>]*>Add Layer</h1>\"");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
"value"});
|
||||
table2.AddRow(new string[] {
|
||||
"Name",
|
||||
"For awesome stuff"});
|
||||
table2.AddRow(new string[] {
|
||||
"LayerRule",
|
||||
"url \"~/awesome*\""});
|
||||
#line 25
|
||||
testRunner.When("I fill in", ((string)(null)), table2);
|
||||
#line 29
|
||||
testRunner.And("I hit \"Save\"");
|
||||
#line 30
|
||||
testRunner.And("I am redirected");
|
||||
#line 31
|
||||
testRunner.Then("I should see \"Your Layer has been created.\"");
|
||||
#line 32
|
||||
testRunner.And("I should see \"<option[^>]+selected=\"selected\"[^>]+value=\"\\d+\">For awesome stuff</" +
|
||||
"option>\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
|
||||
[NUnit.Framework.TestAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("I can delete a layer")]
|
||||
public virtual void ICanDeleteALayer()
|
||||
{
|
||||
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can delete a layer", ((string[])(null)));
|
||||
#line 34
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 35
|
||||
testRunner.Given("I have installed Orchard");
|
||||
#line 36
|
||||
testRunner.When("I go to \"admin/widgets\"");
|
||||
#line 37
|
||||
testRunner.Then("I should see \"<option[^>]*>Default</option>\"");
|
||||
#line 38
|
||||
testRunner.When("I follow \"Edit\"");
|
||||
#line 39
|
||||
testRunner.Then("I should see \"<input[^>]*name=\"Name\"[^>]*value=\"Default\"[^>]*>\"");
|
||||
#line 40
|
||||
testRunner.When("I hit \"Delete\"");
|
||||
#line 41
|
||||
testRunner.And("I am redirected");
|
||||
#line 42
|
||||
testRunner.Then("I should see \"Layer was successfully deleted\"");
|
||||
#line 43
|
||||
testRunner.And("I should not see \"<option[^>]*>Default</option>\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
|
Reference in New Issue
Block a user