mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
Adding SpecFlow Pages feature test(s)
--HG-- branch : dev
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.Environment.Descriptor;
|
||||
using Orchard.Environment.Descriptor.Models;
|
||||
@@ -16,7 +14,7 @@ namespace Orchard.Specs.Bindings {
|
||||
var webApp = Binding<WebAppHosting>();
|
||||
|
||||
webApp.GivenIHaveACleanSiteWith(TableData(
|
||||
new { extension = "module", names = "Orchard.Setup, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Widgets, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce" },
|
||||
new { extension = "module", names = "Orchard.Setup, Orchard.Pages, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Widgets, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce" },
|
||||
new { extension = "core", names = "Common, Dashboard, Feeds, HomePage, Navigation, Contents, Routable, Scheduling, Settings, Shapes, XmlRpc" },
|
||||
new { extension = "theme", names = "SafeMode, TheAdmin, TheThemeMachine" }));
|
||||
|
||||
@@ -34,9 +32,7 @@ namespace Orchard.Specs.Bindings {
|
||||
public void GivenIHaveInstalled(string name) {
|
||||
var webApp = Binding<WebAppHosting>();
|
||||
webApp.GivenIHaveModule(name);
|
||||
webApp.Host.Execute(() => {
|
||||
MvcApplication.ReloadExtensions();
|
||||
});
|
||||
webApp.Host.Execute(MvcApplication.ReloadExtensions);
|
||||
|
||||
GivenIHaveEnabled(name);
|
||||
}
|
||||
|
@@ -154,6 +154,11 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>MultiTenancy.feature</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages.feature.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Pages.feature</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Util\PathExtensions.cs" />
|
||||
<Compile Include="WebHosting.feature.cs">
|
||||
<DependentUpon>WebHosting.feature</DependentUpon>
|
||||
@@ -220,6 +225,10 @@
|
||||
<Generator>SpecFlowSingleFileGenerator</Generator>
|
||||
<LastGenOutput>MultiTenancy.feature.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Pages.feature">
|
||||
<Generator>SpecFlowSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Pages.feature.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="WebHosting.feature">
|
||||
<Generator>SpecFlowSingleFileGenerator</Generator>
|
||||
<LastGenOutput>WebHosting.feature.cs</LastGenOutput>
|
||||
|
9
src/Orchard.Specs/Pages.feature
Normal file
9
src/Orchard.Specs/Pages.feature
Normal file
@@ -0,0 +1,9 @@
|
||||
Feature: Content Page management
|
||||
In order to add content pages to my site
|
||||
As an author
|
||||
I want to create, publish and edit pages
|
||||
|
||||
Scenario: The "Page" content type is available to create from the admin menu
|
||||
Given I have installed Orchard
|
||||
When I go to ""
|
||||
Then I should see "<a href="/Admin/Contents/Create/Page">Page</a>"
|
74
src/Orchard.Specs/Pages.feature.cs
generated
Normal file
74
src/Orchard.Specs/Pages.feature.cs
generated
Normal file
@@ -0,0 +1,74 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by SpecFlow (http://www.specflow.org/).
|
||||
// SpecFlow Version:1.4.0.0
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
// ------------------------------------------------------------------------------
|
||||
#region Designer generated code
|
||||
namespace Orchard.Specs
|
||||
{
|
||||
using TechTalk.SpecFlow;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[NUnit.Framework.TestFixtureAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("Content Page management")]
|
||||
public partial class ContentPageManagementFeature
|
||||
{
|
||||
|
||||
private static TechTalk.SpecFlow.ITestRunner testRunner;
|
||||
|
||||
#line 1 "Pages.feature"
|
||||
#line hidden
|
||||
|
||||
[NUnit.Framework.TestFixtureSetUpAttribute()]
|
||||
public virtual void FeatureSetup()
|
||||
{
|
||||
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
|
||||
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Content Page management", "In order to add content pages to my site\r\nAs an author\r\nI want to create, publish" +
|
||||
" and edit pages", GenerationTargetLanguage.CSharp, ((string[])(null)));
|
||||
testRunner.OnFeatureStart(featureInfo);
|
||||
}
|
||||
|
||||
[NUnit.Framework.TestFixtureTearDownAttribute()]
|
||||
public virtual void FeatureTearDown()
|
||||
{
|
||||
testRunner.OnFeatureEnd();
|
||||
testRunner = null;
|
||||
}
|
||||
|
||||
public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
|
||||
{
|
||||
testRunner.OnScenarioStart(scenarioInfo);
|
||||
}
|
||||
|
||||
[NUnit.Framework.TearDownAttribute()]
|
||||
public virtual void ScenarioTearDown()
|
||||
{
|
||||
testRunner.OnScenarioEnd();
|
||||
}
|
||||
|
||||
[NUnit.Framework.TestAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("The \"Page\" content type is available to create from the admin menu")]
|
||||
public virtual void ThePageContentTypeIsAvailableToCreateFromTheAdminMenu()
|
||||
{
|
||||
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The \"Page\" content type is available to create from the admin menu", ((string[])(null)));
|
||||
#line 6
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 7
|
||||
testRunner.Given("I have installed Orchard");
|
||||
#line 8
|
||||
testRunner.When("I go to \"\"");
|
||||
#line 9
|
||||
testRunner.Then("I should see \"<a href=\"/Admin/Contents/Create/Page\">Page</a>\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
@@ -6,7 +6,7 @@ Feature: Setup
|
||||
Scenario: Root request shows setup form
|
||||
Given I have a clean site with
|
||||
| extension | names |
|
||||
| module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce |
|
||||
| module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce |
|
||||
| core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc |
|
||||
| theme | SafeMode |
|
||||
When I go to "/Default.aspx"
|
||||
@@ -17,7 +17,7 @@ Scenario: Root request shows setup form
|
||||
Scenario: Setup folder also shows setup form
|
||||
Given I have a clean site with
|
||||
| extension | names |
|
||||
| module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce |
|
||||
| module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce |
|
||||
| core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc |
|
||||
| theme | SafeMode |
|
||||
When I go to "/Setup"
|
||||
@@ -28,7 +28,7 @@ Scenario: Setup folder also shows setup form
|
||||
Scenario: Some of the initial form values are required
|
||||
Given I have a clean site with
|
||||
| extension | names |
|
||||
| module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce |
|
||||
| module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce |
|
||||
| core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc |
|
||||
| theme | SafeMode |
|
||||
When I go to "/Setup"
|
||||
@@ -39,7 +39,7 @@ Scenario: Some of the initial form values are required
|
||||
Scenario: Calling setup on a brand new install
|
||||
Given I have a clean site with
|
||||
| extension | names |
|
||||
| module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce |
|
||||
| module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce |
|
||||
| core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc |
|
||||
| theme | SafeMode, TheThemeMachine |
|
||||
And I am on "/Setup"
|
||||
|
82
src/Orchard.Specs/Setup.feature.cs
generated
82
src/Orchard.Specs/Setup.feature.cs
generated
@@ -1,7 +1,7 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by SpecFlow (http://www.specflow.org/).
|
||||
// SpecFlow Version:1.3.2.0
|
||||
// SpecFlow Version:1.4.0.0
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
@@ -14,7 +14,7 @@ namespace Orchard.Specs
|
||||
using TechTalk.SpecFlow;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.3.2.0")]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[NUnit.Framework.TestFixtureAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("Setup")]
|
||||
@@ -31,7 +31,7 @@ namespace Orchard.Specs
|
||||
{
|
||||
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
|
||||
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Setup", "In order to install orchard\r\nAs a new user\r\nI want to setup a new site from the d" +
|
||||
"efault screen", ((string[])(null)));
|
||||
"efault screen", GenerationTargetLanguage.CSharp, ((string[])(null)));
|
||||
testRunner.OnFeatureStart(featureInfo);
|
||||
}
|
||||
|
||||
@@ -66,25 +66,25 @@ this.ScenarioSetup(scenarioInfo);
|
||||
"names"});
|
||||
table1.AddRow(new string[] {
|
||||
"module",
|
||||
"Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Or" +
|
||||
"chard.jQuery, TinyMce, Orchard.PublishLater"});
|
||||
"Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" +
|
||||
"hard.Themes, Orchard.jQuery, TinyMce"});
|
||||
table1.AddRow(new string[] {
|
||||
"core",
|
||||
"Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable," +
|
||||
" Scheduling, Settings, Shapes, XmlRpc"});
|
||||
"Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" +
|
||||
"shLater, Scheduling, Settings, Shapes, XmlRpc"});
|
||||
table1.AddRow(new string[] {
|
||||
"theme",
|
||||
"SafeMode"});
|
||||
#line 7
|
||||
testRunner.Given("I have a clean site with", ((string)(null)), table1);
|
||||
testRunner.Given("I have a clean site with", ((string)(null)), table1);
|
||||
#line 12
|
||||
testRunner.When("I go to \"/Default.aspx\"");
|
||||
testRunner.When("I go to \"/Default.aspx\"");
|
||||
#line 13
|
||||
testRunner.Then("I should see \"Welcome to Orchard\"");
|
||||
testRunner.Then("I should see \"Welcome to Orchard\"");
|
||||
#line 14
|
||||
testRunner.And("I should see \"Finish Setup\"");
|
||||
testRunner.And("I should see \"Finish Setup\"");
|
||||
#line 15
|
||||
testRunner.And("the status should be 200 \"OK\"");
|
||||
testRunner.And("the status should be 200 \"OK\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
@@ -102,25 +102,25 @@ this.ScenarioSetup(scenarioInfo);
|
||||
"names"});
|
||||
table2.AddRow(new string[] {
|
||||
"module",
|
||||
"Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Or" +
|
||||
"chard.jQuery, TinyMce, Orchard.PublishLater"});
|
||||
"Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" +
|
||||
"hard.Themes, Orchard.jQuery, TinyMce"});
|
||||
table2.AddRow(new string[] {
|
||||
"core",
|
||||
"Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable," +
|
||||
" Scheduling, Settings, Shapes, XmlRpc"});
|
||||
"Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" +
|
||||
"shLater, Scheduling, Settings, Shapes, XmlRpc"});
|
||||
table2.AddRow(new string[] {
|
||||
"theme",
|
||||
"SafeMode"});
|
||||
#line 18
|
||||
testRunner.Given("I have a clean site with", ((string)(null)), table2);
|
||||
testRunner.Given("I have a clean site with", ((string)(null)), table2);
|
||||
#line 23
|
||||
testRunner.When("I go to \"/Setup\"");
|
||||
testRunner.When("I go to \"/Setup\"");
|
||||
#line 24
|
||||
testRunner.Then("I should see \"Welcome to Orchard\"");
|
||||
testRunner.Then("I should see \"Welcome to Orchard\"");
|
||||
#line 25
|
||||
testRunner.And("I should see \"Finish Setup\"");
|
||||
testRunner.And("I should see \"Finish Setup\"");
|
||||
#line 26
|
||||
testRunner.And("the status should be 200 \"OK\"");
|
||||
testRunner.And("the status should be 200 \"OK\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
@@ -138,26 +138,26 @@ this.ScenarioSetup(scenarioInfo);
|
||||
"names"});
|
||||
table3.AddRow(new string[] {
|
||||
"module",
|
||||
"Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Or" +
|
||||
"chard.jQuery, TinyMce, Orchard.PublishLater"});
|
||||
"Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" +
|
||||
"hard.Themes, Orchard.jQuery, TinyMce"});
|
||||
table3.AddRow(new string[] {
|
||||
"core",
|
||||
"Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable," +
|
||||
" Scheduling, Settings, Shapes, XmlRpc"});
|
||||
"Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" +
|
||||
"shLater, Scheduling, Settings, Shapes, XmlRpc"});
|
||||
table3.AddRow(new string[] {
|
||||
"theme",
|
||||
"SafeMode"});
|
||||
#line 29
|
||||
testRunner.Given("I have a clean site with", ((string)(null)), table3);
|
||||
testRunner.Given("I have a clean site with", ((string)(null)), table3);
|
||||
#line 34
|
||||
testRunner.When("I go to \"/Setup\"");
|
||||
testRunner.When("I go to \"/Setup\"");
|
||||
#line 35
|
||||
testRunner.And("I hit \"Finish Setup\"");
|
||||
testRunner.And("I hit \"Finish Setup\"");
|
||||
#line 36
|
||||
testRunner.Then("I should see \"<input autofocus=\"autofocus\" class=\"input-validation-error\" id=\"Sit" +
|
||||
testRunner.Then("I should see \"<input autofocus=\"autofocus\" class=\"input-validation-error\" id=\"Sit" +
|
||||
"eName\" name=\"SiteName\" type=\"text\" value=\"\" />\"");
|
||||
#line 37
|
||||
testRunner.And("I should see \"<input class=\"input-validation-error\" id=\"AdminPassword\" name=\"Admi" +
|
||||
testRunner.And("I should see \"<input class=\"input-validation-error\" id=\"AdminPassword\" name=\"Admi" +
|
||||
"nPassword\" type=\"password\" />\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
@@ -176,19 +176,19 @@ this.ScenarioSetup(scenarioInfo);
|
||||
"names"});
|
||||
table4.AddRow(new string[] {
|
||||
"module",
|
||||
"Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.Themes, Or" +
|
||||
"chard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce, Orchard.PublishLater"});
|
||||
"Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" +
|
||||
"hard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce"});
|
||||
table4.AddRow(new string[] {
|
||||
"core",
|
||||
"Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable," +
|
||||
" Scheduling, Settings, Shapes, XmlRpc"});
|
||||
"Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" +
|
||||
"shLater, Scheduling, Settings, Shapes, XmlRpc"});
|
||||
table4.AddRow(new string[] {
|
||||
"theme",
|
||||
"SafeMode, TheThemeMachine"});
|
||||
#line 40
|
||||
testRunner.Given("I have a clean site with", ((string)(null)), table4);
|
||||
testRunner.Given("I have a clean site with", ((string)(null)), table4);
|
||||
#line 45
|
||||
testRunner.And("I am on \"/Setup\"");
|
||||
testRunner.And("I am on \"/Setup\"");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@@ -203,15 +203,15 @@ testRunner.And("I am on \"/Setup\"");
|
||||
"ConfirmPassword",
|
||||
"6655321"});
|
||||
#line 46
|
||||
testRunner.When("I fill in", ((string)(null)), table5);
|
||||
testRunner.When("I fill in", ((string)(null)), table5);
|
||||
#line 51
|
||||
testRunner.And("I hit \"Finish Setup\"");
|
||||
testRunner.And("I hit \"Finish Setup\"");
|
||||
#line 52
|
||||
testRunner.And("I go to \"/Default.aspx\"");
|
||||
testRunner.And("I go to \"/Default.aspx\"");
|
||||
#line 53
|
||||
testRunner.Then("I should see \"My Site\"");
|
||||
testRunner.Then("I should see \"My Site\"");
|
||||
#line 54
|
||||
testRunner.And("I should see \"Welcome, <strong>admin</strong>!\"");
|
||||
testRunner.And("I should see \"Welcome, <strong>admin</strong>!\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
|
Reference in New Issue
Block a user