Fixing more functional tests

This commit is contained in:
Sebastien Ros
2013-09-11 17:28:37 -07:00
parent 13a7b70531
commit 795cf2edb3
4 changed files with 68 additions and 163 deletions
+13 -26
View File
@@ -5,13 +5,12 @@
Scenario: In the admin (menu) there is a link to create a Page
Given I have installed Orchard
And I have installed "Orchard.jQuery"
When I go to "admin"
When I go to "Admin"
Then I should see "<a href="/Admin/Contents/Create/Page"[^>]*>Page</a>"
Scenario: I can create and publish a new Page
Given I have installed Orchard
When I go to "admin/contents/create/page"
# I can create and publish a new Page
When I go to "Admin/Contents/Create/Page"
And I fill in
| name | value |
| Title.Title | Super Duper |
@@ -21,18 +20,8 @@ Scenario: I can create and publish a new Page
Then I should see "<h1[^>]*>.*?Super Duper.*?</h1>"
And I should see "This is super."
Scenario: If I create a page which gets a conflicting path generated its path is made to be unique
Given I have installed Orchard
When I go to "admin/contents/create/page"
And I fill in
| name | value |
| Title.Title | Super Duper |
| Body.Text | This is super. |
And I hit "Publish Now"
And I go to "super-duper"
Then I should see "<h1[^>]*>.*?Super Duper.*?</h1>"
And I should see "This is super."
When I go to "admin/contents/create/page"
# If I create a page which gets a conflicting path generated its path is made to be unique
When I go to "Admin/Contents/Create/Page"
And I fill in
| name | value |
| Title.Title | Super Duper |
@@ -42,23 +31,21 @@ Scenario: If I create a page which gets a conflicting path generated its path is
Then I should see "<h1[^>]*>.*?Super Duper.*?</h1>"
And I should see "This is super number two."
Scenario: A new page marked to be the home page and publish does take over the home page and is not accessible from its own standard path
Given I have installed Orchard
When I go to "admin/contents/create/page"
# A new page marked to be the home page and publish does take over the home page and is not accessible from its own standard path
When I go to "Admin/Contents/Create/Page"
And I fill in
| name | value |
| Title.Title | Super Duper |
| Title.Title | Another |
| Body.Text | This is a draft of the new home page. |
| Autoroute.PromoteToHomePage | true |
And I hit "Publish Now"
And I go to "/"
Then I should see "<h1>Super Duper</h1>"
When I go to "super-duper"
Then I should see "<h1>Another</h1>"
When I go to "another"
Then the status should be 404 "Not Found"
Scenario: A new page marked to be the home page but only saved as draft does not take over the home page
Given I have installed Orchard
When I go to "admin/contents/create/page"
# A new page marked to be the home page but only saved as draft does not take over the home page
When I go to "Admin/Contents/Create/Page"
And I fill in
| name | value |
| Title.Title | Drafty |
+37 -119
View File
@@ -74,27 +74,12 @@ namespace Orchard.Specs
this.ScenarioSetup(scenarioInfo);
#line 7
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 8
testRunner.And("I have installed \"Orchard.jQuery\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 9
testRunner.When("I go to \"admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
testRunner.When("I go to \"Admin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 10
testRunner.Then("I should see \"<a href=\"/Admin/Contents/Create/Page\"[^>]*>Page</a>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("I can create and publish a new Page")]
public virtual void ICanCreateAndPublishANewPage()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create and publish a new Page", ((string[])(null)));
#line 12
this.ScenarioSetup(scenarioInfo);
#line 13
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 14
testRunner.When("I go to \"admin/contents/create/page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
"name",
@@ -105,33 +90,18 @@ this.ScenarioSetup(scenarioInfo);
table1.AddRow(new string[] {
"Body.Text",
"This is super."});
#line 15
#line 14
testRunner.And("I fill in", ((string)(null)), table1, "And ");
#line 19
#line 18
testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 20
#line 19
testRunner.And("I go to \"super-duper\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 21
#line 20
testRunner.Then("I should see \"<h1[^>]*>.*?Super Duper.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 22
#line 21
testRunner.And("I should see \"This is super.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
this.ScenarioCleanup();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("If I create a page which gets a conflicting path generated its path is made to be" +
" unique")]
public virtual void IfICreateAPageWhichGetsAConflictingPathGeneratedItsPathIsMadeToBeUnique()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("If I create a page which gets a conflicting path generated its path is made to be" +
" unique", ((string[])(null)));
#line 24
this.ScenarioSetup(scenarioInfo);
#line 25
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 26
testRunner.When("I go to \"admin/contents/create/page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
"name",
@@ -141,118 +111,66 @@ this.ScenarioSetup(scenarioInfo);
"Super Duper"});
table2.AddRow(new string[] {
"Body.Text",
"This is super."});
#line 27
"This is super number two."});
#line 25
testRunner.And("I fill in", ((string)(null)), table2, "And ");
#line 31
#line 29
testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 32
testRunner.And("I go to \"super-duper\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 33
#line 30
testRunner.And("I go to \"super-duper-2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 31
testRunner.Then("I should see \"<h1[^>]*>.*?Super Duper.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 34
testRunner.And("I should see \"This is super.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 32
testRunner.And("I should see \"This is super number two.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 35
testRunner.When("I go to \"admin/contents/create/page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table3.AddRow(new string[] {
"Title.Title",
"Super Duper"});
"Another"});
table3.AddRow(new string[] {
"Body.Text",
"This is super number two."});
"This is a draft of the new home page."});
table3.AddRow(new string[] {
"Autoroute.PromoteToHomePage",
"true"});
#line 36
testRunner.And("I fill in", ((string)(null)), table3, "And ");
#line 40
testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 41
testRunner.And("I go to \"super-duper-2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 42
testRunner.Then("I should see \"<h1[^>]*>.*?Super Duper.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 43
testRunner.And("I should see \"This is super number two.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line hidden
this.ScenarioCleanup();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("A new page marked to be the home page and publish does take over the home page an" +
"d is not accessible from its own standard path")]
public virtual void ANewPageMarkedToBeTheHomePageAndPublishDoesTakeOverTheHomePageAndIsNotAccessibleFromItsOwnStandardPath()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new page marked to be the home page and publish does take over the home page an" +
"d is not accessible from its own standard path", ((string[])(null)));
testRunner.Then("I should see \"<h1>Another</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 44
testRunner.When("I go to \"another\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 45
this.ScenarioSetup(scenarioInfo);
#line 46
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 47
testRunner.When("I go to \"admin/contents/create/page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
testRunner.Then("the status should be 404 \"Not Found\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 48
testRunner.When("I go to \"Admin/Contents/Create/Page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table4.AddRow(new string[] {
"Title.Title",
"Super Duper"});
table4.AddRow(new string[] {
"Body.Text",
"This is a draft of the new home page."});
table4.AddRow(new string[] {
"Autoroute.PromoteToHomePage",
"true"});
#line 48
testRunner.And("I fill in", ((string)(null)), table4, "And ");
#line 53
testRunner.And("I hit \"Publish Now\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 54
testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 55
testRunner.Then("I should see \"<h1>Super Duper</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 56
testRunner.When("I go to \"super-duper\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 57
testRunner.Then("the status should be 404 \"Not Found\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("A new page marked to be the home page but only saved as draft does not take over " +
"the home page")]
public virtual void ANewPageMarkedToBeTheHomePageButOnlySavedAsDraftDoesNotTakeOverTheHomePage()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("A new page marked to be the home page but only saved as draft does not take over " +
"the home page", ((string[])(null)));
#line 59
this.ScenarioSetup(scenarioInfo);
#line 60
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 61
testRunner.When("I go to \"admin/contents/create/page\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table5.AddRow(new string[] {
"Title.Title",
"Drafty"});
table5.AddRow(new string[] {
table4.AddRow(new string[] {
"Body.Text",
"This is a draft of the new home page."});
table5.AddRow(new string[] {
table4.AddRow(new string[] {
"Autoroute.PromoteToHomePage",
"true"});
#line 62
testRunner.And("I fill in", ((string)(null)), table5, "And ");
#line 67
#line 49
testRunner.And("I fill in", ((string)(null)), table4, "And ");
#line 54
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 68
#line 55
testRunner.And("I go to \"/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 69
#line 56
testRunner.Then("I should see \"<h1>Welcome to Orchard!</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
+9 -9
View File
@@ -5,12 +5,12 @@
Scenario: I can edit a default layer
Given I have installed Orchard
When I go to "admin/widgets"
When I go to "Admin/Widgets"
And I follow "Edit"
Then I should see "<input[^>]*name="Name"[^>]*value="Default"[^>]*>"
Then I should see "<input[^>]*name="LayerPart.Name"[^>]*value="Default"[^>]*>"
When I fill in
| name | value |
| Description | This is the default layer. |
| LayerPart.Description | This is the default layer. |
And I hit "Save"
And I am redirected
Then I should see "Your Layer has been saved"
@@ -19,13 +19,13 @@ Scenario: I can edit a default layer
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"
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*" |
| LayerPart.Name | For awesome stuff |
| LayerPart.LayerRule | url "~/awesome*" |
And I hit "Save"
And I am redirected
Then I should see "Your Layer has been created."
@@ -33,10 +33,10 @@ Scenario: I can add a new layer and that layer is active when I'm redirected to
Scenario: I can delete a layer
Given I have installed Orchard
When I go to "admin/widgets"
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"[^>]*>"
Then I should see "<input[^>]*name="LayerPart.Name"[^>]*value="Default"[^>]*>"
When I hit "Delete"
And I am redirected
Then I should see "Layer was successfully deleted"
@@ -44,7 +44,7 @@ Scenario: I can delete a layer
Scenario: I can add a widget to a specific zone in a specific layer
Given I have installed Orchard
When I go to "admin/widgets"
When I go to "Admin/Widgets"
And I fill in
| name | value |
| layerId | Disabled |
+9 -9
View File
@@ -75,17 +75,17 @@ this.ScenarioSetup(scenarioInfo);
#line 7
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 8
testRunner.When("I go to \"admin/widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 9
testRunner.And("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 10
testRunner.Then("I should see \"<input[^>]*name=\"Name\"[^>]*value=\"Default\"[^>]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
testRunner.Then("I should see \"<input[^>]*name=\"LayerPart.Name\"[^>]*value=\"Default\"[^>]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table1.AddRow(new string[] {
"Description",
"LayerPart.Description",
"This is the default layer."});
#line 11
testRunner.When("I fill in", ((string)(null)), table1, "When ");
@@ -115,7 +115,7 @@ this.ScenarioSetup(scenarioInfo);
#line 21
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 22
testRunner.When("I go to \"admin/widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 23
testRunner.And("I follow \"Add a new layer...\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 24
@@ -125,10 +125,10 @@ this.ScenarioSetup(scenarioInfo);
"name",
"value"});
table2.AddRow(new string[] {
"Name",
"LayerPart.Name",
"For awesome stuff"});
table2.AddRow(new string[] {
"LayerRule",
"LayerPart.LayerRule",
"url \"~/awesome*\""});
#line 25
testRunner.When("I fill in", ((string)(null)), table2, "When ");
@@ -155,13 +155,13 @@ this.ScenarioSetup(scenarioInfo);
#line 35
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 36
testRunner.When("I go to \"admin/widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 37
testRunner.Then("I should see \"<option[^>]*>Default</option>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 38
testRunner.When("I follow \"Edit\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 39
testRunner.Then("I should see \"<input[^>]*name=\"Name\"[^>]*value=\"Default\"[^>]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
testRunner.Then("I should see \"<input[^>]*name=\"LayerPart.Name\"[^>]*value=\"Default\"[^>]*>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line 40
testRunner.When("I hit \"Delete\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 41
@@ -184,7 +184,7 @@ this.ScenarioSetup(scenarioInfo);
#line 46
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 47
testRunner.When("I go to \"admin/widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
testRunner.When("I go to \"Admin/Widgets\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line hidden
TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] {
"name",