jenkins-bot has submitted this change and it was merged.

Change subject: Run Gather browser tests on various commits
......................................................................


Run Gather browser tests on various commits

Other changes:
* A few tweaks to existing tests (order of steps and names of testings)
* Upgrade to Selenium 1.5 (needed to provide screenshots/screencasts)

Bug: T107908
Change-Id: If0f122feddb1268d8f02ba44f6b62e664a3d516d
---
M Gemfile
M Gemfile.lock
M tests/browser/environments.yml
M tests/browser/features/add_to_collection.feature
M tests/browser/features/anonymous.feature
M tests/browser/features/edit_collection.feature
M tests/browser/features/menu.feature
M tests/browser/features/new_collection.feature
M tests/browser/features/recent_collections.feature
M tests/browser/features/step_definitions/common_steps.rb
10 files changed, 35 insertions(+), 21 deletions(-)

Approvals:
  Bmansurov: Looks good to me, but someone else must approve
  Phuedx: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Gemfile b/Gemfile
index 608173e..207bd57 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,4 +3,4 @@
 
 source 'https://rubygems.org'
 
-gem 'mediawiki_selenium', '~> 1.3.0'
+gem 'mediawiki_selenium', '~> 1.5.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 1eb1505..3d25184 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -23,10 +23,10 @@
     faraday-cookie_jar (0.0.6)
       faraday (>= 0.7.4)
       http-cookie (~> 1.0.0)
-    ffi (1.9.8)
+    ffi (1.9.10)
     gherkin (2.12.2)
       multi_json (~> 1.3)
-    headless (1.0.2)
+    headless (2.1.0)
     http-cookie (1.0.2)
       domain_name (~> 0.5)
     i18n (0.7.0)
@@ -34,18 +34,18 @@
     mediawiki_api (0.4.1)
       faraday (~> 0.9, >= 0.9.0)
       faraday-cookie_jar (~> 0.0, >= 0.0.6)
-    mediawiki_selenium (1.3.0)
-      cucumber (~> 1.3, >= 1.3.10)
-      headless (~> 1.0, >= 1.0.1)
+    mediawiki_selenium (1.5.0)
+      cucumber (~> 1.3, >= 1.3.20)
+      headless (~> 2.0, >= 2.1.0)
       json (~> 1.8, >= 1.8.1)
-      mediawiki_api (~> 0.2, >= 0.2.1)
+      mediawiki_api (~> 0.4, >= 0.4.1)
       page-object (~> 1.0)
       rest-client (~> 1.6, >= 1.6.7)
       rspec-expectations (~> 2.14, >= 2.14.4)
       syntax (~> 1.2, >= 1.2.0)
       thor (~> 0.19, >= 0.19.1)
     mime-types (2.6.1)
-    multi_json (1.11.1)
+    multi_json (1.11.2)
     multi_test (0.1.2)
     multipart-post (2.0.0)
     netrc (0.10.3)
@@ -72,8 +72,8 @@
     unf (0.1.4)
       unf_ext
     unf_ext (0.0.7.1)
-    watir-webdriver (0.7.0)
-      selenium-webdriver (>= 2.45)
+    watir-webdriver (0.8.0)
+      selenium-webdriver (>= 2.46.2)
     websocket (1.2.2)
     yml_reader (0.5)
 
@@ -81,4 +81,4 @@
   ruby
 
 DEPENDENCIES
-  mediawiki_selenium (~> 1.3.0)
+  mediawiki_selenium (~> 1.5.0)
diff --git a/tests/browser/environments.yml b/tests/browser/environments.yml
index 8f5e4b3..a06c269 100644
--- a/tests/browser/environments.yml
+++ b/tests/browser/environments.yml
@@ -34,4 +34,9 @@
   mediawiki_user: Selenium_user
   # mediawiki_password: SET THIS IN THE ENVIRONMENT!
 
+integration:
+  browser: chrome
+  user_factory: true
+  # mediawiki_url: JENKINS WILL SET THIS
+
 default: *default
diff --git a/tests/browser/features/add_to_collection.feature 
b/tests/browser/features/add_to_collection.feature
index a5fa133..62c76e5 100644
--- a/tests/browser/features/add_to_collection.feature
+++ b/tests/browser/features/add_to_collection.feature
@@ -2,9 +2,9 @@
 Feature: Add to a collection
 
   Background:
-    Given I am logged into the mobile website
-      And I am using the mobile site
+    Given I am using the mobile site
       And I have Gather
+      And I am logged into the mobile website
 
   Scenario: Check the default watchstar has been replaced
     Given I am on the "Selenium Gather test" page
diff --git a/tests/browser/features/anonymous.feature 
b/tests/browser/features/anonymous.feature
index 2d3433d..d830793 100644
--- a/tests/browser/features/anonymous.feature
+++ b/tests/browser/features/anonymous.feature
@@ -6,15 +6,18 @@
       And I am using the mobile site
       And there are public collections
 
+  @integration
   Scenario: Gather shows public view
     When I visit the Gather page
     Then I see the recent collections page
 
+  @integration
   Scenario: Clicking tab shows login page
     When I visit the Gather page
         And I click the my collections tab
     Then I see the login page
 
+  @integration
   Scenario: Anons not allowed to view private collections
     When I visit a private collection page
     Then I see the error page
@@ -25,6 +28,7 @@
     When I click the watchstar
     Then I see the anonymous CTA
 
+  @integration
   Scenario: Anons can see my public collection
     When I visit a public collection
     Then I can see items in the collection
diff --git a/tests/browser/features/edit_collection.feature 
b/tests/browser/features/edit_collection.feature
index 8719896..6abac65 100644
--- a/tests/browser/features/edit_collection.feature
+++ b/tests/browser/features/edit_collection.feature
@@ -3,13 +3,14 @@
 
   Background:
     Given I am using the mobile site
-      And I am logged into the mobile website
       And I have Gather
+      And I am logged into the mobile website
       And I view one of my public collections
 
   Scenario: Edit button shown
     Then I see edit collection button
 
+  @integration
   Scenario: Clicking edit button
     When I click the edit collection button
     Then I see the collection editor overlay
diff --git a/tests/browser/features/menu.feature 
b/tests/browser/features/menu.feature
index 2c9e28d..30a62d1 100644
--- a/tests/browser/features/menu.feature
+++ b/tests/browser/features/menu.feature
@@ -10,7 +10,7 @@
   When I click on the main navigation button
   Then I should see a link to "Collections" in the main navigation menu
 
-Scenario: Check links in menu
+Scenario: Check links in special page menu
   And I have Gather
   And I am on the "Special:MobileOptions" page
   When I click on the main navigation button
diff --git a/tests/browser/features/new_collection.feature 
b/tests/browser/features/new_collection.feature
index bdd99ef..8e38286 100644
--- a/tests/browser/features/new_collection.feature
+++ b/tests/browser/features/new_collection.feature
@@ -2,9 +2,9 @@
 Feature: Creating new collections
 
   Background:
-    Given I am logged into the mobile website
-      And I am using the mobile site
+    Given I am using the mobile site
       And I have Gather
+      And I am logged into the mobile website
       And I am on the "Selenium Gather test" page
      When I click the watchstar
 
diff --git a/tests/browser/features/recent_collections.feature 
b/tests/browser/features/recent_collections.feature
index 9722c31..f3678bd 100644
--- a/tests/browser/features/recent_collections.feature
+++ b/tests/browser/features/recent_collections.feature
@@ -5,7 +5,7 @@
     Given I am using the mobile site
       And there are more than 100 collections
 
-  @smoke
+  @smoke @integration
   Scenario: Infinite scrolling is working for anonymous users
     Given I am on the "Special:Gather/all/recent" page
       And I see 100 collections
diff --git a/tests/browser/features/step_definitions/common_steps.rb 
b/tests/browser/features/step_definitions/common_steps.rb
index 65846bb..3241d4f 100644
--- a/tests/browser/features/step_definitions/common_steps.rb
+++ b/tests/browser/features/step_definitions/common_steps.rb
@@ -1,9 +1,10 @@
 Given(/^I am using the mobile site$/) do
   visit(MainPage)
   on(MainPage) do |page|
-    page.goto
+    page_uri = URI.parse(page.page_url_value)
     # A domain is explicitly given to avoid a bug in earlier versions of Chrome
-    page.browser.cookies.add 'mf_useformat', 'true', domain: 
URI.parse(page.page_url_value).host
+    domain = page_uri.host == 'localhost' ? nil : page_uri.host
+    browser.cookies.add 'mf_useformat', 'true', domain: domain
     page.refresh
   end
 end
@@ -31,7 +32,10 @@
     
page.browser.execute_script("localStorage.setItem('gather-has-dismissed-mainmenu','true');")
 
     # A domain is explicitly given to avoid a bug in earlier versions of Chrome
-    page.browser.cookies.add 'optin', 'beta', domain: 
URI.parse(page.page_url_value).host
+    page_uri = URI.parse(page.page_url_value)
+    # A domain is explicitly given to avoid a bug in earlier versions of Chrome
+    domain = page_uri.host == 'localhost' ? nil : page_uri.host
+    page.browser.cookies.add 'optin', 'beta', domain: domain
     page.refresh
   end
 end

-- 
To view, visit https://gerrit.wikimedia.org/r/230953
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If0f122feddb1268d8f02ba44f6b62e664a3d516d
Gerrit-PatchSet: 12
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Dduvall <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to