Zfilipin has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/381467 )
Change subject: Deleted all Ruby code ...................................................................... Deleted all Ruby code The only Ruby code were broken Selenium tests. Bug: T164479 Change-Id: I7506dfb6250237f45dcea5c4dc64a864fa321732 --- D .rubocop.yml D .rubocop_todo.yml D Gemfile D Gemfile.lock D Rakefile D tests/browser/README.md D tests/browser/environments.yml D tests/browser/features/manage_translator_sandbox.feature D tests/browser/features/special_translate.feature D tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb D tests/browser/features/step_definitions/special_translate_steps.rb D tests/browser/features/step_definitions/translation_stash_steps.rb D tests/browser/features/support/env.rb D tests/browser/features/support/hooks.rb D tests/browser/features/support/pages/manage_translator_sandbox_page.rb D tests/browser/features/support/pages/stash_page.rb D tests/browser/features/support/pages/translate_page.rb D tests/browser/features/support/pages/user_page.rb D tests/browser/features/translation_stash.feature 19 files changed, 0 insertions(+), 1,062 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/67/381467/1 diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index 9f1c7c0..0000000 --- a/.rubocop.yml +++ /dev/null @@ -1,28 +0,0 @@ -inherit_from: .rubocop_todo.yml - -AllCops: - Exclude: - - 'extensions/**/*' - - 'vendor/**/*' - -AllCops: - StyleGuideCopsOnly: true - -# Uncomment when lines are under 100 lenghth -# Metrics/LineLength: -# Max: 100 - -Metrics/MethodLength: - Enabled: false - -Style/Alias: - Enabled: false - -Style/SignalException: - Enabled: false - -Style/StringLiterals: - EnforcedStyle: single_quotes - -Style/TrivialAccessors: - ExactNameMatch: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index 821f13b..0000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,12 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2015-11-09 14:28:59 +0100 using RuboCop version 0.34.2. -# 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 -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 48 -# Configuration parameters: AllowURI, URISchemes. -Metrics/LineLength: - Max: 127 diff --git a/Gemfile b/Gemfile deleted file mode 100644 index ae4f910..0000000 --- a/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source 'https://rubygems.org' - -gem 'mediawiki_selenium', '~> 1.7', '>= 1.7.1' -gem 'rubocop', '~> 0.34.2', require: false diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 28af83f..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,100 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - ast (2.1.0) - astrolabe (1.3.1) - parser (~> 2.2) - builder (3.2.2) - childprocess (0.5.9) - ffi (~> 1.0, >= 1.0.11) - 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 (0.22) - faker (>= 1.1.2) - yml_reader (>= 0.6) - diff-lcs (1.2.5) - domain_name (0.5.20160310) - unf (>= 0.0.5, < 1.0.0) - faker (1.6.3) - i18n (~> 0.5) - faraday (0.9.2) - multipart-post (>= 1.2, < 3) - faraday-cookie_jar (0.0.6) - faraday (>= 0.7.4) - http-cookie (~> 1.0.0) - ffi (1.9.10) - gherkin (2.12.2) - multi_json (~> 1.3) - headless (2.2.3) - http-cookie (1.0.2) - domain_name (~> 0.5) - i18n (0.7.0) - json (1.8.3) - mediawiki_api (0.6.0) - faraday (~> 0.9, >= 0.9.0) - faraday-cookie_jar (~> 0.0, >= 0.0.6) - mediawiki_selenium (1.7.1) - cucumber (~> 1.3, >= 1.3.20) - headless (~> 2.0, >= 2.1.0) - json (~> 1.8, >= 1.8.1) - mediawiki_api (~> 0.6, >= 0.6.0) - page-object (~> 1.0) - rest-client (~> 1.6, >= 1.6.7) - rspec-core (~> 2.14, >= 2.14.4) - rspec-expectations (~> 2.14, >= 2.14.4) - syntax (~> 1.2, >= 1.2.0) - thor (~> 0.19, >= 0.19.1) - mime-types (2.99.2) - multi_json (1.12.1) - multi_test (0.1.2) - multipart-post (2.0.0) - netrc (0.11.0) - page-object (1.1.1) - page_navigation (>= 0.9) - selenium-webdriver (>= 2.44.0) - watir-webdriver (>= 0.6.11) - page_navigation (0.9) - data_magic (>= 0.14) - parser (2.2.3.0) - ast (>= 1.1, < 3.0) - powerpack (0.1.1) - rainbow (2.0.0) - rest-client (1.8.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - rspec-core (2.99.2) - rspec-expectations (2.99.2) - diff-lcs (>= 1.1.3, < 2.0) - rubocop (0.34.2) - astrolabe (~> 1.3) - parser (>= 2.2.2.5, < 3.0) - powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) - ruby-progressbar (~> 1.4) - ruby-progressbar (1.7.5) - rubyzip (1.2.0) - selenium-webdriver (2.53.0) - childprocess (~> 0.5) - rubyzip (~> 1.0) - websocket (~> 1.0) - syntax (1.2.0) - thor (0.19.1) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.2) - watir-webdriver (0.9.1) - selenium-webdriver (>= 2.46.2) - websocket (1.2.3) - yml_reader (0.7) - -PLATFORMS - ruby - -DEPENDENCIES - mediawiki_selenium (~> 1.7, >= 1.7.1) - rubocop (~> 0.34.2) diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 6eef121..0000000 --- a/Rakefile +++ /dev/null @@ -1,14 +0,0 @@ -require 'bundler/setup' - -require 'rubocop/rake_task' -RuboCop::RakeTask.new(:rubocop) do |task| - # if you use mediawiki-vagrant, rubocop will by default use it's .rubocop.yml - # the next line makes it explicit that you want .rubocop.yml from the directory - # where `bundle exec rake` is executed - task.options = ['-c', '.rubocop.yml'] -end - -task default: [:test] - -desc 'Run all build/tests commands (CI entry point)' -task test: [:rubocop] 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/environments.yml b/tests/browser/environments.yml deleted file mode 100644 index 35eb153..0000000 --- a/tests/browser/environments.yml +++ /dev/null @@ -1,39 +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/ - -beta: - mediawiki_url: http://en.wikipedia.beta.wmflabs.org/wiki/ - mediawiki_user: Selenium_user - # mediawiki_password: SET THIS IN THE ENVIRONMENT! - -test2: - mediawiki_url: http://test2.wikipedia.org/wiki/ - mediawiki_user: Selenium_user - # mediawiki_password: SET THIS IN THE ENVIRONMENT! - -integration: - user_factory: true - # mediawiki_url: THIS WILL BE SET BY JENKINS - -default: *default diff --git a/tests/browser/features/manage_translator_sandbox.feature b/tests/browser/features/manage_translator_sandbox.feature deleted file mode 100644 index faaab4a..0000000 --- a/tests/browser/features/manage_translator_sandbox.feature +++ /dev/null @@ -1,287 +0,0 @@ -@firefox @sandbox.translatewiki.net -Feature: Manage translator sandbox - - As a translation administrator, - I can review translations submitted by sandboxed users and pass or fail them, - so that I can promote sandboxed translators to full translators. - - Design: - - http://commons.wikimedia.org/wiki/File:Translate_UX_Onboarding_designs.pdf - - These scenarios test the Special:TranslatorSandbox page. - - Background: - Given I am logged in as a translation administrator - And I have reset my preferences - - Scenario: There are no users in the sandbox - Given I am on the Translator sandbox management page with no users in the sandbox - Then no users are displayed in the first column - And I should see "0 requests" at the top of the first column - And I should see "0 users selected" at the bottom of the first column - And I should see "No requests from new users" in the header of the second column - And I should not see the older requests link at the bottom of the first column - - Scenario: Existing users can be searched on the list - Given I am on the Translator sandbox management page with users in the sandbox - When I search for "pupu" in the sandboxed users search field - Then only users whose name begins with "pupu" are displayed in the first column - And I should see "5 requests" at the top of the first column - - Scenario: Searching for non-existing users displays no results - Given I am on the Translator sandbox management page with users in the sandbox - When I search for "nosuchuser" in the sandboxed users search field - Then no users are displayed in the first column - And I should see "0 requests" at the top of the first column - - Scenario: Emptying the search field shows all the users - Given I am on the Translator sandbox management page with users in the sandbox - When I search for "pupu" in the sandboxed users search field - And I search for "" in the sandboxed users search field - Then a user whose name begins with "pupu" is displayed in the first column - And a user whose name begins with "orava" is displayed in the first column - - Scenario: Selecting the last request should make the older requests counter disappear - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Pupu0" in the first column - Then I should not see the older requests link at the bottom of the first column - - Scenario: Selecting older requests - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Orava3" in the first column - And I click on the link that says "1 older requests" at the bottom of the first column - Then I should see the checkbox next to the request from "Pupu3" checked - And I should see the checkbox next to the request from "Pupu3" enabled - And I should see the checkbox next to the request from "Orava3" checked - And I should see the checkbox next to the request from "Orava3" enabled - And I should see the checkbox next to the request from "Pupu2" unchecked - And I should see "2 users selected" at the bottom of the first column - And I should see "2 users selected" in the header of the second column - - Scenario: Selecting all users - Given I am on the Translator sandbox management page with users in the sandbox - And I click the checkbox to select all users - Then I should not see the older requests link at the bottom of the first column - And I should see "11 users selected" at the bottom of the first column - And I should see "11 users selected" in the header of the second column - - Scenario: Searching for a user by language - Given I am on the Translator sandbox management page with users in the sandbox - When I click the sandboxed users language filter button - And I type "he" in the language filter - Then only users who translate to language "he" are displayed in the first column - And I should see "3 requests" at the top of the first column - And I should see "1 user selected" at the bottom of the first column - And I should see the name of the first user in the first column in the header of the second column - And I should see the button that clears language selection - And the direction of the users language filter button is "rtl" - And the language code of the users language filter button is "he" - - Scenario: Searching for a user by language and selecting all users - Given I am on the Translator sandbox management page with users in the sandbox - When I click the sandboxed users language filter button - And I type "uk" in the language filter - And I click the checkbox to select all users - Then only users who translate to language "uk" are displayed in the first column - And I should see "3 requests" at the top of the first column - And I should see "3 users selected" at the bottom of the first column - And I should see "3 users selected" in the header of the second column - - Scenario: Showing users who translate to all languages - Given I am on the Translator sandbox management page with users in the sandbox - When I click the sandboxed users language filter button - And I type "nl" in the language filter - And I click the button that clears language selection - Then I should see the checkbox next to the request from "Kissa" checked - And I should see the checkbox next to the request from "Kissa" disabled - And I should see "11 requests" at the top of the first column - And I should see "1 user selected" at the bottom of the first column - And I should not see the button that clears language selection - And the direction of the users language filter button is "ltr" - And the language code of the users language filter button is "en" - - Scenario: Searching for languages to which nobody translates - Given I am on the Translator sandbox management page with users in the sandbox - When I click the sandboxed users language filter button - And I type "be" in the language filter - Then no users are displayed in the first column - And I should see "0 requests" at the top of the first column - And I should see "0 users selected" at the bottom of the first column - And I should not see the older requests link at the bottom of the first column - - Scenario: Translation Administrator should be able to see a list of pending requests with usernames in the first column, sorted by the number of translations and the most recent within them, and the first user should be selected - Given I am on the Translator sandbox management page with users in the sandbox - Then I should see the userlist in the first column sorted by the number of translations and the most recent within them - And I should see the checkbox next to the request from "Kissa" checked - And I should see the checkbox next to the request from "Kissa" disabled - And I should see the name of the first user in the first column in the header of the second column - And I should see that the user's translations are sorted by the language code - And I should see the "Accept" button displayed in the second column - And I should see the "Reject" button displayed in the second column - And I should see "1 user selected" at the bottom of the first column - And I should not see the older requests link at the bottom of the first column - - Scenario: Clicking on a name of a user who didn't make any translations shows the user information and the action buttons and doesn't show translations - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Orava0" in the first column - Then I should see the checkbox next to the request from "Orava0" checked - And I should see the checkbox next to the request from "Orava0" disabled - And I should not see any users except "Orava0" selected - And I should see "Orava0" in the header of the second column - And I should not see any translations done by the user in the second column - And I should see the "Accept" button displayed in the second column - And I should see the "Reject" button displayed in the second column - And I should see "1 user selected" at the bottom of the first column - And I should see "11 requests" at the top of the first column - And I should see that no reminders have been sent to the user - - Scenario: Clicking a username when another user is selected selects only the new user; Clicking on a name of a user who made some translations shows the user information and the action buttons and some translations - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Orava0" in the first column - And I click on "Orava3" in the first column - Then I should see the checkbox next to the request from "Orava3" checked - And I should see the checkbox next to the request from "Orava3" disabled - And I should not see any users except "Orava3" selected - And I should see "Orava3" in the header of the second column - And I should see the details of 3 sandboxed translations done by the user in the second column - And I should see the "Accept" button displayed in the second column - And I should see the "Reject" button displayed in the second column - And I should see "1 user selected" at the bottom of the first column - And I should see that 3 reminders were sent to the user - - Scenario: Selecting multiple users - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Orava4" in the first column - And I click on the checkbox near "Pupu3" in the first column - Then I should see the checkbox next to the request from "Orava4" checked - And I should see the checkbox next to the request from "Orava4" enabled - And I should see the checkbox next to the request from "Pupu3" checked - And I should see the checkbox next to the request from "Pupu3" enabled - And I should see "2 users selected" in the header of the second column - And I should see "2 users selected" at the bottom of the first column - And I should not see any translations done by the users in the second column - And I should see the "Accept all" button displayed in the second column - And I should see the "Reject all" button displayed in the second column - - Scenario: Selecting multiple users and then one user again - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Pupu3" in the first column - And I click on the checkbox near "Pupu2" in the first column - And I click on "Orava2" in the first column - Then I should see the checkbox next to the request from "Pupu3" unchecked - And I should see the checkbox next to the request from "Pupu3" enabled - And I should see the checkbox next to the request from "Pupu2" unchecked - And I should see the checkbox next to the request from "Pupu2" enabled - And I should see the checkbox next to the request from "Orava2" checked - And I should see the checkbox next to the request from "Orava2" disabled - And I should see "Orava2" in the header of the second column - And I should see "1 user selected" at the bottom of the first column - And I should see the details of 2 sandboxed translations done by the user in the second column - And I should see the "Accept" button displayed in the second column - And I should see the "Reject" button displayed in the second column - And I should see the name of language "Nederlands" in the second column - And I should see that the language of the first translation is "Nederlands" - - Scenario: Selecting a second user with translations and deselecting it - Given I am on the Translator sandbox management page with users in the sandbox - When I click on the checkbox near "Pupu4" in the first column - And I click on the checkbox near "Pupu4" in the first column - Then I should see the checkbox next to the request from "Pupu4" unchecked - And I should see the checkbox next to the request from "Pupu4" enabled - And I should see the checkbox next to the request from "Kissa" checked - And I should see the checkbox next to the request from "Kissa" disabled - And I should see the details of 5 sandboxed translations done by the user in the second column - - Scenario: Selecting a second user without translations and deselecting it - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Pupu0" in the first column - And I click on the checkbox near "Orava0" in the first column - And I click on the checkbox near "Orava0" in the first column - Then I should see the checkbox next to the request from "Orava0" unchecked - And I should see the checkbox next to the request from "Orava0" enabled - And I should see the checkbox next to the request from "Pupu0" checked - And I should see the checkbox next to the request from "Pupu0" disabled - And I should not see any translations done by the user in the second column - - Scenario: Selecting a user who wrote a comment when signing up - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Kissa" in the first column - Then I should see that the user wrote a comment that says "I know some languages, and I'm a developer." - - Scenario: Selecting a user who didn't write a comment when signing up - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Pupu2" in the first column - Then I should not see that the user wrote a comment - - Scenario: Accepting one user - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Pupu2" in the first column - And I click the "Accept" button - Then I should not see user "Pupu2" in the first column - And I should see "Orava2" in the header of the second column - And I should see the checkbox next to the request from "Orava2" checked - And I should see the checkbox next to the request from "Orava2" disabled - And I should see "1 user selected" at the bottom of the first column - And I should see "10 requests" at the top of the first column - - Scenario: Rejecting one user - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Pupu2" in the first column - And I click the "Reject" button - Then I should not see user "Pupu2" in the first column - And I should see "Orava2" in the header of the second column - And I should see the checkbox next to the request from "Orava2" checked - And I should see the checkbox next to the request from "Orava2" disabled - And I should see "1 user selected" at the bottom of the first column - And I should see "10 requests" at the top of the first column - - Scenario: Accepting multiple users - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Pupu2" in the first column - And I click on the checkbox near "Orava3" in the first column - And I click the "Accept all" button - Then I should not see user "Pupu2" in the first column - And I should not see user "Orava3" in the first column - And I should see "Pupu4" in the header of the second column - And I should see the checkbox next to the request from "Pupu4" checked - And I should see the checkbox next to the request from "Pupu4" disabled - And I should see "1 user selected" at the bottom of the first column - And I should see "9 requests" at the top of the first column - - Scenario: Rejecting multiple users - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Pupu2" in the first column - And I click on the checkbox near "Orava3" in the first column - And I click the "Reject all" button - Then I should not see user "Pupu2" in the first column - And I should not see user "Orava3" in the first column - And I should see "Pupu4" in the header of the second column - And I should see the checkbox next to the request from "Pupu4" checked - And I should see the checkbox next to the request from "Pupu4" disabled - And I should see "1 user selected" at the bottom of the first column - And I should see "9 requests" at the top of the first column - - Scenario: Accepting all users - Given I am on the Translator sandbox management page with users in the sandbox - When I click the checkbox to select all users - And I click the "Accept all" button - Then no users are displayed in the first column - And I should see "0 requests" at the top of the first column - - Scenario: Search for users and accept the first user - Given I am on the Translator sandbox management page with users in the sandbox - When I search for "pupu" in the sandboxed users search field - And I click on "Pupu4" in the first column - And I click the "Accept" button - Then I should see "Pupu3" in the header of the second column - And I should see the checkbox next to the request from "Pupu3" checked - And I should see the checkbox next to the request from "Pupu3" disabled - And I should see "1 user selected" at the bottom of the first column - And I should see "4 requests" at the top of the first column - - Scenario: Accepting a user creates a user page - Given I am on the Translator sandbox management page with users in the sandbox - When I click on "Kissa" in the first column - And I click the "Accept" button - And I go to the userpage of user "Kissa" - Then I should see a babel box with languages "bn, he, uk, nl, fi" diff --git a/tests/browser/features/special_translate.feature b/tests/browser/features/special_translate.feature deleted file mode 100644 index 17c5b73..0000000 --- a/tests/browser/features/special_translate.feature +++ /dev/null @@ -1,25 +0,0 @@ -@firefox @meta.wikimedia.org -Feature: Special:Translate - - This page is the primary web translation interface for users. - - https://www.mediawiki.org/wiki/Help:Extension:Translate/Quality_assurance#Workflows - describes how the workflow state selector can be used. - https://commons.wikimedia.org/wiki/File:Translate-workflow-spec.pdf?page=10 - describes how it is meant to look and behave. - - @sandbox.translatewiki.net - Scenario: Workflow selector not being visible - Given I am translating a message group which doesn't have workflow states - Then I should not see a workflow state - - @custom-setup-needed - Scenario: Workflow selector being visible - Given I am translating a message group which has workflow states - Then I should see a workflow state - - @custom-setup-needed - Scenario: Workflow selector being clickable - Given I am translating a message group which has workflow states - When I click the workflow state - Then I should see a list of states diff --git a/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb b/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb deleted file mode 100644 index 0b3b2af..0000000 --- a/tests/browser/features/step_definitions/manage_translator_sandbox_steps.rb +++ /dev/null @@ -1,214 +0,0 @@ -Given(/^I am logged in as a translation administrator$/) do - step 'I am logged in' -end - -Given(/^I am on the Translator sandbox management page with no users in the sandbox$/) do - visit(ManageTranslatorSandboxPage, using_params: { extra: 'integrationtesting=empty' }) -end - -Given(/^I am on the Translator sandbox management page with users in the sandbox$/) do - visit(ManageTranslatorSandboxPage, using_params: { extra: 'integrationtesting=populate' }) -end - -When(/^I search for "(.*)" in the sandboxed users search field$/) do |string| - on(ManageTranslatorSandboxPage) do |page| - page.search = string - page.search_element.send_keys :enter - end -end - -When(/^I click the sandboxed users language filter button$/) do - on(ManageTranslatorSandboxPage).language_selector_button -end - -When(/^I type "(.+)" in the language filter$/) do |text| - on(ManageTranslatorSandboxPage) do |page| - page.language_filter = text - page.language_filter_element.send_keys [:enter, "\n"] - end -end - -When(/^I click the button that clears language selection$/) do - on(ManageTranslatorSandboxPage).clear_language_selector_element.click -end - -When(/^I click the checkbox to select all users$/) do - on(ManageTranslatorSandboxPage).select_all_checkbox_element.click -end - -When(/^I click the "(.+)" button$/) do |label| - on(ManageTranslatorSandboxPage).click_button(label) -end - -When(/^I click on "(.+)" in the first column$/) do |username| - on(ManageTranslatorSandboxPage).request_with_username(username).click -end - -When(/^I click on the checkbox near "(.+)" in the first column$/) do |username| - on(ManageTranslatorSandboxPage).checkbox_for_request_with_username(username).click -end - -When(/^I click on the link that says "\d+ older requests?" at the bottom of the first column$/) do - on(ManageTranslatorSandboxPage).older_requests_indicator_element.click -end - -When(/^I go to the userpage of user "(.*?)"$/) do |username| - visit(UserPage, using_params: { extra: username }) -end - -Then(/^I should see a babel box with languages "(.*?)"$/) do |languages| - on(UserPage).babel_box_has_languages?(languages).should be_true -end - -Then(/^I should not see the older requests link at the bottom of the first column$/) do - on(ManageTranslatorSandboxPage).older_requests_indicator_element.should_not be_visible -end - -Then(/^I should not see any users except "(.+)" selected$/) do |username| - on(ManageTranslatorSandboxPage).only_request_with_username_is_selected?(username).should be_true -end - -Then(/^I should not see any translations done by the user in the second column$/) do - on(ManageTranslatorSandboxPage) do |page| - page.translation_elements.size.should == 0 - page.details_no_translations.size.should == 1 - page.details_no_translations[0].should be_visible - end -end - -Then(/^I should not see any translations done by the users in the second column$/) do - on(ManageTranslatorSandboxPage).translation_elements.length.should == 0 -end - -Then(/^I should see the details of (\d+) sandboxed translations done by the user in the second column$/) do |translations| - on(ManageTranslatorSandboxPage) do |page| - page.translation_elements.size.should == translations.to_i - page.details_no_translations.size.should == 0 - end -end - -Then(/^I should not see user "(.+)" in the first column$/) do |username| - on(ManageTranslatorSandboxPage) do |page| - Watir::Wait.until { page.visible_requests_element.size < 11 } - page.request_with_username(username).should_not exist - end -end - -Then(/^I should see that (\d+) reminders were sent to the user$/) do |count| - on(ManageTranslatorSandboxPage) do |page| - page.reminder_status_element.should be_visible - page.reminder_status.should match(/^Sent #{count} reminders/i) - end -end - -Then(/^I should see that no reminders have been sent to the user$/) do - on(ManageTranslatorSandboxPage).reminder_status.should == '' -end - -Then(/^the direction of the users language filter button is "(.+)"$/) do |dir_value| - on(ManageTranslatorSandboxPage).language_selector_button_element.attribute('dir').should == dir_value -end - -Then(/^the language code of the users language filter button is "(.+)"$/) do |lang_value| - on(ManageTranslatorSandboxPage).language_selector_button_element.attribute('lang').should == lang_value -end - -Then(/^usernames are visible in the first column$/) do - on(ManageTranslatorSandboxPage).visible_users_element.size.should_not == 0 -end - -Then(/^I should see the name of language "(.+)" in the second column$/) do |language| - on(ManageTranslatorSandboxPage).details_autonym.text.should == language -end - -Then(/^I should see that the language of the first translation is "(.+)"$/) do |language| - on(ManageTranslatorSandboxPage).translations_autonyms[0].text.should == language -end - -Then(/^only users whose name begins with "(.*)" are displayed in the first column$/) do |prefix| - on(ManageTranslatorSandboxPage).visible_users_start_with?(prefix).should be_true -end - -Then(/^a user whose name begins with "(.*)" is displayed in the first column$/) do |prefix| - on(ManageTranslatorSandboxPage).the_first_column_has_username_starting_with?(prefix).should be_true -end - -Then(/^no users are displayed in the first column$/) do - on(ManageTranslatorSandboxPage) do |page| - Watir::Wait.until { page.visible_requests_element.size < 11 } - page.visible_users_element.length.should == 0 - end -end - -Then(/^I should see "(.+)" at the top of the first column$/) do |text| - on(ManageTranslatorSandboxPage).request_count.should == text -end - -Then(/^I should see the button that clears language selection$/) do - on(ManageTranslatorSandboxPage).clear_language_selector_element.should be_visible -end - -Then(/^I should not see the button that clears language selection$/) do - on(ManageTranslatorSandboxPage).clear_language_selector_element.should_not be_visible -end - -Then(/^only users who translate to language "(.+)" are displayed in the first column$/) do |language| - on(ManageTranslatorSandboxPage).all_visible_requests_translate_to?(language).should be_true -end - -Then(/^I should see "(.+)" at the bottom of the first column$/) do |text| - on(ManageTranslatorSandboxPage).selected_counter.should == text -end - -Then(/^I should see that the user wrote a comment that says "(.*?)"$/) do |text| - on(ManageTranslatorSandboxPage).signup_comment_text.should == text -end - -Then(/^I should not see that the user wrote a comment$/) do - on(ManageTranslatorSandboxPage).signup_comment_text_element.should_not exist -end - -Then(/^I should see the name of the first user in the first column in the header of the second column$/) do - on(ManageTranslatorSandboxPage) do |page| - page.details_header.text.should == page.username_in_request(0) - end -end - -Then(/^I should see "(.+)" in the header of the second column$/) do |text| - on(ManageTranslatorSandboxPage).details_header.text.should == text -end - -Then(/^I should see the userlist in the first column sorted by the number of translations and the most recent within them$/) do - on(ManageTranslatorSandboxPage).requests_are_sorted_by_translation_count_and_date?.should be_true -end - -Then(/^I should see the checkbox next to the request from "(.+)" checked$/) do |user| - on(ManageTranslatorSandboxPage).checkbox_for_request_with_username(user).should be_checked -end - -Then(/^I should see the checkbox next to the request from "(.+)" unchecked$/) do |user| - on(ManageTranslatorSandboxPage).checkbox_for_request_with_username(user).should_not be_checked -end - -Then(/^I should see the checkbox next to the request from "(.+)" disabled$/) do |user| - on(ManageTranslatorSandboxPage).checkbox_for_request_with_username(user).should be_disabled -end - -Then(/^I should see the checkbox next to the request from "(.+)" enabled$/) do |user| - on(ManageTranslatorSandboxPage).checkbox_for_request_with_username(user).should_not be_disabled -end - -Then(/^I should see the "(.+)" button displayed in the second column$/) do |label| - on(ManageTranslatorSandboxPage).details_button(label).should be_visible -end - -Then(/^I should see "(.+)" in the older requests link at the bottom of the first column$/) do |text| - on(ManageTranslatorSandboxPage) do |page| - page.older_requests_indicator_element.should be_visible - page.older_requests_indicator_element.text.should == text - end -end - -Then(/^I should see that the user's translations are sorted by the language code$/) do - on(ManageTranslatorSandboxPage).translations_languages_are_sorted?.should be_true -end diff --git a/tests/browser/features/step_definitions/special_translate_steps.rb b/tests/browser/features/step_definitions/special_translate_steps.rb deleted file mode 100644 index 9716581..0000000 --- a/tests/browser/features/step_definitions/special_translate_steps.rb +++ /dev/null @@ -1,23 +0,0 @@ -Given(/^I am translating a message group which doesn't have workflow states$/) do - visit(TranslatePage, using_params: { extra: 'language=fi' }) -end - -Given(/^I am translating a message group which has workflow states$/) do - visit(TranslatePage, using_params: { extra: 'language=fi&group=page-Language+committee' }) -end - -When(/^I click the workflow state$/) do - on(TranslatePage).workflow_state_element.when_present.click -end - -Then(/^I should see a workflow state$/) do - on(TranslatePage).workflow_state_element.when_present.should be_visible -end - -Then(/^I should not see a workflow state$/) do - on(TranslatePage).workflow_state_element.should_not be_visible -end - -Then(/^I should see a list of states$/) do - on(TranslatePage).workflow_state_selector_element.should be_visible -end diff --git a/tests/browser/features/step_definitions/translation_stash_steps.rb b/tests/browser/features/step_definitions/translation_stash_steps.rb deleted file mode 100644 index a5646ff..0000000 --- a/tests/browser/features/step_definitions/translation_stash_steps.rb +++ /dev/null @@ -1,68 +0,0 @@ -Given(/^I am logged in at sandbox$/) do - log_in -end - -Given(/^I am a sandboxed user on the stash page$/) do - visit(StashPage, using_params: { extra: 'integrationtesting=activatestash' }) -end - -Then(/^I should see a language selector$/) do - on(StashPage).language_selector_element.should be_visible -end - -Then(/^I should be able to select a language$/) do - on(StashPage).select_language('fi') -end - -Then(/^I should see the save button$/) do - on(StashPage).save_button_element.when_present.should be_visible -end - -Then(/^I should see the skip button$/) do - on(StashPage).skip_button_element.when_present.should be_visible -end - -When(/^I make a translation$/) do - on(StashPage).make_a_translation -end - -Then(/^I should see my translation saved$/) do - on(StashPage).status_saved_element.when_present.should be_visible -end - -Then(/^I should see the next message open for translation$/) do - on(StashPage) do |page| - page.translation_element(1).when_present.should be_visible - page.translation_element(1).value.should == '' - end -end - -When(/^I reload the page$/) do - visit StashPage -end - -Then(/^I can open and see my earlier translation$/) do - pending('Does not work because of random language selection on reload.') do - on(StashPage) do |page| - page.edit_element.when_present(10).click - page.translation_element.when_present.value.should == 'Pupu' - end - end -end - -Then(/^I should see a message indicating I have one completed translation$/) do - on(StashPage).translation_stats.should match(/1/) -end - -When(/^I translate all the messages in the sandbox$/) do - # Sandbox needs to get enough messages - pending - (0..19).each do |i| - on(StashPage).make_a_translation(i) - step 'I should see my translation saved' - end -end - -Then(/^I can see a message that maximum number of translations has been reached$/) do - on(StashPage).limit_message_element.should be_visible -end diff --git a/tests/browser/features/support/env.rb b/tests/browser/features/support/env.rb deleted file mode 100644 index c1072b2..0000000 --- a/tests/browser/features/support/env.rb +++ /dev/null @@ -1,3 +0,0 @@ -require 'mediawiki_selenium/cucumber' -require 'mediawiki_selenium/pages' -require 'mediawiki_selenium/step_definitions' diff --git a/tests/browser/features/support/hooks.rb b/tests/browser/features/support/hooks.rb deleted file mode 100644 index ea2dc08..0000000 --- a/tests/browser/features/support/hooks.rb +++ /dev/null @@ -1,3 +0,0 @@ -After('@stash') do - visit(StashPage, using_params: { extra: 'integrationtesting=deactivatestash' }) -end diff --git a/tests/browser/features/support/pages/manage_translator_sandbox_page.rb b/tests/browser/features/support/pages/manage_translator_sandbox_page.rb deleted file mode 100644 index a37171f..0000000 --- a/tests/browser/features/support/pages/manage_translator_sandbox_page.rb +++ /dev/null @@ -1,141 +0,0 @@ -require 'json' - -class ManageTranslatorSandboxPage - include PageObject - - page_url 'Special:ManageTranslatorSandbox?<%=params[:extra]%>' - - button(:clear_language_selector, class: 'clear-language-selector') - - div(:details, class: 'details') - - text_field(:language_filter, id: 'languagefilter') - button(:language_selector_button, class: 'language-selector') - - a(:older_requests_indicator, class: 'older-requests-indicator') - - div(:request_count, class: 'request-count') - span(:reminder_status, class: 'reminder-status') - - span(:selected_counter, class: 'selected-counter') - - text_field(:search, class: 'request-filter-box') - - checkbox(:select_all_checkbox, class: 'request-selector-all') - - div(:signup_comment_text, class: 'signup-comment-text') - - # This must be reloaded every time, because it may change during the test - def details_header - browser.element(class: 'tsb-header') - end - - def details_button(label) - button_class = label.downcase.gsub(' ', '-') - browser.button(class: button_class) - end - - def details_no_translations - browser.divs(class: 'tsb-details-no-translations') - end - - def visible_request_selectors_element - browser.elements(css: '.row.request:not(.hide) .request-selector') - end - - def visible_users_element - browser.elements(css: '.row.request:not(.hide) .username') - end - - def visible_requests_element - browser.elements(css: '.row.request:not(.hide)') - end - - def hidden_users_element - browser.elements(css: '.requests .request.hide') - end - - def request_with_username(username) - browser.div(id: "tsb-request-#{username}") - end - - def requests_without_username(username) - browser.elements(css: ".row.request:not(#tsb-request-#{username})") - end - - def translation_elements - browser.elements(css: '.details .translation') - end - - def checkbox_for_request_with_username(username) - browser.div(id: "tsb-request-#{username}").checkbox(class: 'request-selector') - end - - def visible_users_start_with?(prefix) - Watir::Wait.until { hidden_users_element.size > 0 } - visible_users_element.all? do |element| - element.text.match(/^#{prefix}/i) - end - end - - def the_first_column_has_username_starting_with?(prefix) - visible_users_element.any? do |element| - element.text.match(/^#{prefix}/i) - end - end - - def all_visible_requests_translate_to?(language) - Watir::Wait.until { hidden_users_element.size > 0 } - visible_requests_element.all? do |element| - user_data = JSON.parse(element.attribute_value('data-data')) - user_data['languagepreferences']['languages'].include?(language) - end - end - - def username_in_request(index) - visible_users_element[index].text - end - - def requests_are_sorted_by_translation_count_and_date? - expected_usernames = [] - Array(0..4).each do |num| - %w(Pupu Orava).each do |name| - expected_usernames.unshift("#{name}#{num}") - end - end - expected_usernames.unshift('Kissa') - usernames = visible_users_element.collect { |element| element.text } - - expected_usernames == usernames - end - - def details_autonym - browser.elements(css: '.details.pane .languages span')[0] - end - - def translations_languages_are_sorted? - expected_langs = %w(bn fi he nl uk) - langs = translations_autonyms.collect { |element| element.attribute_value('lang') } - - expected_langs == langs - end - - def translations_autonyms - browser.elements(css: '.details.pane .translations .info.autonym') - end - - def click_button(label) - details_button(label).click - - # It takes a few moments until Accept and Reject buttons - # finish performing the action, and this action always - # removes the currently displayed users and changes the header - Watir::Wait.while { browser.execute_script 'return window.tsbUpdatingUsers' } - end - - def only_request_with_username_is_selected?(username) - requests_without_username(username).all? do |element| - !element.attribute_value('class').split(' ').include?('selected') - end - end -end diff --git a/tests/browser/features/support/pages/stash_page.rb b/tests/browser/features/support/pages/stash_page.rb deleted file mode 100644 index f40bbf0..0000000 --- a/tests/browser/features/support/pages/stash_page.rb +++ /dev/null @@ -1,36 +0,0 @@ -class StashPage - include PageObject - - page_url 'Special:TranslationStash?<%=params[:extra]%>' - - a(:edit, text: 'Edit') - - a(:language_selector, class: 'uls-trigger') - text_field(:language_filter, id: 'uls-languagefilter') - - button(:skip_button, class: 'tux-editor-skip-button') - - span(:status_saved, class: 'tux-status-translated') - - div(:translation_stats, class: 'stash-stats') - div(:limit_message, class: 'limit-reached') - - def make_a_translation(index = 0) - translation_element(index).when_present.set 'Pupu' - save_button_element(index).click - end - - def save_button_element(index = 0) - browser.button(class: 'tux-editor-save-button', index: index) - end - - def select_language(language) - language_selector_element.click - self.language_filter = language - language_filter_element.send_keys :enter - end - - def translation_element(index = 0) - browser.text_field(class: 'tux-textarea-translation', index: index) - end -end diff --git a/tests/browser/features/support/pages/translate_page.rb b/tests/browser/features/support/pages/translate_page.rb deleted file mode 100644 index 1794d7a..0000000 --- a/tests/browser/features/support/pages/translate_page.rb +++ /dev/null @@ -1,8 +0,0 @@ -class TranslatePage - include PageObject - - page_url 'Special:Translate?<%=params[:extra]%>' - - div(:workflow_state, class: 'tux-workflow-status') - ul(:workflow_state_selector, class: 'tux-workflow-status-selector') -end diff --git a/tests/browser/features/support/pages/user_page.rb b/tests/browser/features/support/pages/user_page.rb deleted file mode 100644 index 03a2756..0000000 --- a/tests/browser/features/support/pages/user_page.rb +++ /dev/null @@ -1,12 +0,0 @@ -class UserPage - include PageObject - - page_url 'User:<%=params[:extra]%>' - - def babel_box_has_languages?(languages) - languages.split(/, /).all? do |language| - browser.element(css: ".mw-babel-box td[lang=#{language}]").visible? - end - end - -end diff --git a/tests/browser/features/translation_stash.feature b/tests/browser/features/translation_stash.feature deleted file mode 100644 index 8516a47..0000000 --- a/tests/browser/features/translation_stash.feature +++ /dev/null @@ -1,44 +0,0 @@ -@firefox @sandbox.translatewiki.net @stash -Feature: Translation stash - - As a new translator, I can make translations in sandbox mode so that a translation administrator - can check them and give me translator rights, so that I do not have to register and wait for - approval before contributing translation for the site. - - Design: - - http://commons.wikimedia.org/wiki/File:Translate_UX_Onboarding_designs.pdf - - These scenarios test the Special:TranslationStash page. User needs to be inside the sandbox - to access this page. - The easiest way to achieve this is to add the test username to $wgTranslateTestUsers[]. - - Background: - Given I am logged in at sandbox - And I am a sandboxed user on the stash page - - Scenario: Can select a language to translate into - Then I should see a language selector - And I should be able to select a language - - Scenario: Common elements in translation widget - - The first message is automatically opened for editing - - Then I should see the save button - And I should see the skip button - - Scenario: Can make a translation - When I make a translation - Then I should see my translation saved - And I should see the next message open for translation - And I should see a message indicating I have one completed translation - - Scenario: Can improve own earlier translation - When I make a translation - Then I should see my translation saved - And I reload the page - And I can open and see my earlier translation - - Scenario: User is displayed a message when all messages have been translated - When I translate all the messages in the sandbox - Then I can see a message that maximum number of translations has been reached -- To view, visit https://gerrit.wikimedia.org/r/381467 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7506dfb6250237f45dcea5c4dc64a864fa321732 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Zfilipin <zfili...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits