Mattflaschen has uploaded a new change for review. ( 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 --- 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 17 files changed, 0 insertions(+), 311 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/31/399131/1 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: newchange Gerrit-Change-Id: I0faeecb2635f24c40c83aa689b670e69aa381431 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Mattflaschen <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
