mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-26 12:03:16 +08:00
* Fixing that RecipeManagerTests failed due to HttpContext not being available * Fixing OwnerEditor tests in CommonPartProviderTests as the owner editor now checks for a different permission since5b0c82d1ad* Fixing typo in CommonPartProviderTests.UpdateModelStub class name * Fixing that test cases for invalid path in FileSystemStorageProviderTests broke ina3e9bef3ca(issue #6802, PR #6919) I should review PRs more carefully! * Fixing CurrentCultureWorkContextTests * Fixing indentation in DefaultDateFormatterTests * Updating Orchard.Azure.Web's required version of System.Web.Mvc to match the rest of the solution * Orchard.Specs: Fixing assembly loading errors when starting up the web host by adding binding redirects * Adding empty compile workflow from dev * Adding the compile workflow's actual contents * Changing default shell to pwsh (msbuild was not found in cmd?) * Adding msbuild to PATH * Removing unused references to System.Net.Http * Replacing System.Net.Http references with its NuGet package to pin the correct version number (experimental) * Upgrading Microsoft.CodeDom.Providers.DotNetCompilerPlatform to 4.1.0 (latest) to get rid of old System.Http.Net dependency * Orchard.proj: Spec target actually depends on only the Compile target, not Package-Stage (experimental) * Compile workflow: Testing the Test and Spec targets * Fixing Test step * Fixing compile workflow to also mark Razor compilation warnings as errors * Restoring Orchard.Specs/Hosting/Orchard.Web/Web.config to match Orchard.Web's web.config closer so that it loads assemblies from the Dependencies folder. This fixes the error with Autofac not being able to resolve dependencies for DefaultOrchardShell * Orchard.Specs/Hosting/Orchard.Web/Global.asax.cs: Workaround for AntiForgeryToken bug in ASP.NET MVC since version 5.2.4 https://github.com/aspnet/AspNetWebStack/issues/162 * Revert "Replacing System.Net.Http references with its NuGet package to pin the correct version number (experimental)" This reverts commit087f2849b1. * Revert "Upgrading Microsoft.CodeDom.Providers.DotNetCompilerPlatform to 4.1.0 (latest) to get rid of old System.Http.Net dependency" This reverts commitbe2ba866e3. * Reverting the addition of assembly binding redirects to Orchard.Specs/Hosting/Simple.Web/Web.config since it doesn't need them like Orchard.Specs/Hosting/Orchard.Web/Web.config does * Disabling Test and Spec execution for now * Orchard.Framework: Making the System.Net.Http not-private to prevent an outdated version sticking around * Orchard.Workflows: Adding assembly binding redirect for System.Net.Http to avoid Razor compilation warning * Moving the System.Net.Http assembly redirect to Orchard.Web * Specs: Fixing "I can create browse blog posts on several pages" Blog test's usage of "I should not see" and correcting the parameters too because unlike "I should see", this is not a regex match, just contains * Specs: Fixing "I can create browse blog posts on several pages" Blog test's flakyness due to timing because the blog posts are created quickly after one another and the lack of millisecond-precision can cause the blog posts to appear out of order of creation * Specs: Media test simplified since the Orchard.Media feature is deprecated * Adding step to the Compile workflow to upload the MSBuild binlog results * Pinning the referenced version of System.Net.Http to 4.2.0.0 to prevent Razor compilation warning System.Net.Http is known to have such problems across different framework versions ways of referencing it The original warning is: ASPNETCOMPILER : error : The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: Orchard.Workflows, Version=1.10.3.0, Culture=neutral, PublicKeyToken=null. The dependencies are: System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. You should either ensure that the dependent assembly is correct for the target framework, or ensure that the target framework you are addressing is that of the dependent assembly. [D:\a\Orchard\Orchard\src\Orchard.Web\Modules\Orchard.Workflows\Orchard.Workflows.csproj * Re-enabling the Test step * Re-enabling the Specs step * Marking System.Net.Http references as private (copy local) to make sure that it's always available, because it requires a specific version * Revert "Marking System.Net.Http references as private (copy local) to make sure that it's always available, because it requires a specific version" This reverts commite4f5632236. * Orchard.Specs: Adding Settings feature * Orchard.Specs: Updating DateTime.CreatingAndUsingDateTimeFieldsInAnotherCulture structure without functional change * Orchard.Specs: Updating Settings.AddingANewSiteCultureAndSelectingItAsTheDefaultWorks to correctly detect that a culture that wasn't added before can be set as default * Fixing Newtonsoft.Json references * Specs: Workaround for the DefineDefaultCulture binding and removing the Settings feature which is now redundant with CreatingAndUsingDateTimeFieldsInAnotherCulture * Updating the compile workflow to run the build + tests on PR, dev and 1.10.x commits * Adding the compile workflow to the solution
308 lines
12 KiB
Gherkin
308 lines
12 KiB
Gherkin
Feature: Blog
|
|
In order to add blogs to my site
|
|
As an author
|
|
I want to create blogs and create, publish and edit blog posts
|
|
|
|
Scenario: In the admin (menu) there is a link to create a Blog
|
|
Given I have installed Orchard
|
|
When I go to "admin"
|
|
Then I should see "<a[^>]*href="/Admin/Blogs/Create"[^>]*>Blog</a>"
|
|
|
|
Scenario: I can create a new blog and blog post
|
|
Given I have installed Orchard
|
|
When I go to "admin/blogs/create"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Blog |
|
|
And I hit "Save"
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post |
|
|
| Body.Text | Hi there. |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
Then I should see "Your Blog Post has been created."
|
|
When I go to "my-blog"
|
|
Then I should see "<h1[^>]*>.*?My Blog.*?</h1>"
|
|
And I should see "<h1[^>]*>.*?My Post.*?</h1>"
|
|
When I go to "my-blog/my-post"
|
|
Then I should see "<h1[^>]*>.*?My Post.*?</h1>"
|
|
And I should see "Hi there."
|
|
|
|
Scenario: I can create a new blog with multiple blog posts each with the same title and unique slugs are generated or given for said posts
|
|
Given I have installed Orchard
|
|
When I go to "admin/blogs/create"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Blog |
|
|
And I hit "Save"
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post |
|
|
| Body.Text | Hi there. |
|
|
And I hit "Publish Now"
|
|
And I go to "my-blog/my-post"
|
|
Then I should see "<h1[^>]*>.*?My Post.*?</h1>"
|
|
And I should see "Hi there."
|
|
When I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post |
|
|
| Body.Text | Hi there, again. |
|
|
And I hit "Publish Now"
|
|
And I go to "my-blog/my-post-2"
|
|
Then I should see "<h1[^>]*>.*?My Post.*?</h1>"
|
|
And I should see "Hi there, again."
|
|
When I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post |
|
|
| AutoroutePart.CurrentUrl | my-blog/my-post |
|
|
| Body.Text | Are you still there? |
|
|
And I hit "Publish Now"
|
|
And I go to "my-blog/my-post-3"
|
|
Then I should see "<h1[^>]*>.*?My Post.*?</h1>"
|
|
And I should see "Are you still there?"
|
|
|
|
Scenario: When viewing a blog the user agent is given an RSS feed of the blog's posts
|
|
Given I have installed Orchard
|
|
When I go to "admin/blogs/create"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Blog |
|
|
And I hit "Save"
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post |
|
|
| Body.Text | Hi there. |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "my-blog/my-post"
|
|
Then I should see "<link rel="alternate" type="application/rss\+xml" title="My Blog" href="/rss\?containerid=\d+" />"
|
|
|
|
Scenario: Enabling remote blog publishing inserts the appropriate metaweblogapi markup into the blog's page
|
|
Given I have installed Orchard
|
|
And I have enabled "XmlRpc"
|
|
And I have enabled "Orchard.Blogs.RemotePublishing"
|
|
When I go to "admin/blogs/create"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Blog |
|
|
And I hit "Save"
|
|
And I go to "my-blog"
|
|
Then I should see "<link href="[^"]*/XmlRpc/LiveWriter/Manifest" rel="wlwmanifest" type="application/wlwmanifest\+xml" />"
|
|
When I go to "/XmlRpc/LiveWriter/Manifest"
|
|
Then the content type should be "\btext/xml\b"
|
|
And I should see "<manifest xmlns="http\://schemas\.microsoft\.com/wlw/manifest/weblog">"
|
|
And I should see "<clientType>Metaweblog</clientType>"
|
|
|
|
Scenario: The virtual path of my installation when not at the root is reflected in the URL example for the slug field when creating a blog or blog post
|
|
Given I have installed Orchard at "/OrchardLocal"
|
|
When I go to "admin/blogs/create"
|
|
Then I should see "<span>http\://localhost/OrchardLocal/</span>"
|
|
When I fill in
|
|
| name | value |
|
|
| Title.Title | My Blog |
|
|
And I hit "Save"
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
Then I should see "<span>http\://localhost/OrchardLocal/</span>"
|
|
|
|
Scenario: The virtual path of my installation when at the root is reflected in the URL example for the slug field when creating a blog or blog post
|
|
Given I have installed Orchard at "/"
|
|
When I go to "admin/blogs/create"
|
|
Then I should see "<span>http\://localhost/</span>"
|
|
When I fill in
|
|
| name | value |
|
|
| Title.Title | My Blog |
|
|
And I hit "Save"
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
Then I should see "<span>http\://localhost/</span>"
|
|
|
|
Scenario: I set my blog to be the content for the home page and the posts for the blog be rooted to the app
|
|
Given I have installed Orchard
|
|
When I go to "admin/blogs/create"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Blog |
|
|
| AutoroutePart.PromoteToHomePage | true |
|
|
And I hit "Save"
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post |
|
|
| Body.Text | Hi there. |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "/"
|
|
Then I should see "<h1>My Blog</h1>"
|
|
When I go to "/my-blog"
|
|
Then the status should be 200 "OK"
|
|
When I go to "/"
|
|
Then the status should be 200 "OK"
|
|
When I go to "/my-post"
|
|
Then I should see "<h1>My Post</h1>"
|
|
|
|
Scenario: I can create browse blog posts on several pages
|
|
Given I have installed Orchard
|
|
When I go to "admin/blogs/create"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Blog |
|
|
And I hit "Save"
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 1 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 2 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 3 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 4 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 5 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 6 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 7 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 8 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 9 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 10 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 11 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I wait "1000"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post 12 |
|
|
And I hit "Publish Now"
|
|
And I am redirected
|
|
Then I should see "Your Blog Post has been created."
|
|
When I go to "my-blog"
|
|
Then I should see "<h1[^>]*>.*?My Blog.*?</h1>"
|
|
And I should see "<h1[^>]*>.*?My Post 12.*?</h1>"
|
|
And I should see "<h1[^>]*>.*?My Post 11.*?</h1>"
|
|
And I should not see "My Post 2"
|
|
When I go to "my-blog?page=2"
|
|
Then I should see "<h1[^>]*>.*?My Blog.*?</h1>"
|
|
And I should see "<h1[^>]*>.*?My Post 1.*?</h1>"
|
|
And I should see "<h1[^>]*>.*?My Post 2.*?</h1>"
|
|
And I should not see "My Post 3"
|
|
|
|
Scenario: I can create a new blog with a percent sign in the title and it gets stripped out of the slug
|
|
Given I have installed Orchard
|
|
When I go to "admin/blogs/create"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Blog |
|
|
And I hit "Save"
|
|
And I go to "admin/blogs"
|
|
And I follow "My Blog"
|
|
And I follow "New Post" where class name has "primaryAction"
|
|
And I fill in
|
|
| name | value |
|
|
| Title.Title | My Post with a % Sign |
|
|
| Body.Text | Hi there. |
|
|
And I hit "Publish Now"
|
|
And I go to "my-blog/my-post-with-a-sign"
|
|
Then I should see "<h1[^>]*>.*?My Post with a % Sign.*?</h1>"
|
|
And I should see "Hi there." |