jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/399131 )
Change subject: Remove Ruby browser tests
......................................................................
Remove Ruby browser tests
The continuous integration infrastructure for these is being removed
(or never existed), and our team decided not to invest the time to
convert them to node.js.
Bug: T171848
Change-Id: I0faeecb2635f24c40c83aa689b670e69aa381431
---
M .gitignore
M .rubocop_todo.yml
M Gemfile
M Gemfile.lock
M Rakefile
D tests/browser/README.md
D tests/browser/ci.yml
D tests/browser/environments.yml
D tests/browser/features/no_javascript.feature
D tests/browser/features/notifications.feature
D tests/browser/features/step_definition/badge_steps.rb
D tests/browser/features/step_definition/no_javascript.rb
D tests/browser/features/step_definition/notifications_steps.rb
D tests/browser/features/step_definition/popup_steps.rb
D tests/browser/features/support/components/notifications.rb
D tests/browser/features/support/data_manager.rb
D tests/browser/features/support/echo_api_helper.rb
D tests/browser/features/support/echo_pageobject_extension.rb
D tests/browser/features/support/env.rb
D tests/browser/features/support/hooks.rb
D tests/browser/features/support/pages/article_page.rb
D tests/browser/features/support/pages/special_notifications_page.rb
22 files changed, 14 insertions(+), 391 deletions(-)
Approvals:
Zfilipin: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.gitignore b/.gitignore
index cb2aeb6..e8e8e3a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,6 @@
.idea/
node_modules/
scripts/remotes/
-tests/browser/screenshots
/vendor
/docs
composer.lock
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 5680096..35c04d9 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2017-12-04 16:37:27 +0100 using RuboCop version 0.51.0.
+# on 2017-12-19 17:22:54 +0100 using RuboCop version 0.51.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -20,13 +20,6 @@
Naming/HeredocDelimiterNaming:
Exclude:
- 'jsduck_custom_tags.rb'
-
-# Offense count: 2
-# Configuration parameters: EnforcedStyle, SupportedStyles.
-# SupportedStyles: snake_case, camelCase
-Naming/VariableName:
- Exclude:
- - 'tests/browser/features/support/echo_api_helper.rb'
# Offense count: 1
# Configuration parameters: MinBodyLength.
diff --git a/Gemfile b/Gemfile
index a886a2d..97d8250 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
gem 'csscss', '~> 1.3.3'
-gem 'mediawiki_selenium', '~> 1.8'
+gem 'mediawiki_api', '~> 0.7.1'
gem 'rake', '~> 11.1', '>= 11.1.1'
-gem 'rspec-mocks', '~> 2.99', '>= 2.99.4'
+gem 'rspec', '~> 2.99'
gem 'rubocop', '~> 0.51.0', require: false
diff --git a/Gemfile.lock b/Gemfile.lock
index 64a70a7..9e19cd2 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -3,71 +3,27 @@
specs:
ast (2.3.0)
blankslate (3.1.3)
- builder (3.2.3)
- childprocess (0.6.2)
- ffi (~> 1.0, >= 1.0.11)
colorize (0.7.7)
csscss (1.3.3)
colorize
parslet (>= 1.6.1, < 2.0)
- cucumber (1.3.20)
- builder (>= 2.1.2)
- diff-lcs (>= 1.1.3)
- gherkin (~> 2.12)
- multi_json (>= 1.7.5, < 2.0)
- multi_test (>= 0.1.2)
- data_magic (1.0)
- faker (>= 1.1.2)
- yml_reader (>= 0.6)
diff-lcs (1.3)
- domain_name (0.5.20170223)
+ domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
- faker (1.7.3)
- i18n (~> 0.5)
- faraday (0.11.0)
+ faraday (0.13.1)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
- faraday_middleware (0.11.0.1)
+ faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
- ffi (1.9.17)
- gherkin (2.12.2)
- multi_json (~> 1.3)
- headless (2.3.1)
http-cookie (1.0.3)
domain_name (~> 0.5)
- i18n (0.8.1)
- json (2.0.3)
mediawiki_api (0.7.1)
faraday (~> 0.9, >= 0.9.0)
faraday-cookie_jar (~> 0.0, >= 0.0.6)
faraday_middleware (~> 0.10, >= 0.10.0)
- mediawiki_selenium (1.8.0)
- cucumber (~> 1.3, >= 1.3.20)
- headless (~> 2.0, >= 2.1.0)
- json (~> 2.0, >= 2.0.2)
- mediawiki_api (~> 0.7, >= 0.7.0)
- page-object (~> 2.0)
- rest-client (~> 1.6, >= 1.6.7)
- rspec-core (~> 2.14, >= 2.14.4)
- rspec-expectations (~> 2.14, >= 2.14.4)
- selenium-webdriver (~> 3.1.0)
- syntax (~> 1.2, >= 1.2.0)
- thor (~> 0.19, >= 0.19.1)
- mime-types (2.99.3)
- multi_json (1.12.1)
- multi_test (0.1.2)
multipart-post (2.0.0)
- net-http-persistent (2.9.4)
- netrc (0.11.0)
- page-object (2.0.0)
- net-http-persistent (~> 2.9.4)
- page_navigation (>= 0.9)
- selenium-webdriver (~> 3.0)
- watir (~> 6.0)
- page_navigation (0.10)
- data_magic (>= 0.22)
parallel (1.12.0)
parser (2.4.0.2)
ast (~> 2.3)
@@ -77,10 +33,10 @@
rainbow (2.2.2)
rake
rake (11.1.1)
- rest-client (1.8.0)
- http-cookie (>= 1.0.2, < 2.0)
- mime-types (>= 1.16, < 3.0)
- netrc (~> 0.7)
+ rspec (2.99.0)
+ rspec-core (~> 2.99.0)
+ rspec-expectations (~> 2.99.0)
+ rspec-mocks (~> 2.99.0)
rspec-core (2.99.2)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
@@ -93,30 +49,19 @@
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.9.0)
- rubyzip (1.2.1)
- selenium-webdriver (3.1.0)
- childprocess (~> 0.5)
- rubyzip (~> 1.0)
- websocket (~> 1.0)
- syntax (1.2.1)
- thor (0.19.4)
unf (0.1.4)
unf_ext
- unf_ext (0.0.7.2)
+ unf_ext (0.0.7.4)
unicode-display_width (1.3.0)
- watir (6.2.0)
- selenium-webdriver (~> 3.0)
- websocket (1.2.4)
- yml_reader (0.7)
PLATFORMS
ruby
DEPENDENCIES
csscss (~> 1.3.3)
- mediawiki_selenium (~> 1.8)
+ mediawiki_api (~> 0.7.1)
rake (~> 11.1, >= 11.1.1)
- rspec-mocks (~> 2.99, >= 2.99.4)
+ rspec (~> 2.99)
rubocop (~> 0.51.0)
BUNDLED WITH
diff --git a/Rakefile b/Rakefile
index 7683500..5ac9aba 100644
--- a/Rakefile
+++ b/Rakefile
@@ -8,9 +8,6 @@
task.options = ['-c', '.rubocop.yml']
end
-require 'mediawiki_selenium/rake_task'
-MediawikiSelenium::RakeTask.new
-
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |t|
t.rspec_opts = 'tests/rspec/'
@@ -19,4 +16,4 @@
task default: [:test]
desc 'Run all build/tests commands (CI entry point)'
-task test: [:rubocop, :spec, :selenium]
+task test: [:rubocop, :spec]
diff --git a/tests/browser/README.md b/tests/browser/README.md
deleted file mode 100644
index 3631949..0000000
--- a/tests/browser/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Please see https://github.com/wikimedia/mediawiki-selenium for instructions on
how to run tests.
diff --git a/tests/browser/ci.yml b/tests/browser/ci.yml
deleted file mode 100644
index c2eca93..0000000
--- a/tests/browser/ci.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-BROWSER:
- - chrome
- - firefox
-
-MEDIAWIKI_ENVIRONMENT:
- - beta
-
-PLATFORM:
- - Linux
diff --git a/tests/browser/environments.yml b/tests/browser/environments.yml
deleted file mode 100644
index c32e21b..0000000
--- a/tests/browser/environments.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-# Customize this configuration as necessary to provide defaults for various
-# test environments.
-#
-# The set of defaults to use is determined by the MEDIAWIKI_ENVIRONMENT
-# environment variable.
-#
-# export MEDIAWIKI_ENVIRONMENT=mw-vagrant-host
-# bundle exec cucumber
-#
-# Additional variables set by the environment will override the corresponding
-# defaults defined here.
-#
-# export MEDIAWIKI_ENVIRONMENT=mw-vagrant-host
-# export MEDIAWIKI_USER=Selenium_user2
-# bundle exec cucumber
-#
-mw-vagrant-host: &default
- user_factory: true
- mediawiki_url: http://127.0.0.1:8080/wiki/
-
-mw-vagrant-guest:
- user_factory: true
- mediawiki_url: http://127.0.0.1/wiki/
-
-local:
- mediawiki_user: Admin
- mediawiki_password: vagrant
- mediawiki_user_b: Selenium Echo user 2
- mediawiki_url: http://dev.wiki.local.wmftest.net:8080/wiki/
-
-beta:
- mediawiki_url: https://en.wikipedia.beta.wmflabs.org/wiki/
- mediawiki_user: Selenium_user
- mediawiki_user_b: Selenium Echo user 2
- # mediawiki_password: SET THIS IN THE ENVIRONMENT!
-
-test2:
- mediawiki_url: https://test2.wikipedia.org/wiki/
- mediawiki_user: Selenium_user
- mediawiki_user_b: Selenium Echo user 2
- # mediawiki_password: SET THIS IN THE ENVIRONMENT!
-
-integration:
- browser: chrome
- user_factory: true
- # mediawiki_url: THIS WILL BE SET BY JENKINS
-
-default: *default
diff --git a/tests/browser/features/no_javascript.feature
b/tests/browser/features/no_javascript.feature
deleted file mode 100644
index a8b318e..0000000
--- a/tests/browser/features/no_javascript.feature
+++ /dev/null
@@ -1,11 +0,0 @@
-@chrome @en.wikipedia.beta.wmflabs.org @firefox @localhost @vagrant
-Feature: Basic features for no-js functionality
-
- Background:
- Given I am using a nojs browser
-
- Scenario: Clicking alerts badge goes to Special:Notifications
- Given I am logged in
- When I click the alert badge
- And I wait for the page to load
- Then I am on Special Notifications page
diff --git a/tests/browser/features/notifications.feature
b/tests/browser/features/notifications.feature
deleted file mode 100644
index 3d443a7..0000000
--- a/tests/browser/features/notifications.feature
+++ /dev/null
@@ -1,22 +0,0 @@
-@chrome @en.wikipedia.beta.wmflabs.org @firefox @localhost @vagrant
-Feature: Testing notification types
-
- Background:
- Given I am logged in
- And all my notifications are read
-
- Scenario: Someone mentions me
- Given another user mentions me
- When I refresh the page
- Then the alert badge is showing unseen notifications
- And the alert badge value is "Alert (1)"
-
- @skip
- Scenario: Someone writes on my talk page
- Given another user writes on my talk page
- When I refresh the page
- Then the alert badge is showing unseen notifications
- And the alert badge value is "Alert (1)"
- When I click the alert badge
- And I see the alert popup
- Then there are "1" unread notifications in the alert popup
diff --git a/tests/browser/features/step_definition/badge_steps.rb
b/tests/browser/features/step_definition/badge_steps.rb
deleted file mode 100644
index 82590cb..0000000
--- a/tests/browser/features/step_definition/badge_steps.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# Steps related to clicking and interacting with the badge
-# Work in both nojs and js version
-
-Given(/^I click the alert badge$/) do
- on(ArticlePage).alerts_element.when_present.click
-end
-
-Given(/^I click the notice badge$/) do
- on(ArticlePage).notices_element.when_present.click
-end
diff --git a/tests/browser/features/step_definition/no_javascript.rb
b/tests/browser/features/step_definition/no_javascript.rb
deleted file mode 100644
index 5cf97b1..0000000
--- a/tests/browser/features/step_definition/no_javascript.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# This test has no javascript
-# Therefore this test has no AJAX
-# Therefore it should run without any "when_present" clauses
-# If you need a "when_present" to make the test run, that is a bug
-
-Given(/^I am using a nojs browser$/) do
- # The following user-agent string contains:
- # SymbianOS: for RL to NOT load the modern experience
- # SMART-TV-SamsungBrowser: to bypass mobile-frontend and stay on the
desktop site
- browser_factory.override(browser_user_agent:
'SymbianOS,SMART-TV-SamsungBrowser')
-end
-
-Given(/^I wait for the page to load$/) do
- # Wait for the page to load. We're technically clicking the <li> rather than
<a>,
- # so the special-case implicit wait after clicking links doesn't kick in.
- browser.wait
-end
-
-Given(/^I am on Special Notifications page$/) do
- expect(on(SpecialNotificationsPage).firstHeading).to match('Notifications')
-end
diff --git a/tests/browser/features/step_definition/notifications_steps.rb
b/tests/browser/features/step_definition/notifications_steps.rb
deleted file mode 100644
index 5557c5d..0000000
--- a/tests/browser/features/step_definition/notifications_steps.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-Given(/^all my notifications are read$/) do
- clear_unread_notifications(@username)
-end
-
-Given(/^I refresh the page$/) do
- on(ArticlePage) do |page|
- page.refresh
- end
-end
-
-Given(/^another user mentions me$/) do
- message = '===Mention test===\nI am mentioning [[User:' + user(nil) +
- ']] in this page to test Echo notifications. ~~~~'
- as_user(:b) do
- api.create_page(
- @data_manager.get('Echo_test_page'),
- message
- )
- end
-end
-
-Given(/^another user writes on my talk page$/) do
- talk_page = "User_talk:#{user}"
- message = '===Talk page test===\n' +
- 'I am writing a message in your user page to test Echo notifications. ~~~~'
- as_user(:b) do
- api.create_page(talk_page, message)
- end
-end
-
-Given(/^the alert badge is showing unseen notifications$/) do
- on(ArticlePage) do |page|
- page.refresh_until do
- page.alerts.badge_unseen_element.exists?
- end
- end
-end
-
-Given(/^the notice badge is showing unseen notifications$/) do
- on(ArticlePage) do |page|
- page.refresh_until do
- page.notices.badge_unseen_element.exists?
- end
- end
-end
-
-Given(/^the alert badge value is "(.+)"$/) do |num|
- on(ArticlePage) do |page|
- page.refresh_until do
- # `.text` doesn't work for invisible elements, and Selenium thinks the
badge is invisible
- page.alerts.badge_element.attribute('innerText') == num
- end
- end
-end
-
-Given(/^the notice badge value is "(.+)"$/) do |num|
- on(ArticlePage) do |page|
- page.refresh_until do
- page.notices.badge_element.attribute('innerText') == num
- end
- end
-end
-
-Given(/^there are "(.+)" unread notifications in the notice popup$/) do |num|
- on(ArticlePage) do |page|
- page.notices.when_loaded
- expect(page.notices.num_unread_notifications).to eq(num.to_i)
- end
-end
-
-Given(/^there are "(.+)" unread notifications in the alert popup$/) do |num|
- on(ArticlePage) do |page|
- page.alerts.when_loaded
- expect(page.alerts.num_unread_notifications).to eq(num.to_i)
- end
-end
diff --git a/tests/browser/features/step_definition/popup_steps.rb
b/tests/browser/features/step_definition/popup_steps.rb
deleted file mode 100644
index e6c8f0f..0000000
--- a/tests/browser/features/step_definition/popup_steps.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-Given(/^I see the alert popup$/) do
- on(ArticlePage) do |page|
- expect(page.alerts.title_element.when_present.text).to match('Alerts')
- end
-end
-
-Given(/^I see the message popup$/) do
- on(ArticlePage) do |page|
- expect(page.messages.title_element.when_present.text).to match('Messages')
- end
-end
diff --git a/tests/browser/features/support/components/notifications.rb
b/tests/browser/features/support/components/notifications.rb
deleted file mode 100644
index 6f8d5ab..0000000
--- a/tests/browser/features/support/components/notifications.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-class Notifications
- include PageObject
-
- link(:badge, css: '.mw-echo-notifications-badge')
- link(:badge_unseen, css: '.mw-echo-unseen-notifications')
- link(:mark_all_as_read, css:
'.mw-echo-ui-notificationsListWidget-markAllReadButton > a')
- div(:popup, css: '.mw-echo-ui-notificationBadgeButtonPopupWidget-popup')
- span(:title, css: '.oo-ui-popupWidget-head > .oo-ui-labelElement-label')
- div(
- :notifications_container,
- css: '.mw-echo-ui-notificationsListWidget >
.mw-echo-ui-notificationItemWidget')
-
- def when_loaded
- title_element.when_present
- notifications_container_element.when_present
- end
-
- def num_unread_notifications
- div_elements(css: '.mw-echo-ui-notificationItemWidget-unread').size
- end
-end
diff --git a/tests/browser/features/support/data_manager.rb
b/tests/browser/features/support/data_manager.rb
deleted file mode 100644
index 0ff6d66..0000000
--- a/tests/browser/features/support/data_manager.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# Data manager for Echo tests
-class DataManager
- def initialize
- @data = {}
- end
-
- def get(part)
- @data[part] = "#{part}_#{Random.srand}" unless @data.key? part
- @data[part]
- end
-end
diff --git a/tests/browser/features/support/echo_api_helper.rb
b/tests/browser/features/support/echo_api_helper.rb
deleted file mode 100644
index 77b7e5a..0000000
--- a/tests/browser/features/support/echo_api_helper.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-module EchoAPIHelper
- def create_page_with_user(title, text, username)
- as_user(username) do
- api.create_page title, text
- end
- end
-
- def clear_unread_notifications(username)
- as_user(username) do
- api.action('echomarkread', token_type: 'csrf', all: '1')
- end
- end
-
- def update_seentime(username, notificationType)
- as_user(username) do
- api.action('echomarkseen', token_type: 'csrf', type: notificationType)
- end
- end
-
- def watch_page(username, pageTitle)
- as_user(username) do
- api.action('watch', token_type: 'watch', title: pageTitle)
- end
- end
-end
diff --git a/tests/browser/features/support/echo_pageobject_extension.rb
b/tests/browser/features/support/echo_pageobject_extension.rb
deleted file mode 100644
index 8e18a6e..0000000
--- a/tests/browser/features/support/echo_pageobject_extension.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-module PageObject
- def refresh_until(timeout = PageObject.default_page_wait, message = nil)
- platform.wait_until(timeout, message) do
- yield.tap do |result|
- refresh unless result
- end
- end
- end
-end
diff --git a/tests/browser/features/support/env.rb
b/tests/browser/features/support/env.rb
deleted file mode 100644
index d7dbf3e..0000000
--- a/tests/browser/features/support/env.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require 'mediawiki_selenium/cucumber'
-require 'mediawiki_selenium/pages'
-require 'mediawiki_selenium/step_definitions'
-
-def env_or_default(key, default)
- ENV[key].nil? ? default : ENV[key].to_i
-end
-
-PageObject.default_page_wait = env_or_default 'PAGE_WAIT_TIMEOUT', 60
-PageObject.default_element_wait = env_or_default 'ELEMENT_WAIT_TIMEOUT', 60
diff --git a/tests/browser/features/support/hooks.rb
b/tests/browser/features/support/hooks.rb
deleted file mode 100644
index 0d84341..0000000
--- a/tests/browser/features/support/hooks.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# Allow running of bundle exec cucumber --dry-run -f stepdefs
-require 'mediawiki_selenium'
-require 'page-object'
-require_relative 'echo_api_helper'
-require_relative 'echo_pageobject_extension'
-require_relative 'data_manager'
-
-World(EchoAPIHelper)
-
-Before { @data_manager = DataManager.new }
diff --git a/tests/browser/features/support/pages/article_page.rb
b/tests/browser/features/support/pages/article_page.rb
deleted file mode 100644
index 25ffa04..0000000
--- a/tests/browser/features/support/pages/article_page.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-class ArticlePage
- include PageObject
-
- li(:alerts, css: '#pt-notifications-alert')
- li(:notices, css: '#pt-notifications-notice')
- page_section(:alerts, Notifications, css: '#pt-notifications-alert')
- page_section(:notices, Notifications, css: '#pt-notifications-notice')
-end
diff --git a/tests/browser/features/support/pages/special_notifications_page.rb
b/tests/browser/features/support/pages/special_notifications_page.rb
deleted file mode 100644
index 3f6f0c2..0000000
--- a/tests/browser/features/support/pages/special_notifications_page.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# Special:Notifications page
-class SpecialNotificationsPage
- include PageObject
-
- page_url 'Special:Notifications'
-
- h1(:firstHeading, css: '.firstHeading')
-end
--
To view, visit https://gerrit.wikimedia.org/r/399131
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0faeecb2635f24c40c83aa689b670e69aa381431
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Etonkovidova <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: Sbisson <[email protected]>
Gerrit-Reviewer: Zfilipin <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits