From 2816435fe5ce9983d6289d6a9341f46fe2d2ba35 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Sat, 15 Oct 2016 11:29:08 -0400 Subject: [PATCH 1/7] Adding test for cloning sites --- features/clone.feature | 105 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 features/clone.feature diff --git a/features/clone.feature b/features/clone.feature new file mode 100644 index 0000000..01a0fba --- /dev/null +++ b/features/clone.feature @@ -0,0 +1,105 @@ +Feature: Clone a website. + + + @api + Scenario: Clone a Drupal site. + 1. Create a drupal7 platform. + 2. Create a second drupal7 platform + 3. Clone the drupal7 site from one platform to another. + + TODO: make a scenario for creating clones able to select from the platform. + TODO: 4. Clone the drupal7 site to the same platform. + TODO: 5. Clone the drupal7 site to a newer platform with updates. + TODO: 6. Attempt to Clone the drupal7 site to an older platform with backwards versions: ensure it's not possible. + + Given I am logged in as a user with the "administrator" role + And I click "Platforms" + Then I click "Add platform" + + Given I fill in "Name" with "clonetestplatforma" + And I fill in "Makefile" with "http://cgit.drupalcode.org/provision/plain/provision-tests/makes/drupal7.make" + And I fill in "Publish path" with "clonetestplatforma" + When I press "Save" + Then I should see "Verify task has been queued for platform clonetestplatforma. It will be available once the task is completed." + And I should see "Platform clonetestplatforma has been created." + And I should see "/var/aegir/platforms/clonetestplatforma" + And I should see "clonetestplatforma" + + When I run drush "hosting-tasks -v" + Then print last drush output + Then I reload the page + When I click "Add site" + Then I should see "Create Site" + + When I fill in "Domain name" with "CloneTestSite.local.computer" + And I select the radio button "clonetestplatforma" + Then I press "Save" + And I should see "Site CloneTestSite.local.computer has been created." + And I should see "CloneTestSite.local.computer" + And I should see "Install" + And I should see "Queued" + And I should see the link "clonetestplatforma" + + When I run drush "hosting-tasks -v" + Then print last drush output + Then I reload the page + And I should see "Enabled" + + Given I click "Log in to CloneTestSite.local.computer" + Then I should see "You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password." + And I should see the link "CloneTestSite.local.computer" + + # Setup second Drupal 7 platform + Given I am on the homepage + And I click "Platforms" + Then I click "Add platform" + + Given I fill in "Name" with "clonetestplatformb" + And I fill in "Makefile" with "http://cgit.drupalcode.org/provision/plain/provision-tests/makes/drupal7.make" + And I fill in "Publish path" with "clonetestplatformb" + When I press "Save" + Then I should see "Verify task has been queued for platform clonetestplatformb. It will be available once the task is completed." + And I should see "Platform clonetestplatformb has been created." + And I should see "/var/aegir/platforms/d7" + And I should see "clonetestplatformb" + + When I run drush "hosting-tasks -v" + Then print last drush output + Then I reload the page + Then I should see "Enabled" + + Then I click "Sites" + And I click "CloneTestSite.local.computer" + + # Enable clone module and Clone the site + Given I run drush "en hosting_clone -y" + Then print last drush output + Then I reload the page + Then I click "Make a copy of the site." + Then I select the radio button with the label "clonetestplatformb" + And fill in "CloneTestClonedSite.local.computer" for "Domain name" + + Then I press "Clone" + + When I run drush "hosting-tasks -v" + Then print last drush output + Then I reload the page + And I click "clonetestplatformb" + Then I should see "Sites installed on this platform" + And I should see "CloneTestClonedSite.local.computer" + + When I click "CloneTestClonedSite.local.computer" + When I click "Generate a one-time login reset url for this site." + And I run drush "hosting-tasks -y" + Then print last drush output + Then I reload the page + + Given I click "Log in to CloneTestClonedSite.local.computer" + # The drupal 7 message! + Then I should see "You have just used your one-time login link. It is no longer necessary to use this link to log in. Please change your password." + + Given I click "Administration" + Then I click "Reports" + Then I click "Status report" + Then I click "Status report" + Then I should see "7.50" From b6c6301d36cb22c834c9bf3b17041529b292e40f Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Sat, 15 Oct 2016 11:50:47 -0400 Subject: [PATCH 2/7] Lowercase domain names --- features/clone.feature | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/features/clone.feature b/features/clone.feature index 01a0fba..10a2b30 100644 --- a/features/clone.feature +++ b/features/clone.feature @@ -31,11 +31,11 @@ Feature: Clone a website. When I click "Add site" Then I should see "Create Site" - When I fill in "Domain name" with "CloneTestSite.local.computer" + When I fill in "Domain name" with "clonetestsite.local.computer" And I select the radio button "clonetestplatforma" Then I press "Save" - And I should see "Site CloneTestSite.local.computer has been created." - And I should see "CloneTestSite.local.computer" + And I should see "Site clonetestsite.local.computer has been created." + And I should see "clonetestsite.local.computer" And I should see "Install" And I should see "Queued" And I should see the link "clonetestplatforma" @@ -45,9 +45,9 @@ Feature: Clone a website. Then I reload the page And I should see "Enabled" - Given I click "Log in to CloneTestSite.local.computer" + Given I click "Log in to clonetestsite.local.computer" Then I should see "You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password." - And I should see the link "CloneTestSite.local.computer" + And I should see the link "clonetestsite.local.computer" # Setup second Drupal 7 platform Given I am on the homepage @@ -69,7 +69,7 @@ Feature: Clone a website. Then I should see "Enabled" Then I click "Sites" - And I click "CloneTestSite.local.computer" + And I click "clonetestsite.local.computer" # Enable clone module and Clone the site Given I run drush "en hosting_clone -y" @@ -77,7 +77,7 @@ Feature: Clone a website. Then I reload the page Then I click "Make a copy of the site." Then I select the radio button with the label "clonetestplatformb" - And fill in "CloneTestClonedSite.local.computer" for "Domain name" + And fill in "clonetestclonedsite.local.computer" for "Domain name" Then I press "Clone" @@ -86,15 +86,15 @@ Feature: Clone a website. Then I reload the page And I click "clonetestplatformb" Then I should see "Sites installed on this platform" - And I should see "CloneTestClonedSite.local.computer" + And I should see "clonetestclonedsite.local.computer" - When I click "CloneTestClonedSite.local.computer" + When I click "clonetestclonedsite.local.computer" When I click "Generate a one-time login reset url for this site." And I run drush "hosting-tasks -y" Then print last drush output Then I reload the page - Given I click "Log in to CloneTestClonedSite.local.computer" + Given I click "Log in to clonetestclonedsite.local.computer" # The drupal 7 message! Then I should see "You have just used your one-time login link. It is no longer necessary to use this link to log in. Please change your password." From 399a700bfff6cb32e6bf4add8c55ad0b5b7442a7 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Sat, 15 Oct 2016 12:13:55 -0400 Subject: [PATCH 3/7] output last response --- features/clone.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/clone.feature b/features/clone.feature index 10a2b30..e0eebf6 100644 --- a/features/clone.feature +++ b/features/clone.feature @@ -34,6 +34,7 @@ Feature: Clone a website. When I fill in "Domain name" with "clonetestsite.local.computer" And I select the radio button "clonetestplatforma" Then I press "Save" + Then print last response And I should see "Site clonetestsite.local.computer has been created." And I should see "clonetestsite.local.computer" And I should see "Install" From 892769165c435063380b3566173477ef43a8f351 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Sat, 15 Oct 2016 12:16:06 -0400 Subject: [PATCH 4/7] Only test master branch. --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index f0efdc0..cc96620 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,11 @@ language: generic sudo: required +# Only run test when committing to a master branch. +branches: + only: + - master + env: globaL: - COMPOSE_HTTP_TIMEOUT=3600 From 8b04d97babee3dfa19f150a7cb9820df8bf58edd Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Sat, 15 Oct 2016 12:21:55 -0400 Subject: [PATCH 5/7] changing domain name of test site --- features/clone.feature | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/features/clone.feature b/features/clone.feature index e0eebf6..3a26605 100644 --- a/features/clone.feature +++ b/features/clone.feature @@ -31,12 +31,12 @@ Feature: Clone a website. When I click "Add site" Then I should see "Create Site" - When I fill in "Domain name" with "clonetestsite.local.computer" + When I fill in "Domain name" with "clonetestsiteA.local.computer" And I select the radio button "clonetestplatforma" Then I press "Save" Then print last response - And I should see "Site clonetestsite.local.computer has been created." - And I should see "clonetestsite.local.computer" + And I should see "Site clonetestsiteA.local.computer has been created." + And I should see "clonetestsiteA.local.computer" And I should see "Install" And I should see "Queued" And I should see the link "clonetestplatforma" @@ -46,9 +46,9 @@ Feature: Clone a website. Then I reload the page And I should see "Enabled" - Given I click "Log in to clonetestsite.local.computer" + Given I click "Log in to clonetestsiteA.local.computer" Then I should see "You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password." - And I should see the link "clonetestsite.local.computer" + And I should see the link "clonetestsiteA.local.computer" # Setup second Drupal 7 platform Given I am on the homepage @@ -70,7 +70,7 @@ Feature: Clone a website. Then I should see "Enabled" Then I click "Sites" - And I click "clonetestsite.local.computer" + And I click "clonetestsiteA.local.computer" # Enable clone module and Clone the site Given I run drush "en hosting_clone -y" From a1efd03c7b92b78065ed6a2629b0d8cfa92077fd Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Sat, 15 Oct 2016 12:30:24 -0400 Subject: [PATCH 6/7] changing domain name again. --- features/clone.feature | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/features/clone.feature b/features/clone.feature index 3a26605..ff18a48 100644 --- a/features/clone.feature +++ b/features/clone.feature @@ -31,12 +31,12 @@ Feature: Clone a website. When I click "Add site" Then I should see "Create Site" - When I fill in "Domain name" with "clonetestsiteA.local.computer" + When I fill in "Domain name" with "clonetestsite.aegir.local.computer" And I select the radio button "clonetestplatforma" Then I press "Save" Then print last response - And I should see "Site clonetestsiteA.local.computer has been created." - And I should see "clonetestsiteA.local.computer" + And I should see "Site clonetestsite.aegir.local.computer has been created." + And I should see "clonetestsite.aegir.local.computer" And I should see "Install" And I should see "Queued" And I should see the link "clonetestplatforma" @@ -46,9 +46,9 @@ Feature: Clone a website. Then I reload the page And I should see "Enabled" - Given I click "Log in to clonetestsiteA.local.computer" + Given I click "Log in to clonetestsite.aegir.local.computer" Then I should see "You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password." - And I should see the link "clonetestsiteA.local.computer" + And I should see the link "clonetestsite.aegir.local.computer" # Setup second Drupal 7 platform Given I am on the homepage @@ -70,7 +70,7 @@ Feature: Clone a website. Then I should see "Enabled" Then I click "Sites" - And I click "clonetestsiteA.local.computer" + And I click "clonetestsite.aegir.local.computer" # Enable clone module and Clone the site Given I run drush "en hosting_clone -y" From fae0d6a752fb7156f0c663baf3a4b004b1c0cdfa Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Sat, 15 Oct 2016 12:37:53 -0400 Subject: [PATCH 7/7] Add a failure check against the error message. --- features/clone.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/clone.feature b/features/clone.feature index ff18a48..5e97543 100644 --- a/features/clone.feature +++ b/features/clone.feature @@ -34,7 +34,7 @@ Feature: Clone a website. When I fill in "Domain name" with "clonetestsite.aegir.local.computer" And I select the radio button "clonetestplatforma" Then I press "Save" - Then print last response + Then I should not see "The domain name you have specified is already in use." And I should see "Site clonetestsite.aegir.local.computer has been created." And I should see "clonetestsite.aegir.local.computer" And I should see "Install"