Adding specflow test for Users module

--HG--
branch : dev
extra : transplant_source : %ECV%0C%F7%B4%99w%8E%24h%D0%8CM%FC%0A%3D%5D%C2t%B1
This commit is contained in:
Sebastien Ros
2011-01-16 22:41:28 -08:00
parent b1c782004b
commit 5ab768a0d7
4 changed files with 987 additions and 1 deletions

View File

@@ -196,6 +196,11 @@
<DesignTime>True</DesignTime>
<DependentUpon>SiteCompilation.feature</DependentUpon>
</Compile>
<Compile Include="Users.feature.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Users.feature</DependentUpon>
</Compile>
<Compile Include="UsingSpecFlow.feature.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -296,6 +301,10 @@
<Generator>SpecFlowSingleFileGenerator</Generator>
<LastGenOutput>Pages.feature.cs</LastGenOutput>
</None>
<None Include="Users.feature">
<Generator>SpecFlowSingleFileGenerator</Generator>
<LastGenOutput>Users.feature.cs</LastGenOutput>
</None>
<None Include="WebHosting.feature">
<Generator>SpecFlowSingleFileGenerator</Generator>
<LastGenOutput>WebHosting.feature.cs</LastGenOutput>

View File

@@ -0,0 +1,262 @@
Feature: Users
In order to prevent users module regressions
As a site owner
I want to create, search and modify user accounts
@management
Scenario: There is only one user by default
Given I have installed Orchard
When I go to "admin/users"
Then I should see "Manage Users"
And I should see "<a[^>]*>admin</a>"
@management
Scenario: I can create a new user
Given I have installed Orchard
When I go to "admin/users"
Then I should see "Manage Users"
When I follow "Add a new user"
And I fill in
| name | value |
| UserName | user1 |
| Email | user1@domain.com |
| Password | a12345! |
| ConfirmPassword | a12345! |
And I hit "Save"
And I am redirected
Then I should see "User created"
When I follow "Add a new user"
And I fill in
| name | value |
| UserName | user2 |
| Email | user2@domain.com |
| Password | a12345! |
| ConfirmPassword | a12345! |
| UserRoles.Roles[0].Granted | true |
And I hit "Save"
And I am redirected
Then I should see "User created"
And I should see "Adding role Administrator to user user2"
When I follow "Add a new user"
And I fill in
| name | value |
| UserName | user3 |
| Email | user3@domain.com |
| Password | a12345! |
| ConfirmPassword | a12345! |
| UserRoles.Roles[0].Granted | true |
| UserRoles.Roles[1].Granted | true |
| UserRoles.Roles[2].Granted | true |
| UserRoles.Roles[3].Granted | true |
| UserRoles.Roles[4].Granted | true |
And I hit "Save"
And I am redirected
Then I should see "User created"
And I should see "Adding role Administrator to user user3"
And I should see "Adding role Editor to user user3"
And I should see "Adding role Moderator to user user3"
And I should see "Adding role Author to user user3"
And I should see "Adding role Contributor to user user3"
When I follow "Add a new user"
And I hit "Save"
Then I should see "The UserName field is required."
Then I should see "The Email field is required."
Then I should see "The Password field is required."
Then I should see "The ConfirmPassword field is required."
When I go to "admin/users"
And I follow "Add a new user"
And I fill in
| name | value |
| UserName | user4 |
| Email | user4@domain.com |
| Password | a12345! |
| ConfirmPassword | a123456! |
And I hit "Save"
Then I should see "Password confirmation must match"
@management
Scenario: I can edit an existing user
Given I have installed Orchard
When I go to "admin/users"
And I follow "Add a new user"
And I fill in
| name | value |
| UserName | user1 |
| Email | user1@domain.com |
| Password | a12345! |
| ConfirmPassword | a12345! |
And I hit "Save"
And I am redirected
Then I should see "User created"
When I fill in
| name | value |
| Options.Search | user1 |
And I hit "Filter"
Then I should see "<a[^>]*>user1</a>"
When I follow "Edit"
And I fill in
| name | value |
| UserName | user2 |
| Email | user2@domain.com |
And I hit "Save"
And I am redirected
Then I should see "User information updated"
And I should see "<a[^>]*>user2</a>"
And I should see "user2@domain.com"
@management
Scenario: I should not be able to reuse an existing username or email
Given I have installed Orchard
When I go to "admin/users"
# create user1
And I follow "Add a new user"
And I fill in
| name | value |
| UserName | user1 |
| Email | user1@domain.com |
| Password | a12345! |
| ConfirmPassword | a12345! |
And I hit "Save"
And I am redirected
# create user2
And I follow "Add a new user"
And I fill in
| name | value |
| UserName | user2 |
| Email | user2@domain.com |
| Password | a12345! |
| ConfirmPassword | a12345! |
And I hit "Save"
And I am redirected
Then I should see "<a[^>]*>user1</a>"
And I should see "<a[^>]*>user2</a>"
# filtering on 'user1' to have only one Edit link to follow
When I fill in
| name | value |
| Options.Search | user1 |
And I hit "Filter"
Then I should see "<a[^>]*>user1</a>"
When I follow "Edit"
And I fill in
| name | value |
| UserName | user2 |
| Email | user1@domain.com |
And I hit "Save"
Then I should see "User with that username and/or email already exists."
When I fill in
| name | value |
| UserName | user1 |
| Email | user2@domain.com |
And I hit "Save"
Then I should see "User with that username and/or email already exists."
@filtering
Scenario: I should not be able to filter users by name
Given I have installed Orchard
When I go to "admin/users"
# create user1
And I follow "Add a new user"
And I fill in
| name | value |
| UserName | user1 |
| Email | user1@domain.com |
| Password | a12345! |
| ConfirmPassword | a12345! |
And I hit "Save"
And I am redirected
# create user2
And I follow "Add a new user"
And I fill in
| name | value |
| UserName | user2 |
| Email | user2@domain.com |
| Password | a12345! |
| ConfirmPassword | a12345! |
And I hit "Save"
And I am redirected
Then I should see "<a[^>]*>user1</a>"
And I should see "<a[^>]*>user2</a>"
When I fill in
| name | value |
| Options.Search | user1 |
And I hit "Filter"
Then I should see "<a[^>]*>user1</a>"
And I should not see "<a[^>]*>admin</a>"
And I should not see "<a[^>]*>user2</a>"
When I fill in
| name | value |
| Options.Search | user1@domain.com |
And I hit "Filter"
Then I should see "<a[^>]*>user1</a>"
And I should not see "<a[^>]*>admin</a>"
And I should not see "<a[^>]*>user2</a>"
When I fill in
| name | value |
| Options.Search | @domain.com |
And I hit "Filter"
Then I should see "<a[^>]*>user1</a>"
And I should see "<a[^>]*>user2</a>"
And I should not see "<a[^>]*>admin</a>"
@filtering
Scenario: I should be able to filter users by status
Given I have installed Orchard
When I go to "admin/users"
# create user1
And I follow "Add a new user"
And I fill in
| name | value |
| UserName | user1 |
| Email | user1@domain.com |
| Password | a12345! |
| ConfirmPassword | a12345! |
And I hit "Save"
And I am redirected
# create user2
And I follow "Add a new user"
And I fill in
| name | value |
| UserName | user2 |
| Email | user2@domain.com |
| Password | a12345! |
| ConfirmPassword | a12345! |
And I hit "Save"
And I am redirected
Then I should see "<a[^>]*>user1</a>"
And I should see "<a[^>]*>user2</a>"
When I fill in
| name | value |
| Options.Search | user1 |
And I hit "Filter"
Then I should see "<a[^>]*>user1</a>"
When I follow "Disable"
And I am redirected
Then I should see "User user1 disabled"
When I fill in
| name | value |
| Options.Filter | Pending |
And I hit "Filter"
Then I should see "<a[^>]*>user1</a>"
And I should not see "<a[^>]*>user2</a>"
And I should not see "<a[^>]*>admin</a>"
When I fill in
| name | value |
| Options.Filter | EmailPending |
And I hit "Filter"
Then I should not see "<a[^>]*>user1</a>"
And I should not see "<a[^>]*>user2</a>"
And I should not see "<a[^>]*>admin</a>"
When I fill in
| name | value |
| Options.Filter | Approved |
And I hit "Filter"
Then I should not see "<a[^>]*>user1</a>"
And I should see "<a[^>]*>user2</a>"
And I should see "<a[^>]*>admin</a>"
When I fill in
| name | value |
| Options.Filter | All |
And I hit "Filter"
Then I should see "<a[^>]*>user1</a>"
And I should see "<a[^>]*>user2</a>"
And I should see "<a[^>]*>admin</a>"

715
src/Orchard.Specs/Users.feature.cs generated Normal file
View File

@@ -0,0 +1,715 @@
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.5.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.5.0.0")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Users")]
public partial class UsersFeature
{
private static TechTalk.SpecFlow.ITestRunner testRunner;
#line 1 "Users.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"), "Users", "In order to prevent users module regressions\nAs a site owner\nI want to create, se" +
"arch and modify user accounts", 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("There is only one user by default")]
[NUnit.Framework.CategoryAttribute("management")]
public virtual void ThereIsOnlyOneUserByDefault()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("There is only one user by default", new string[] {
"management"});
#line 7
this.ScenarioSetup(scenarioInfo);
#line 8
testRunner.Given("I have installed Orchard");
#line 9
testRunner.When("I go to \"admin/users\"");
#line 10
testRunner.Then("I should see \"Manage Users\"");
#line 11
testRunner.And("I should see \"<a[^>]*>admin</a>\"");
#line hidden
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("I can create a new user")]
[NUnit.Framework.CategoryAttribute("management")]
public virtual void ICanCreateANewUser()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new user", new string[] {
"management"});
#line 14
this.ScenarioSetup(scenarioInfo);
#line 15
testRunner.Given("I have installed Orchard");
#line 16
testRunner.When("I go to \"admin/users\"");
#line 17
testRunner.Then("I should see \"Manage Users\"");
#line 18
testRunner.When("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table1.AddRow(new string[] {
"UserName",
"user1"});
table1.AddRow(new string[] {
"Email",
"user1@domain.com"});
table1.AddRow(new string[] {
"Password",
"a12345!"});
table1.AddRow(new string[] {
"ConfirmPassword",
"a12345!"});
#line 19
testRunner.And("I fill in", ((string)(null)), table1);
#line 25
testRunner.And("I hit \"Save\"");
#line 26
testRunner.And("I am redirected");
#line 27
testRunner.Then("I should see \"User created\"");
#line 28
testRunner.When("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table2.AddRow(new string[] {
"UserName",
"user2"});
table2.AddRow(new string[] {
"Email",
"user2@domain.com"});
table2.AddRow(new string[] {
"Password",
"a12345!"});
table2.AddRow(new string[] {
"ConfirmPassword",
"a12345!"});
table2.AddRow(new string[] {
"UserRoles.Roles[0].Granted",
"true"});
#line 29
testRunner.And("I fill in", ((string)(null)), table2);
#line 36
testRunner.And("I hit \"Save\"");
#line 37
testRunner.And("I am redirected");
#line 38
testRunner.Then("I should see \"User created\"");
#line 39
testRunner.And("I should see \"Adding role Administrator to user user2\"");
#line 40
testRunner.When("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table3.AddRow(new string[] {
"UserName",
"user3"});
table3.AddRow(new string[] {
"Email",
"user3@domain.com"});
table3.AddRow(new string[] {
"Password",
"a12345!"});
table3.AddRow(new string[] {
"ConfirmPassword",
"a12345!"});
table3.AddRow(new string[] {
"UserRoles.Roles[0].Granted",
"true"});
table3.AddRow(new string[] {
"UserRoles.Roles[1].Granted",
"true"});
table3.AddRow(new string[] {
"UserRoles.Roles[2].Granted",
"true"});
table3.AddRow(new string[] {
"UserRoles.Roles[3].Granted",
"true"});
table3.AddRow(new string[] {
"UserRoles.Roles[4].Granted",
"true"});
#line 41
testRunner.And("I fill in", ((string)(null)), table3);
#line 52
testRunner.And("I hit \"Save\"");
#line 53
testRunner.And("I am redirected");
#line 54
testRunner.Then("I should see \"User created\"");
#line 55
testRunner.And("I should see \"Adding role Administrator to user user3\"");
#line 56
testRunner.And("I should see \"Adding role Editor to user user3\"");
#line 57
testRunner.And("I should see \"Adding role Moderator to user user3\"");
#line 58
testRunner.And("I should see \"Adding role Author to user user3\"");
#line 59
testRunner.And("I should see \"Adding role Contributor to user user3\"");
#line 60
testRunner.When("I follow \"Add a new user\"");
#line 61
testRunner.And("I hit \"Save\"");
#line 62
testRunner.Then("I should see \"The UserName field is required.\"");
#line 63
testRunner.Then("I should see \"The Email field is required.\"");
#line 64
testRunner.Then("I should see \"The Password field is required.\"");
#line 65
testRunner.Then("I should see \"The ConfirmPassword field is required.\"");
#line 66
testRunner.When("I go to \"admin/users\"");
#line 67
testRunner.And("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table4.AddRow(new string[] {
"UserName",
"user4"});
table4.AddRow(new string[] {
"Email",
"user4@domain.com"});
table4.AddRow(new string[] {
"Password",
"a12345!"});
table4.AddRow(new string[] {
"ConfirmPassword",
"a123456!"});
#line 68
testRunner.And("I fill in", ((string)(null)), table4);
#line 74
testRunner.And("I hit \"Save\"");
#line 75
testRunner.Then("I should see \"Password confirmation must match\"");
#line hidden
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("I can edit an existing user")]
[NUnit.Framework.CategoryAttribute("management")]
public virtual void ICanEditAnExistingUser()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can edit an existing user", new string[] {
"management"});
#line 78
this.ScenarioSetup(scenarioInfo);
#line 79
testRunner.Given("I have installed Orchard");
#line 80
testRunner.When("I go to \"admin/users\"");
#line 81
testRunner.And("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table5.AddRow(new string[] {
"UserName",
"user1"});
table5.AddRow(new string[] {
"Email",
"user1@domain.com"});
table5.AddRow(new string[] {
"Password",
"a12345!"});
table5.AddRow(new string[] {
"ConfirmPassword",
"a12345!"});
#line 82
testRunner.And("I fill in", ((string)(null)), table5);
#line 88
testRunner.And("I hit \"Save\"");
#line 89
testRunner.And("I am redirected");
#line 90
testRunner.Then("I should see \"User created\"");
#line hidden
TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table6.AddRow(new string[] {
"Options.Search",
"user1"});
#line 91
testRunner.When("I fill in", ((string)(null)), table6);
#line 94
testRunner.And("I hit \"Filter\"");
#line 95
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 96
testRunner.When("I follow \"Edit\"");
#line hidden
TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table7.AddRow(new string[] {
"UserName",
"user2"});
table7.AddRow(new string[] {
"Email",
"user2@domain.com"});
#line 97
testRunner.And("I fill in", ((string)(null)), table7);
#line 101
testRunner.And("I hit \"Save\"");
#line 102
testRunner.And("I am redirected");
#line 103
testRunner.Then("I should see \"User information updated\"");
#line 104
testRunner.And("I should see \"<a[^>]*>user2</a>\"");
#line 105
testRunner.And("I should see \"user2@domain.com\"");
#line hidden
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("I should not be able to reuse an existing username or email")]
[NUnit.Framework.CategoryAttribute("management")]
public virtual void IShouldNotBeAbleToReuseAnExistingUsernameOrEmail()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should not be able to reuse an existing username or email", new string[] {
"management"});
#line 108
this.ScenarioSetup(scenarioInfo);
#line 109
testRunner.Given("I have installed Orchard");
#line 110
testRunner.When("I go to \"admin/users\"");
#line 112
testRunner.And("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table8.AddRow(new string[] {
"UserName",
"user1"});
table8.AddRow(new string[] {
"Email",
"user1@domain.com"});
table8.AddRow(new string[] {
"Password",
"a12345!"});
table8.AddRow(new string[] {
"ConfirmPassword",
"a12345!"});
#line 113
testRunner.And("I fill in", ((string)(null)), table8);
#line 119
testRunner.And("I hit \"Save\"");
#line 120
testRunner.And("I am redirected");
#line 122
testRunner.And("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table9.AddRow(new string[] {
"UserName",
"user2"});
table9.AddRow(new string[] {
"Email",
"user2@domain.com"});
table9.AddRow(new string[] {
"Password",
"a12345!"});
table9.AddRow(new string[] {
"ConfirmPassword",
"a12345!"});
#line 123
testRunner.And("I fill in", ((string)(null)), table9);
#line 129
testRunner.And("I hit \"Save\"");
#line 130
testRunner.And("I am redirected");
#line 131
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 132
testRunner.And("I should see \"<a[^>]*>user2</a>\"");
#line hidden
TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table10.AddRow(new string[] {
"Options.Search",
"user1"});
#line 134
testRunner.When("I fill in", ((string)(null)), table10);
#line 137
testRunner.And("I hit \"Filter\"");
#line 138
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 139
testRunner.When("I follow \"Edit\"");
#line hidden
TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table11.AddRow(new string[] {
"UserName",
"user2"});
table11.AddRow(new string[] {
"Email",
"user1@domain.com"});
#line 140
testRunner.And("I fill in", ((string)(null)), table11);
#line 144
testRunner.And("I hit \"Save\"");
#line 145
testRunner.Then("I should see \"User with that username and/or email already exists.\"");
#line hidden
TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table12.AddRow(new string[] {
"UserName",
"user1"});
table12.AddRow(new string[] {
"Email",
"user2@domain.com"});
#line 146
testRunner.When("I fill in", ((string)(null)), table12);
#line 150
testRunner.And("I hit \"Save\"");
#line 151
testRunner.Then("I should see \"User with that username and/or email already exists.\"");
#line hidden
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("I should not be able to filter users by name")]
[NUnit.Framework.CategoryAttribute("filtering")]
public virtual void IShouldNotBeAbleToFilterUsersByName()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should not be able to filter users by name", new string[] {
"filtering"});
#line 154
this.ScenarioSetup(scenarioInfo);
#line 155
testRunner.Given("I have installed Orchard");
#line 156
testRunner.When("I go to \"admin/users\"");
#line 158
testRunner.And("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table13.AddRow(new string[] {
"UserName",
"user1"});
table13.AddRow(new string[] {
"Email",
"user1@domain.com"});
table13.AddRow(new string[] {
"Password",
"a12345!"});
table13.AddRow(new string[] {
"ConfirmPassword",
"a12345!"});
#line 159
testRunner.And("I fill in", ((string)(null)), table13);
#line 165
testRunner.And("I hit \"Save\"");
#line 166
testRunner.And("I am redirected");
#line 168
testRunner.And("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table14.AddRow(new string[] {
"UserName",
"user2"});
table14.AddRow(new string[] {
"Email",
"user2@domain.com"});
table14.AddRow(new string[] {
"Password",
"a12345!"});
table14.AddRow(new string[] {
"ConfirmPassword",
"a12345!"});
#line 169
testRunner.And("I fill in", ((string)(null)), table14);
#line 175
testRunner.And("I hit \"Save\"");
#line 176
testRunner.And("I am redirected");
#line 177
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 178
testRunner.And("I should see \"<a[^>]*>user2</a>\"");
#line hidden
TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table15.AddRow(new string[] {
"Options.Search",
"user1"});
#line 179
testRunner.When("I fill in", ((string)(null)), table15);
#line 182
testRunner.And("I hit \"Filter\"");
#line 183
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 184
testRunner.And("I should not see \"<a[^>]*>admin</a>\"");
#line 185
testRunner.And("I should not see \"<a[^>]*>user2</a>\"");
#line hidden
TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table16.AddRow(new string[] {
"Options.Search",
"user1@domain.com"});
#line 186
testRunner.When("I fill in", ((string)(null)), table16);
#line 189
testRunner.And("I hit \"Filter\"");
#line 190
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 191
testRunner.And("I should not see \"<a[^>]*>admin</a>\"");
#line 192
testRunner.And("I should not see \"<a[^>]*>user2</a>\"");
#line hidden
TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table17.AddRow(new string[] {
"Options.Search",
"@domain.com"});
#line 193
testRunner.When("I fill in", ((string)(null)), table17);
#line 196
testRunner.And("I hit \"Filter\"");
#line 197
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 198
testRunner.And("I should see \"<a[^>]*>user2</a>\"");
#line 199
testRunner.And("I should not see \"<a[^>]*>admin</a>\"");
#line hidden
testRunner.CollectScenarioErrors();
}
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("I should be able to filter users by status")]
[NUnit.Framework.CategoryAttribute("filtering")]
public virtual void IShouldBeAbleToFilterUsersByStatus()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I should be able to filter users by status", new string[] {
"filtering"});
#line 202
this.ScenarioSetup(scenarioInfo);
#line 203
testRunner.Given("I have installed Orchard");
#line 204
testRunner.When("I go to \"admin/users\"");
#line 206
testRunner.And("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table18.AddRow(new string[] {
"UserName",
"user1"});
table18.AddRow(new string[] {
"Email",
"user1@domain.com"});
table18.AddRow(new string[] {
"Password",
"a12345!"});
table18.AddRow(new string[] {
"ConfirmPassword",
"a12345!"});
#line 207
testRunner.And("I fill in", ((string)(null)), table18);
#line 213
testRunner.And("I hit \"Save\"");
#line 214
testRunner.And("I am redirected");
#line 216
testRunner.And("I follow \"Add a new user\"");
#line hidden
TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table19.AddRow(new string[] {
"UserName",
"user2"});
table19.AddRow(new string[] {
"Email",
"user2@domain.com"});
table19.AddRow(new string[] {
"Password",
"a12345!"});
table19.AddRow(new string[] {
"ConfirmPassword",
"a12345!"});
#line 217
testRunner.And("I fill in", ((string)(null)), table19);
#line 223
testRunner.And("I hit \"Save\"");
#line 224
testRunner.And("I am redirected");
#line 225
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 226
testRunner.And("I should see \"<a[^>]*>user2</a>\"");
#line hidden
TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table20.AddRow(new string[] {
"Options.Search",
"user1"});
#line 227
testRunner.When("I fill in", ((string)(null)), table20);
#line 230
testRunner.And("I hit \"Filter\"");
#line 231
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 232
testRunner.When("I follow \"Disable\"");
#line 233
testRunner.And("I am redirected");
#line 234
testRunner.Then("I should see \"User user1 disabled\"");
#line hidden
TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table21.AddRow(new string[] {
"Options.Filter",
"Pending"});
#line 235
testRunner.When("I fill in", ((string)(null)), table21);
#line 238
testRunner.And("I hit \"Filter\"");
#line 239
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 240
testRunner.And("I should not see \"<a[^>]*>user2</a>\"");
#line 241
testRunner.And("I should not see \"<a[^>]*>admin</a>\"");
#line hidden
TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table22.AddRow(new string[] {
"Options.Filter",
"EmailPending"});
#line 242
testRunner.When("I fill in", ((string)(null)), table22);
#line 245
testRunner.And("I hit \"Filter\"");
#line 246
testRunner.Then("I should not see \"<a[^>]*>user1</a>\"");
#line 247
testRunner.And("I should not see \"<a[^>]*>user2</a>\"");
#line 248
testRunner.And("I should not see \"<a[^>]*>admin</a>\"");
#line hidden
TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table23.AddRow(new string[] {
"Options.Filter",
"Approved"});
#line 249
testRunner.When("I fill in", ((string)(null)), table23);
#line 252
testRunner.And("I hit \"Filter\"");
#line 253
testRunner.Then("I should not see \"<a[^>]*>user1</a>\"");
#line 254
testRunner.And("I should see \"<a[^>]*>user2</a>\"");
#line 255
testRunner.And("I should see \"<a[^>]*>admin</a>\"");
#line hidden
TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] {
"name",
"value"});
table24.AddRow(new string[] {
"Options.Filter",
"All"});
#line 256
testRunner.When("I fill in", ((string)(null)), table24);
#line 259
testRunner.And("I hit \"Filter\"");
#line 260
testRunner.Then("I should see \"<a[^>]*>user1</a>\"");
#line 261
testRunner.And("I should see \"<a[^>]*>user2</a>\"");
#line 262
testRunner.And("I should see \"<a[^>]*>admin</a>\"");
#line hidden
testRunner.CollectScenarioErrors();
}
}
}
#endregion

View File

@@ -36,7 +36,7 @@
@Html.SelectOption(Model.Options.Order, UsersOrder.Name, T("Name").ToString())
@Html.SelectOption(Model.Options.Order, UsersOrder.Email, T("Email").ToString())
</select>
<button type="submit" name="submit.Filter" value="@T("Apply")">@T("Apply")</button>
<button type="submit" name="submit.Filter" value="@T("Filter")">@T("Filter")</button>
</fieldset>
<fieldset>
<table class="items">