mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-24 16:53:10 +08:00
Fixing MediaPicker functional tests
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Orchard.Specs.Bindings {
|
||||
webApp.GivenIHaveACleanSiteWith(
|
||||
virtualDirectory,
|
||||
TableData(
|
||||
new { extension = "Module", names = "Orchard.Setup, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.Messaging, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp, Orchard.Media" },
|
||||
new { extension = "Module", names = "Orchard.Setup, Orchard.Pages, Orchard.ContentPicker, Orchard.Blogs, Orchard.Messaging, Orchard.MediaLibrary, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Scripting, Orchard.Widgets, Orchard.Users, Orchard.ContentTypes, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce, Orchard.Recipes, Orchard.Warmup, Orchard.Alias, Orchard.Forms, Orchard.Tokens, Orchard.Autoroute, Orchard.Projections, Orchard.Fields, Orchard.MediaProcessing, Orchard.OutputCache, Orchard.Taxonomies, Orchard.Workflows, Orchard.Scripting.CSharp" },
|
||||
new { extension = "Core", names = "Common, Containers, Dashboard, Feeds, Navigation, Contents, Scheduling, Settings, Shapes, XmlRpc, Title, Reports" },
|
||||
new { extension = "Theme", names = "SafeMode, TheAdmin, TheThemeMachine" }));
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
Scenario: Media admin is available
|
||||
Given I have installed Orchard
|
||||
And I have installed "Orchard.Media"
|
||||
And I have enabled "Orchard.Media"
|
||||
|
||||
# Accessing the media page
|
||||
@@ -24,8 +25,6 @@ Scenario: Media admin is available
|
||||
And the status should be 200 "OK"
|
||||
|
||||
# Editing a media with limited rights
|
||||
Given I have installed Orchard
|
||||
And I have enabled "Orchard.Media"
|
||||
When I go to "admin/media/edit?name=..\..\bin&mediaPath=..\..\bin"
|
||||
And I am redirected
|
||||
Then I should see "Media"
|
||||
|
||||
44
src/Orchard.Specs/Media.feature.cs
generated
44
src/Orchard.Specs/Media.feature.cs
generated
@@ -75,14 +75,16 @@ 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.Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 9
|
||||
testRunner.And("I have enabled \"Orchard.Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 11
|
||||
testRunner.When("I go to \"admin/media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 12
|
||||
testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
testRunner.When("I go to \"admin/media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 13
|
||||
testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 14
|
||||
testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 16
|
||||
#line 17
|
||||
testRunner.When("I go to \"admin/media/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@@ -91,31 +93,27 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table1.AddRow(new string[] {
|
||||
"Name",
|
||||
"Hello World"});
|
||||
#line 17
|
||||
#line 18
|
||||
testRunner.And("I fill in", ((string)(null)), table1, "And ");
|
||||
#line 20
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 21
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 22
|
||||
testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 23
|
||||
testRunner.And("I should see \"Hello World\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 24
|
||||
testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 27
|
||||
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
|
||||
#line 28
|
||||
testRunner.And("I have enabled \"Orchard.Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 29
|
||||
testRunner.When("I go to \"admin/media/edit?name=..\\..\\bin&mediaPath=..\\..\\bin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 30
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 31
|
||||
#line 23
|
||||
testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 32
|
||||
#line 24
|
||||
testRunner.And("I should see \"Hello World\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 25
|
||||
testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 28
|
||||
testRunner.When("I go to \"admin/media/edit?name=..\\..\\bin&mediaPath=..\\..\\bin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 29
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 30
|
||||
testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 31
|
||||
testRunner.And("I should see \"Editing failed: Invalid path\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 33
|
||||
#line 32
|
||||
testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
this.ScenarioCleanup();
|
||||
|
||||
@@ -7,7 +7,10 @@ Scenario: Creating and using media fields
|
||||
|
||||
# Creating an Event content type
|
||||
Given I have installed Orchard
|
||||
And I have installed "Orchard.Fields"
|
||||
And I have installed "Orchard.Media"
|
||||
And I have installed "Orchard.MediaPicker"
|
||||
And I have enabled "Orchard.MediaPicker"
|
||||
|
||||
When I go to "Admin/ContentTypes"
|
||||
Then I should see "<a[^>]*>.*?Create new type</a>"
|
||||
When I go to "Admin/ContentTypes/Create"
|
||||
|
||||
80
src/Orchard.Specs/MediaPicker.feature.cs
generated
80
src/Orchard.Specs/MediaPicker.feature.cs
generated
@@ -75,12 +75,16 @@ this.ScenarioSetup(scenarioInfo);
|
||||
#line 9
|
||||
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
|
||||
#line 10
|
||||
testRunner.And("I have installed \"Orchard.Fields\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I have installed \"Orchard.Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 11
|
||||
testRunner.When("I go to \"Admin/ContentTypes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
testRunner.And("I have installed \"Orchard.MediaPicker\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 12
|
||||
testRunner.And("I have enabled \"Orchard.MediaPicker\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 14
|
||||
testRunner.When("I go to \"Admin/ContentTypes\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 15
|
||||
testRunner.Then("I should see \"<a[^>]*>.*?Create new type</a>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 13
|
||||
#line 16
|
||||
testRunner.When("I go to \"Admin/ContentTypes/Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@@ -92,17 +96,17 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table1.AddRow(new string[] {
|
||||
"Name",
|
||||
"Event"});
|
||||
#line 14
|
||||
#line 17
|
||||
testRunner.And("I fill in", ((string)(null)), table1, "And ");
|
||||
#line 18
|
||||
#line 21
|
||||
testRunner.And("I hit \"Create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 19
|
||||
#line 22
|
||||
testRunner.And("I go to \"Admin/ContentTypes/\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 20
|
||||
testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 23
|
||||
testRunner.Then("I should see \"Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 26
|
||||
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 24
|
||||
#line 27
|
||||
testRunner.And("I follow \"Add Field\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@@ -117,17 +121,17 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table2.AddRow(new string[] {
|
||||
"FieldTypeName",
|
||||
"MediaPickerField"});
|
||||
#line 25
|
||||
#line 28
|
||||
testRunner.And("I fill in", ((string)(null)), table2, "And ");
|
||||
#line 30
|
||||
#line 33
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 31
|
||||
#line 34
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 32
|
||||
testRunner.Then("I should see \"The \\\"File\\\" field has been added.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 35
|
||||
testRunner.Then("I should see \"The \\\"File\\\" field has been added.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 38
|
||||
testRunner.When("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 36
|
||||
#line 39
|
||||
testRunner.Then("I should see \"File\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@@ -136,15 +140,15 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table3.AddRow(new string[] {
|
||||
"Event.File.Url",
|
||||
""});
|
||||
#line 37
|
||||
testRunner.When("I fill in", ((string)(null)), table3, "When ");
|
||||
#line 40
|
||||
testRunner.When("I fill in", ((string)(null)), table3, "When ");
|
||||
#line 43
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 41
|
||||
#line 44
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 42
|
||||
testRunner.Then("I should see \"Your Event has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 45
|
||||
testRunner.Then("I should see \"Your Event has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 48
|
||||
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@@ -153,15 +157,15 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table4.AddRow(new string[] {
|
||||
"Fields[0].MediaPickerFieldSettings.Hint",
|
||||
"Please select a file"});
|
||||
#line 46
|
||||
testRunner.And("I fill in", ((string)(null)), table4, "And ");
|
||||
#line 49
|
||||
testRunner.And("I fill in", ((string)(null)), table4, "And ");
|
||||
#line 52
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 50
|
||||
#line 53
|
||||
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 51
|
||||
testRunner.Then("I should see \"Please select a file\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 54
|
||||
testRunner.Then("I should see \"Please select a file\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 57
|
||||
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@@ -170,11 +174,11 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table5.AddRow(new string[] {
|
||||
"Fields[0].MediaPickerFieldSettings.Required",
|
||||
"true"});
|
||||
#line 55
|
||||
testRunner.And("I fill in", ((string)(null)), table5, "And ");
|
||||
#line 58
|
||||
testRunner.And("I fill in", ((string)(null)), table5, "And ");
|
||||
#line 61
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 59
|
||||
#line 62
|
||||
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@@ -183,13 +187,13 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table6.AddRow(new string[] {
|
||||
"Event.File.Url",
|
||||
""});
|
||||
#line 60
|
||||
testRunner.And("I fill in", ((string)(null)), table6, "And ");
|
||||
#line 63
|
||||
testRunner.And("I fill in", ((string)(null)), table6, "And ");
|
||||
#line 66
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 64
|
||||
testRunner.Then("I should see \"The field File is mandatory.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 67
|
||||
testRunner.Then("I should see \"The field File is mandatory.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 70
|
||||
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@@ -201,11 +205,11 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table7.AddRow(new string[] {
|
||||
"Fields[0].MediaPickerFieldSettings.AllowedExtensions",
|
||||
"jpg"});
|
||||
#line 68
|
||||
#line 71
|
||||
testRunner.And("I fill in", ((string)(null)), table7, "And ");
|
||||
#line 72
|
||||
#line 75
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 73
|
||||
#line 76
|
||||
testRunner.And("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@@ -214,11 +218,11 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table8.AddRow(new string[] {
|
||||
"Event.File.Url",
|
||||
"~/Media/Default/images/Image.png"});
|
||||
#line 74
|
||||
testRunner.And("I fill in", ((string)(null)), table8, "And ");
|
||||
#line 77
|
||||
testRunner.And("I fill in", ((string)(null)), table8, "And ");
|
||||
#line 80
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 78
|
||||
#line 81
|
||||
testRunner.Then("I should see \"The field File must have one of these extensions: jpg\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line hidden
|
||||
this.ScenarioCleanup();
|
||||
|
||||
Reference in New Issue
Block a user