From 8022b455606bf471888ba3b76afefe01d1ec56bc Mon Sep 17 00:00:00 2001 From: Renaud Paquay Date: Sat, 17 Jul 2010 13:45:34 -0700 Subject: [PATCH] Fix SpecFlow test HTML generation had changed since last time this test passed. --HG-- branch : dev --- src/Orchard.Specs/MultiTenancy.feature | 268 +++++++++++----------- src/Orchard.Specs/MultiTenancy.feature.cs | 156 +++++++------ 2 files changed, 220 insertions(+), 204 deletions(-) diff --git a/src/Orchard.Specs/MultiTenancy.feature b/src/Orchard.Specs/MultiTenancy.feature index 86047ad79..7530a74b6 100644 --- a/src/Orchard.Specs/MultiTenancy.feature +++ b/src/Orchard.Specs/MultiTenancy.feature @@ -1,158 +1,162 @@ Feature: Multiple tenant management - In order to host several isolated web applications - As a root Orchard system operator - I want to create and manage tenant configurations + In order to host several isolated web applications + As a root Orchard system operator + I want to create and manage tenant configurations Scenario: Default site is listed - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy" - Then I should see "List of Site's Tenants" - And I should see "Default" - And the status should be 200 OK + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy" + Then I should see "List of Site's Tenants" + And I should see "Default" + And the status should be 200 OK Scenario: New tenant fields are required - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I hit "Save" - Then I should see "is required" + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I hit "Save" + Then I should see "is required" Scenario: A new tenant is created - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - And I hit "Save" - And I am redirected - Then I should see "Scott" - And the status should be 200 OK - + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + And I hit "Save" + And I am redirected + Then I should see "

Scott

" + And the status should be 200 OK + Scenario: A new tenant is created with uninitialized state - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - And I hit "Save" - And I am redirected - Then I should see "
  • " - And the status should be 200 OK + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + And I hit "Save" + And I am redirected + Then I should see "
  • " + And the status should be 200 OK Scenario: A new tenant goes to the setup screen - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - | RequestUrlHost | scott.example.org | - And I hit "Save" - And I go to "/Setup" on host scott.example.org - Then I should see "Welcome to Orchard" - And I should see "Finish Setup" - And the status should be 200 OK - + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + | RequestUrlHost | scott.example.org | + And I hit "Save" + And I go to "/Setup" on host scott.example.org + Then I should see "Welcome to Orchard" + And I should see "Finish Setup" + And the status should be 200 OK + Scenario: A new tenant with preconfigured database goes to the setup screen - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - | RequestUrlHost | scott.example.org | - | DataProvider | SqlCe | - And I hit "Save" - And I am redirected - And I go to "/Setup" on host scott.example.org - Then I should see "Welcome to Orchard" - And I should see "Finish Setup" - And I should not see "SQL Server Compact" - And the status should be 200 OK + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + | RequestUrlHost | scott.example.org | + | DataProvider | SqlCe | + And I hit "Save" + And I am redirected + And I go to "/Setup" on host scott.example.org + Then I should see "Welcome to Orchard" + And I should see "Finish Setup" + And I should not see "SQL Server Compact" + And the status should be 200 OK Scenario: A new tenant runs the setup - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - | RequestUrlHost | scott.example.org | - And I hit "Save" - And I go to "/Setup" on host scott.example.org - And I fill in - | name | value | - | SiteName | Scott Site | - | AdminPassword | 6655321 | - And I hit "Finish Setup" - And I go to "/Default.aspx" - Then I should see "

    Scott Site

    " - And I should see "Welcome, admin!" - + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + | RequestUrlHost | scott.example.org | + And I hit "Save" + And I go to "/Setup" on host scott.example.org + And I fill in + | name | value | + | SiteName | Scott Site | + | AdminPassword | 6655321 | + | ConfirmPassword | 6655321 | + And I hit "Finish Setup" + And I go to "/Default.aspx" + Then I should see "

    Scott Site

    " + And I should see "Welcome, admin!" + Scenario: An existing initialized tenant cannot have its database option cleared - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy/Add" - And I fill in - | name | value | - | Name | Scott | - | RequestUrlHost | scott.example.org | - And I hit "Save" - And I go to "/Setup" on host scott.example.org - And I fill in - | name | value | - | SiteName | Scott Site | - | AdminPassword | 6655321 | - And I hit "Finish Setup" + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy/Add" + And I fill in + | name | value | + | Name | Scott | + | RequestUrlHost | scott.example.org | + And I hit "Save" + And I go to "/Setup" on host scott.example.org + And I fill in + | name | value | + | SiteName | Scott Site | + | AdminPassword | 6655321 | + | ConfirmPassword | 6655321 | + And I hit "Finish Setup" And I go to "/Admin/MultiTenancy/Edit/Scott" on host localhost Then I should see "

    Edit Tenant

    " And I should see "

    Scott

    " And I should not see "Allow the tenant to set up the database" Scenario: Default tenant cannot be disabled - Given I have installed Orchard - And I have installed "Orchard.MultiTenancy" - When I go to "Admin/MultiTenancy" + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + When I go to "Admin/MultiTenancy" Then I should not see "
    tenant list - Then I should see "Name: Alpha" - And I should see "Request Url Host: example.org" + Given I have installed Orchard + And I have installed "Orchard.MultiTenancy" + And I have tenant "Alpha" on "example.org" as "New-site-name" + When I execute >tenant list + Then I should see "Name: Alpha" + And I should see "Request Url Host: example.org" diff --git a/src/Orchard.Specs/MultiTenancy.feature.cs b/src/Orchard.Specs/MultiTenancy.feature.cs index ff2891b67..ab8ca4714 100644 --- a/src/Orchard.Specs/MultiTenancy.feature.cs +++ b/src/Orchard.Specs/MultiTenancy.feature.cs @@ -9,7 +9,7 @@ // // ------------------------------------------------------------------------------ #region Designer generated code -namespace Orchard.Tests +namespace Orchard.Specs { using TechTalk.SpecFlow; @@ -124,7 +124,7 @@ testRunner.And("I hit \"Save\""); #line 29 testRunner.And("I am redirected"); #line 30 -testRunner.Then("I should see \"Scott\""); +testRunner.Then("I should see \"

    Scott

    \""); #line 31 testRunner.And("the status should be 200 OK"); #line hidden @@ -289,15 +289,18 @@ testRunner.And("I go to \"/Setup\" on host scott.example.org"); table6.AddRow(new string[] { "AdminPassword", "6655321"}); + table6.AddRow(new string[] { + "ConfirmPassword", + "6655321"}); #line 86 testRunner.And("I fill in", ((string)(null)), table6); -#line 90 -testRunner.And("I hit \"Finish Setup\""); #line 91 -testRunner.And("I go to \"/Default.aspx\""); +testRunner.And("I hit \"Finish Setup\""); #line 92 -testRunner.Then("I should see \"

    Scott Site

    \""); +testRunner.And("I go to \"/Default.aspx\""); #line 93 +testRunner.Then("I should see \"

    Scott Site

    \""); +#line 94 testRunner.And("I should see \"Welcome, admin!\""); #line hidden testRunner.CollectScenarioErrors(); @@ -308,13 +311,13 @@ testRunner.And("I should see \"Welcome, admin!\""); public virtual void AnExistingInitializedTenantCannotHaveItsDatabaseOptionCleared() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("An existing initialized tenant cannot have its database option cleared", ((string[])(null))); -#line 95 -this.ScenarioSetup(scenarioInfo); #line 96 -testRunner.Given("I have installed Orchard"); +this.ScenarioSetup(scenarioInfo); #line 97 -testRunner.And("I have installed \"Orchard.MultiTenancy\""); +testRunner.Given("I have installed Orchard"); #line 98 +testRunner.And("I have installed \"Orchard.MultiTenancy\""); +#line 99 testRunner.When("I go to \"Admin/MultiTenancy/Add\""); #line hidden TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { @@ -326,11 +329,11 @@ testRunner.When("I go to \"Admin/MultiTenancy/Add\""); table7.AddRow(new string[] { "RequestUrlHost", "scott.example.org"}); -#line 99 +#line 100 testRunner.And("I fill in", ((string)(null)), table7); -#line 103 -testRunner.And("I hit \"Save\""); #line 104 +testRunner.And("I hit \"Save\""); +#line 105 testRunner.And("I go to \"/Setup\" on host scott.example.org"); #line hidden TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { @@ -342,17 +345,20 @@ testRunner.And("I go to \"/Setup\" on host scott.example.org"); table8.AddRow(new string[] { "AdminPassword", "6655321"}); -#line 105 + table8.AddRow(new string[] { + "ConfirmPassword", + "6655321"}); +#line 106 testRunner.And("I fill in", ((string)(null)), table8); -#line 109 -testRunner.And("I hit \"Finish Setup\""); -#line 110 -testRunner.And("I go to \"/Admin/MultiTenancy/Edit/Scott\" on host localhost"); #line 111 -testRunner.Then("I should see \"

    Edit Tenant

    \""); +testRunner.And("I hit \"Finish Setup\""); #line 112 -testRunner.And("I should see \"

    Scott

    \""); +testRunner.And("I go to \"/Admin/MultiTenancy/Edit/Scott\" on host localhost"); #line 113 +testRunner.Then("I should see \"

    Edit Tenant

    \""); +#line 114 +testRunner.And("I should see \"

    Scott

    \""); +#line 115 testRunner.And("I should not see \"Allow the tenant to set up the database\""); #line hidden testRunner.CollectScenarioErrors(); @@ -363,15 +369,15 @@ testRunner.And("I should not see \"Allow the tenant to set up the database\""); public virtual void DefaultTenantCannotBeDisabled() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Default tenant cannot be disabled", ((string[])(null))); -#line 115 -this.ScenarioSetup(scenarioInfo); -#line 116 -testRunner.Given("I have installed Orchard"); #line 117 -testRunner.And("I have installed \"Orchard.MultiTenancy\""); +this.ScenarioSetup(scenarioInfo); #line 118 -testRunner.When("I go to \"Admin/MultiTenancy\""); +testRunner.Given("I have installed Orchard"); #line 119 +testRunner.And("I have installed \"Orchard.MultiTenancy\""); +#line 120 +testRunner.When("I go to \"Admin/MultiTenancy\""); +#line 121 testRunner.Then("I should not see \"tenant list"); +this.ScenarioSetup(scenarioInfo); #line 168 -testRunner.Then("I should see \"Name: Alpha\""); +testRunner.Given("I have installed Orchard"); #line 169 +testRunner.And("I have installed \"Orchard.MultiTenancy\""); +#line 170 +testRunner.And("I have tenant \"Alpha\" on \"example.org\" as \"New-site-name\""); +#line 171 +testRunner.When("I execute >tenant list"); +#line 172 +testRunner.Then("I should see \"Name: Alpha\""); +#line 173 testRunner.And("I should see \"Request Url Host: example.org\""); #line hidden testRunner.CollectScenarioErrors();