jenkins-bot has submitted this change and it was merged. Change subject: [BrowserTest] rubocop updates to replace double quotes with single ......................................................................
[BrowserTest] rubocop updates to replace double quotes with single Change-Id: I0608aea2bd634156bf800b3be47a5c2a6d9fadca --- M .rubocop_todo.yml M modules/ve-mw/tests/browser/features/step_definitions/bullets_steps.rb M modules/ve-mw/tests/browser/features/step_definitions/cite_steps.rb M modules/ve-mw/tests/browser/features/step_definitions/language_screenshot_steps.rb M modules/ve-mw/tests/browser/features/step_definitions/links_steps.rb M modules/ve-mw/tests/browser/features/step_definitions/media_interface_steps.rb M modules/ve-mw/tests/browser/features/step_definitions/multiedit_workflow_steps.rb M modules/ve-mw/tests/browser/features/step_definitions/references_steps.rb M modules/ve-mw/tests/browser/features/step_definitions/shared_steps.rb M modules/ve-mw/tests/browser/features/step_definitions/switch_editing_mode_steps.rb M modules/ve-mw/tests/browser/features/support/env.rb M modules/ve-mw/tests/browser/features/support/hooks.rb M modules/ve-mw/tests/browser/features/support/language_screenshot.rb M modules/ve-mw/tests/browser/features/support/pages/dummy_page.rb M modules/ve-mw/tests/browser/features/support/pages/user_page.rb M modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb M modules/ve-mw/tests/browser/features/support/pages/zarticlepage.rb M modules/ve-mw/tests/browser/spec/rectangle_spec.rb M modules/ve-mw/tests/browser/upload.rb 19 files changed, 258 insertions(+), 264 deletions(-) Approvals: Zfilipin: Looks good to me, approved jenkins-bot: Verified diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c35940b..e22b64b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -50,9 +50,3 @@ # Cop supports --auto-correct. Style/SpaceAfterComma: Enabled: false - -# Offense count: 281 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/StringLiterals: - Enabled: false diff --git a/modules/ve-mw/tests/browser/features/step_definitions/bullets_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/bullets_steps.rb index e464fc3..b33bcfc 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/bullets_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/bullets_steps.rb @@ -7,7 +7,7 @@ When(/^I click Decrease indentation$/) do on(VisualEditorPage) do |page| - step "I click in the editable part" + step 'I click in the editable part' page.bullet_number_selector_element.when_present.click page.decrease_indentation_element.when_present.click end diff --git a/modules/ve-mw/tests/browser/features/step_definitions/cite_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/cite_steps.rb index 18cbcc5..2b4ac7e 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/cite_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/cite_steps.rb @@ -85,36 +85,36 @@ Then(/^diff view should show the Book citation added$/) do on(VisualEditorPage) do |page| page.wait_until(10) do - page.diff_view.include? "Cite VisualEditor Test" + page.diff_view.include? 'Cite VisualEditor Test' end - expect(page.diff_view).to match "<ref>{{Cite book|title = Book title|last = Book author last name|first = Book author first name|publisher = Book publisher|year = 2014|isbn = 9780743273565|location = Location of publication|pages = 123|New book field = New book field contents}}</ref>Cite VisualEditor Test" + expect(page.diff_view).to match '<ref>{{Cite book|title = Book title|last = Book author last name|first = Book author first name|publisher = Book publisher|year = 2014|isbn = 9780743273565|location = Location of publication|pages = 123|New book field = New book field contents}}</ref>Cite VisualEditor Test' end end Then(/^diff view should show the Journal citation added$/) do on(VisualEditorPage) do |page| page.wait_until(10) do - page.diff_view.include? "Cite VisualEditor Test" + page.diff_view.include? 'Cite VisualEditor Test' end - expect(page.diff_view).to match "<ref>{{Cite journal|title = Journal title|date = Journal Source date}}</ref>Cite VisualEditor Test" + expect(page.diff_view).to match '<ref>{{Cite journal|title = Journal title|date = Journal Source date}}</ref>Cite VisualEditor Test' end end Then(/^diff view should show the News citation added$/) do on(VisualEditorPage) do |page| page.wait_until(10) do - page.diff_view.include? "Cite VisualEditor Test" + page.diff_view.include? 'Cite VisualEditor Test' end - expect(page.diff_view).to match "<ref>{{Cite news|url = News URL|title = News Source title|last = News Last name|first = News First name|date = News Source date|work = News Work|accessdate = News URL access date}}</ref>Cite VisualEditor Test" + expect(page.diff_view).to match '<ref>{{Cite news|url = News URL|title = News Source title|last = News Last name|first = News First name|date = News Source date|work = News Work|accessdate = News URL access date}}</ref>Cite VisualEditor Test' end end Then(/^diff view should show the Website citation added$/) do on(VisualEditorPage) do |page| page.wait_until(10) do - page.diff_view.include? "Cite VisualEditor Test" + page.diff_view.include? 'Cite VisualEditor Test' end - expect(page.diff_view).to match "<ref>{{Cite web|url = http://en.wikipedia.org/|title = Website Source title|date = Website Source date 28 July 2014|accessdate = {{CURRENTMONTHNAME}} {{CURRENTYEAR}}28 July 2014|website = Website title|publisher = Website publisher|last = Website Last name|first = Website First name|New website field = New website field contents}}</ref>Cite VisualEditor Test" + expect(page.diff_view).to match '<ref>{{Cite web|url = http://en.wikipedia.org/|title = Website Source title|date = Website Source date 28 July 2014|accessdate = {{CURRENTMONTHNAME}} {{CURRENTYEAR}}28 July 2014|website = Website title|publisher = Website publisher|last = Website Last name|first = Website First name|New website field = New website field contents}}</ref>Cite VisualEditor Test' end end diff --git a/modules/ve-mw/tests/browser/features/step_definitions/language_screenshot_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/language_screenshot_steps.rb index e4104f0..ccb609e 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/language_screenshot_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/language_screenshot_steps.rb @@ -1,18 +1,18 @@ Given(/^I go to the "(.*?)" page which has a media image$/) do |page_title| - wikitext = "[[File:2012-07-18 Market Street - San Francisco.webm|thumb]]" + wikitext = '[[File:2012-07-18 Market Street - San Francisco.webm|thumb]]' step "I go to the \"#{page_title}\" page with source content \"#{wikitext}\"" end Given(/^I select the image in VisualEditor$/) do - step "I click in the editable part" + step 'I click in the editable part' on(VisualEditorPage).media_image_element.when_present.click end Given (/^I go to "(.+)" page which has references$/) do |page_title| - wikitext = "VisualEditor is a MediaWiki extension.<ref>[http://www.mediawiki.org/wiki/Extension:VisualEditor Extension:VisualEditor]</ref>" + wikitext = 'VisualEditor is a MediaWiki extension.<ref>[http://www.mediawiki.org/wiki/Extension:VisualEditor Extension:VisualEditor]</ref>' on(APIPage).create page_title, wikitext step "I go to the #{page_title} page for screenshot" - step "I click in the editable part" + step 'I click in the editable part' end Given(/^I go to the "(.*?)" page with source content "(.*?)"$/) do |page_title, page_content| @@ -27,19 +27,19 @@ Given(/^I am editing language screenshot page$/) do step "I go to the \"Language Screenshot\" page with source content \"Language Screenshot\"" - step "I click in the editable part" + step 'I click in the editable part' end Given(/^I am edit language screenshot page with (.+)$/) do |content| - step "I am editing language screenshot page" + step 'I am editing language screenshot page' step "I edit the page with #{content}" end Given(/^I select an image by searching (.+) in Media option$/) do |_content| - step "I click in the editable part" - step "I click Media" - step "I enter San Francisco into media Search box" - step "I select an Image" + step 'I click in the editable part' + step 'I click Media' + step 'I enter San Francisco into media Search box' + step 'I select an Image' end Given(/^I enter "(.*?)" in alternative text$/) do |content| @@ -55,8 +55,8 @@ end When(/^I click on the Special character option in Insert menu$/) do - step "I click on the Insert menu" - step "I click on More in insert pull-down menu" + step 'I click on the Insert menu' + step 'I click on More in insert pull-down menu' on(VisualEditorPage).special_character_element.when_present.click end @@ -87,7 +87,7 @@ When(/^I send right arrow times (\d+)$/) do |number| number.to_i.times do on(VisualEditorPage).content_element.send_keys :arrow_right - on(VisualEditorPage).content_element.fire_event("onblur") #gerrit 86800/86801 + on(VisualEditorPage).content_element.fire_event('onblur') #gerrit 86800/86801 end end @@ -96,28 +96,28 @@ end When(/^I click on category in hamburger menu$/) do - step "I click the hamburger menu" + step 'I click the hamburger menu' on(VisualEditorPage).category_link_element.when_present.click end When(/^I click on Formula option in Insert menu$/) do - step "I click on the Insert menu" + step 'I click on the Insert menu' on(VisualEditorPage).formula_link_element.when_present.click end When(/^I type a formula$/) do - on(VisualEditorPage).formula_area_element.when_present.send_keys "2+2" + on(VisualEditorPage).formula_area_element.when_present.send_keys '2+2' end When(/^I go to random page for screenshot$/) do - step "I am at a random page" + step 'I am at a random page' @browser.goto "#{@browser.url}?setlang=#{ENV['LANGUAGE_SCREENSHOT_CODE']}" end When(/^I click on References list in Insert menu$/) do - step "I click in the editable part" - step "I click on the Insert menu" - step "I click on More in insert pull-down menu" + step 'I click in the editable part' + step 'I click on the Insert menu' + step 'I click on More in insert pull-down menu' on(VisualEditorPage).ve_references_element.when_present.click end @@ -128,7 +128,7 @@ Then(/^I should see Headings pull-down menu$/) do on(VisualEditorPage).heading_dropdown_menus_element.when_present.should be_visible - step "I take screenshot of pull-dowm menu" + step 'I take screenshot of pull-dowm menu' end Then(/^I take screenshot of pull-dowm menu$/) do @@ -137,7 +137,7 @@ Then(/^I should see Formatting pull-down menu$/) do on(VisualEditorPage).formatting_option_menus_element.when_present.should be_visible - step "I take screenshot of Formatting pull-down menu" + step 'I take screenshot of Formatting pull-down menu' end Then(/^I take screenshot of Formatting pull-down menu$/) do @@ -146,7 +146,7 @@ Then(/^I should see pull-down menu containing Page Settings$/) do on(VisualEditorPage).page_settings_element.when_present.should be_visible - step "I take screenshot of Visual Editor insert menu" + step 'I take screenshot of Visual Editor insert menu' end Then(/^I take screenshot of Visual Editor insert menu$/) do @@ -155,11 +155,11 @@ Then(/^I should see Insert pull-down menu$/) do on(VisualEditorPage).insert_pull_down_element.when_present.should be_visible - step "I take screenshot of insert pull-down menu" + step 'I take screenshot of insert pull-down menu' end Then(/^I take screenshot of insert pull-down menu$/) do - step "I click on More in insert pull-down menu" + step 'I click on More in insert pull-down menu' capture_screenshot("#{@scenario.name}-#{ENV['LANGUAGE_SCREENSHOT_CODE']}.png", [@current_page.insert_menu_element, @current_page.insert_pull_down_element]) highlight @current_page.media_insert_menu_element @@ -297,6 +297,6 @@ end When(/^I go to language screenshot page$/) do - step "I am on the Language Screenshot page" + step 'I am on the Language Screenshot page' @browser.goto "#{@browser.url}&setlang=#{ENV['LANGUAGE_SCREENSHOT_CODE']}" end diff --git a/modules/ve-mw/tests/browser/features/step_definitions/links_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/links_steps.rb index 7093785..334fdce 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/links_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/links_steps.rb @@ -37,26 +37,26 @@ Then(/^a non\-existing link appears in the diff view$/) do on(VisualEditorPage) do |page| page.wait_until(10) do - page.diff_view.include? "DoesNotExist" + page.diff_view.include? 'DoesNotExist' end - expect(page.diff_view).to match "[[DoesNotExist|Links]]" + expect(page.diff_view).to match '[[DoesNotExist|Links]]' end end Then(/^an external link appears in the diff view$/) do on(VisualEditorPage) do |page| page.wait_until(10) do - page.diff_view.include? "example.com" + page.diff_view.include? 'example.com' end - expect(page.diff_view).to match "[http://www.example.com Links]" + expect(page.diff_view).to match '[http://www.example.com Links]' end end Then(/^an internal link appears in the diff view$/) do on(VisualEditorPage) do |page| page.wait_until(10) do - page.diff_view.include? "Main Page" + page.diff_view.include? 'Main Page' end - expect(page.diff_view).to match "[[Main Page|Links]]" + expect(page.diff_view).to match '[[Main Page|Links]]' end end diff --git a/modules/ve-mw/tests/browser/features/step_definitions/media_interface_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/media_interface_steps.rb index 2a8ae2e..f2acaff 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/media_interface_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/media_interface_steps.rb @@ -20,7 +20,7 @@ # So we put single quotes around the entries in the .feature file and strip them here to get unescaped regexes. headings_string = headings_string.gsub(/'/, '') page.wait_until(15) do - page.diff_view.include? "Your text" + page.diff_view.include? 'Your text' end expect(page.diff_view).to match headings_string end diff --git a/modules/ve-mw/tests/browser/features/step_definitions/multiedit_workflow_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/multiedit_workflow_steps.rb index 1d39d1a..07500de 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/multiedit_workflow_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/multiedit_workflow_steps.rb @@ -1,21 +1,21 @@ When(/^I enter and save the first edit$/) do - @first_edit_text = "Editing with " + Random.rand.to_s + @first_edit_text = 'Editing with ' + Random.rand.to_s step "I insert the text #{@first_edit_text}" - step "I click Save page" - step "I click This is a minor edit" - step "I click Review your changes" - step "I click Return to save form" - step "I click Save page the second time" + step 'I click Save page' + step 'I click This is a minor edit' + step 'I click Review your changes' + step 'I click Return to save form' + step 'I click Save page the second time' end When(/^I enter and save a (.+) edit$/) do |count| on(VisualEditorPage).medium_dialog_element.when_not_visible(10) - edit_text = "Editing with " + Random.rand.to_s + edit_text = 'Editing with ' + Random.rand.to_s instance_variable_set("@#{count}_edit_text", edit_text) - step "I click Edit for VisualEditor" + step 'I click Edit for VisualEditor' step "I insert the text #{edit_text}" - step "I click Save page" - step "I click Save page the second time" + step 'I click Save page' + step 'I click Save page the second time' end When(/^I insert the text (.*?)$/) do |input_string| diff --git a/modules/ve-mw/tests/browser/features/step_definitions/references_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/references_steps.rb index fa6b1fe..8620237 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/references_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/references_steps.rb @@ -4,7 +4,7 @@ ==References== <references />" - on(APIPage).create "Reference VisualEditor Test", wikitext + on(APIPage).create 'Reference VisualEditor Test', wikitext step 'I am on the Reference VisualEditor Test page' end @@ -40,9 +40,9 @@ end When(/^I create a reference using existing reference$/) do - step("I click Reference") - step("I click use an existing reference button in References User Interface") - step("I click on Extension:VisualEditor reference") + step('I click Reference') + step('I click use an existing reference button in References User Interface') + step('I click on Extension:VisualEditor reference') end Then(/^first link to reference should be visible$/) do diff --git a/modules/ve-mw/tests/browser/features/step_definitions/shared_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/shared_steps.rb index 2f73fc8..466476a 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/shared_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/shared_steps.rb @@ -5,14 +5,14 @@ Given(/^I click in the editable part$/) do on(VisualEditorPage) do |page| - page.content_element.when_present.fire_event("onfocus") - page.content_element.send_keys("") + page.content_element.when_present.fire_event('onfocus') + page.content_element.send_keys('') end end Given(/^I go to the browser specific edit page page$/) do - page_title = "Edit page for " + ENV['BROWSER'] - page_content = "Edit page for " + ENV['BROWSER'] + page_title = 'Edit page for ' + ENV['BROWSER'] + page_content = 'Edit page for ' + ENV['BROWSER'] on(APIPage).create page_title, page_content step "I am on the #{page_title} page" end @@ -26,7 +26,7 @@ Given(/^I make the text "(.*?)" be selected$/) do |select_text| on(VisualEditorPage) do |page| page.content_element.when_present.click - require "watir-webdriver/extensions/select_text" + require 'watir-webdriver/extensions/select_text' page.content_element.when_present.select_text select_text end end @@ -99,9 +99,9 @@ # Contents pulled from the Cucumber tables in the .feature are escaped regexes. # In this case we want unescaped regexes (and in one case a leading space) # So we put single quotes around the entries in the .feature file and strip them here to get unescaped regexes. - headings_string = headings_string.gsub(/"/, "") + headings_string = headings_string.gsub(/"/, '') page.wait_until(10) do - page.diff_view.include? "Your text" + page.diff_view.include? 'Your text' end expect(page.diff_view).to match headings_string end diff --git a/modules/ve-mw/tests/browser/features/step_definitions/switch_editing_mode_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/switch_editing_mode_steps.rb index 0c4b86d..5a1dbb5 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/switch_editing_mode_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/switch_editing_mode_steps.rb @@ -42,7 +42,7 @@ Then(/^I should be in Visual Editor editing alternate mode$/) do on(VisualEditorPage) do |page| page.wait_until(15) do - page.text.include? "Edit page for" + page.text.include? 'Edit page for' end expect(page.content_element.when_present).to be_visible end @@ -51,7 +51,7 @@ Then(/^I should be in Visual Editor editing mode$/) do on(VisualEditorPage) do |page| page.wait_until(15) do - page.text.include? "Edit page for" + page.text.include? 'Edit page for' end end expect(@browser.url).to match /w\/index\.php\?title=Edit_page_for_#{ENV['BROWSER']}&veaction=edit/ @@ -60,8 +60,8 @@ Then(/^I should be in wikitext editing mode$/) do on(VisualEditorPage) do |page| page.wait_until(15) do - page.text.include? "Editing Edit page for" + page.text.include? 'Editing Edit page for' end end - expect(@browser.url).to eql(ENV['MEDIAWIKI_URL'] + "Edit page for " + ENV['BROWSER'] + "?action=submit") + expect(@browser.url).to eql(ENV['MEDIAWIKI_URL'] + 'Edit page for ' + ENV['BROWSER'] + '?action=submit') end diff --git a/modules/ve-mw/tests/browser/features/support/env.rb b/modules/ve-mw/tests/browser/features/support/env.rb index 4ed657f..1083f49 100644 --- a/modules/ve-mw/tests/browser/features/support/env.rb +++ b/modules/ve-mw/tests/browser/features/support/env.rb @@ -1,6 +1,6 @@ -require_relative "hooks" -require_relative "language_screenshot" -require "mediawiki_selenium" -require "mediawiki_api" +require_relative 'hooks' +require_relative 'language_screenshot' +require 'mediawiki_selenium' +require 'mediawiki_api' include MediawikiApi diff --git a/modules/ve-mw/tests/browser/features/support/hooks.rb b/modules/ve-mw/tests/browser/features/support/hooks.rb index 34d32f0..ca0a93a 100644 --- a/modules/ve-mw/tests/browser/features/support/hooks.rb +++ b/modules/ve-mw/tests/browser/features/support/hooks.rb @@ -1,17 +1,17 @@ at_exit do - $browser.close unless ENV["KEEP_BROWSER_OPEN"] == "true" + $browser.close unless ENV['KEEP_BROWSER_OPEN'] == 'true' end #This is for the multiedit test -Before("@edit_user_page_login") do - if (!$edit_user_page_login || !(ENV["REUSE_BROWSER"] == "true")) && @browser - step "I am logged in" - step "I go to the browser specific edit page page" - step "I edit the page with Editing with" +Before('@edit_user_page_login') do + if (!$edit_user_page_login || !(ENV['REUSE_BROWSER'] == 'true')) && @browser + step 'I am logged in' + step 'I go to the browser specific edit page page' + step 'I edit the page with Editing with' $edit_user_page_login = true end end -Before("@language_screenshot") do |scenario| +Before('@language_screenshot') do |scenario| @scenario = scenario end diff --git a/modules/ve-mw/tests/browser/features/support/language_screenshot.rb b/modules/ve-mw/tests/browser/features/support/language_screenshot.rb index 34c0eb9..a2655af 100644 --- a/modules/ve-mw/tests/browser/features/support/language_screenshot.rb +++ b/modules/ve-mw/tests/browser/features/support/language_screenshot.rb @@ -1,5 +1,5 @@ def capture_screenshot(file_name, page_elements, offset_element = nil, browser_zoom = 1) - screenshot_directory = ENV["LANGUAGE_SCREENSHOT_PATH"] || "screenshots" + screenshot_directory = ENV['LANGUAGE_SCREENSHOT_PATH'] || 'screenshots' FileUtils.mkdir_p screenshot_directory screenshot_path = "#{screenshot_directory}/#{file_name}" @@ -29,7 +29,7 @@ width = crop_rectangle[2] height = crop_rectangle[3] - require "chunky_png" + require 'chunky_png' image = ChunkyPNG::Image.from_file path # It happens with some elements that an image goes off the screen a bit, diff --git a/modules/ve-mw/tests/browser/features/support/pages/dummy_page.rb b/modules/ve-mw/tests/browser/features/support/pages/dummy_page.rb index 51fee82..11f099a 100644 --- a/modules/ve-mw/tests/browser/features/support/pages/dummy_page.rb +++ b/modules/ve-mw/tests/browser/features/support/pages/dummy_page.rb @@ -2,8 +2,8 @@ include PageObject include URL - page_url ("http://<%=params[:site]%>/wiki/asdfdgfghlkj?veaction=edit") + page_url ('http://<%=params[:site]%>/wiki/asdfdgfghlkj?veaction=edit') - div(:ve_editing_surface, class: "ve-ui-surface ve-init-mw-viewPageTarget-surface") - div(:ve_editing_toolbar, class: "oo-ui-toolbar-bar") + div(:ve_editing_surface, class: 've-ui-surface ve-init-mw-viewPageTarget-surface') + div(:ve_editing_toolbar, class: 'oo-ui-toolbar-bar') end diff --git a/modules/ve-mw/tests/browser/features/support/pages/user_page.rb b/modules/ve-mw/tests/browser/features/support/pages/user_page.rb index 5ae5631..a7c80be 100644 --- a/modules/ve-mw/tests/browser/features/support/pages/user_page.rb +++ b/modules/ve-mw/tests/browser/features/support/pages/user_page.rb @@ -2,7 +2,7 @@ include PageObject include URL - page_url URL.url("<%=params[:page_title]%>") + page_url URL.url('<%=params[:page_title]%>') - div(:ve_editing_surface, class: "ve-ui-surface ve-init-mw-viewPageTarget-surface") + div(:ve_editing_surface, class: 've-ui-surface ve-init-mw-viewPageTarget-surface') end diff --git a/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb b/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb index 1246ef2..53209fb 100644 --- a/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb +++ b/modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb @@ -3,11 +3,11 @@ include URL page_url URL.url("User:#{ENV['MEDIAWIKI_USER']}/#{ENV['BROWSER']}?vehidebetadialog=true&veaction=edit") - div(:add_a_template_title, class: "oo-ui-processDialog-location", text: /Add a template/) - span(:add_template, text: "Add template") - span(:basic_reference, class: "oo-ui-iconElement-icon oo-ui-icon-reference") - span(:bullet_number_selector, class: "oo-ui-iconElement-icon oo-ui-icon-bullet-list") - span(:category_link, class: "oo-ui-iconElement-icon oo-ui-icon-tag") + div(:add_a_template_title, class: 'oo-ui-processDialog-location', text: /Add a template/) + span(:add_template, text: 'Add template') + span(:basic_reference, class: 'oo-ui-iconElement-icon oo-ui-icon-reference') + span(:bullet_number_selector, class: 'oo-ui-iconElement-icon oo-ui-icon-bullet-list') + span(:category_link, class: 'oo-ui-iconElement-icon oo-ui-icon-tag') text_area(:cite_first_textarea, index: 0) text_area(:cite_second_textarea, index: 1) text_area(:cite_third_textarea, index: 2) @@ -16,159 +16,159 @@ text_area(:cite_sixth_textarea, index: 5) text_area(:cite_seventh_textarea, index: 6) text_area(:cite_eighth_textarea, index: 7) - a(:cite_add_more_information_button, css: ".ve-ui-mwParameterPage-more a", index: 7) - div(:cite_basic_options_area, class: "oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout") - span(:cite_basic_reference, css: ".oo-ui-icon-reference") - a(:cite_book, css: ".oo-ui-tool-name-cite-book > a:nth-child(1)") - span(:cite_button, text: "Cite") - text_field(:cite_custom_field_name, css: ".oo-ui-searchWidget-query > div:nth-child(1) > input:nth-child(1)") - div(:cite_group_name_textarea, class: "oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-indicatorElement oo-ui-textInputWidget") - a(:cite_journal, css: ".oo-ui-tool-name-cite-journal > a:nth-child(1)") - span(:cite_menu, class: "oo-ui-popupToolGroup-handle", index: 2) - div(:cite_new_field_label, css: ".oo-ui-optionWidget") - text_area(:cite_new_website_field, css: "div.oo-ui-layout:nth-child(10) > div:nth-child(3) > div:nth-child(1) > textarea:nth-child(1)") - a(:cite_news, css: ".oo-ui-tool-name-cite-news > a:nth-child(1)") - div(:cite_pull_down, class: "oo-ui-toolGroup-tools oo-ui-clippableElement-clippable", index: 2) - div(:cite_select, css: "div.oo-ui-widget:nth-child(5) > div:nth-child(2)") - div(:cite_show_more_fields, class: "ve-ui-mwMoreParametersResultWidget-label") - div(:cite_ui, class: "oo-ui-window-body") - div(:cite_visualeditor_user_interface, css: ".ve-ui-surfaceWidget") - span(:cite_website, css: ".oo-ui-icon-ref-cite-web") - span(:confirm_switch, text: "Keep changes") - span(:confirm_switch_cancel, text: "Resume editing") - span(:confirm_switch_cancel_on_switch, text: "Cancel") - span(:confirm_switch_discard, text: "Discard changes") - div(:content, class: "ve-ce-branchNode") - span(:decrease_indentation, class: "oo-ui-iconElement-icon oo-ui-icon-outdent-list") + a(:cite_add_more_information_button, css: '.ve-ui-mwParameterPage-more a', index: 7) + div(:cite_basic_options_area, class: 'oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout') + span(:cite_basic_reference, css: '.oo-ui-icon-reference') + a(:cite_book, css: '.oo-ui-tool-name-cite-book > a:nth-child(1)') + span(:cite_button, text: 'Cite') + text_field(:cite_custom_field_name, css: '.oo-ui-searchWidget-query > div:nth-child(1) > input:nth-child(1)') + div(:cite_group_name_textarea, class: 'oo-ui-widget oo-ui-widget-enabled oo-ui-inputWidget oo-ui-indicatorElement oo-ui-textInputWidget') + a(:cite_journal, css: '.oo-ui-tool-name-cite-journal > a:nth-child(1)') + span(:cite_menu, class: 'oo-ui-popupToolGroup-handle', index: 2) + div(:cite_new_field_label, css: '.oo-ui-optionWidget') + text_area(:cite_new_website_field, css: 'div.oo-ui-layout:nth-child(10) > div:nth-child(3) > div:nth-child(1) > textarea:nth-child(1)') + a(:cite_news, css: '.oo-ui-tool-name-cite-news > a:nth-child(1)') + div(:cite_pull_down, class: 'oo-ui-toolGroup-tools oo-ui-clippableElement-clippable', index: 2) + div(:cite_select, css: 'div.oo-ui-widget:nth-child(5) > div:nth-child(2)') + div(:cite_show_more_fields, class: 've-ui-mwMoreParametersResultWidget-label') + div(:cite_ui, class: 'oo-ui-window-body') + div(:cite_visualeditor_user_interface, css: '.ve-ui-surfaceWidget') + span(:cite_website, css: '.oo-ui-icon-ref-cite-web') + span(:confirm_switch, text: 'Keep changes') + span(:confirm_switch_cancel, text: 'Resume editing') + span(:confirm_switch_cancel_on_switch, text: 'Cancel') + span(:confirm_switch_discard, text: 'Discard changes') + div(:content, class: 've-ce-branchNode') + span(:decrease_indentation, class: 'oo-ui-iconElement-icon oo-ui-icon-outdent-list') text_area(:describe_change, index: 0) - div(:diff_view, class: "ve-ui-mwSaveDialog-viewer") - div(:disabled_save_button, class: "oo-ui-widget oo-ui-widget-disabled oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-labelElement oo-ui-flaggedElement-constructive oo-ui-buttonWidget ve-ui-toolbar-saveButton") - span(:downarrow, class: "oo-ui-indicatorElement-indicator oo-ui-indicator-down") + div(:diff_view, class: 've-ui-mwSaveDialog-viewer') + div(:disabled_save_button, class: 'oo-ui-widget oo-ui-widget-disabled oo-ui-buttonElement oo-ui-buttonElement-framed oo-ui-labelElement oo-ui-flaggedElement-constructive oo-ui-buttonWidget ve-ui-toolbar-saveButton') + span(:downarrow, class: 'oo-ui-indicatorElement-indicator oo-ui-indicator-down') a(:edit_ve, title: /Edit this page with VisualEditor/) a(:edit_wikitext, title: /You can edit this page\./) - span(:ex, text: "Return to save form") - a(:first_reference, text: "[1]", index: 1) - div(:formatting_option_menus, class: "oo-ui-toolGroup-tools oo-ui-clippableElement-clippable", index: 1) - img(:formula_image, class: "mwe-math-fallback-png-inline") - span(:formula_insert_menu,class: "oo-ui-tool-name-math") - a(:formula_link, css: "span.oo-ui-tool-name-math > a.oo-ui-tool-link") + span(:ex, text: 'Return to save form') + a(:first_reference, text: '[1]', index: 1) + div(:formatting_option_menus, class: 'oo-ui-toolGroup-tools oo-ui-clippableElement-clippable', index: 1) + img(:formula_image, class: 'mwe-math-fallback-png-inline') + span(:formula_insert_menu,class: 'oo-ui-tool-name-math') + a(:formula_link, css: 'span.oo-ui-tool-name-math > a.oo-ui-tool-link') a(:heading, text: /Heading/) - span(:hamburger_menu, css: "div.oo-ui-listToolGroup:nth-child(2) > span:nth-child(1) > span:nth-child(3)") - div(:heading_dropdown_menus, class: "oo-ui-toolGroup-tools oo-ui-clippableElement-clippable") - div(:iframe, css: "div.oo-ui-window-setup > div.oo-ui-window-frame") - span(:increase_indentation, class: "oo-ui-iconElement-icon oo-ui-icon-indent-list") - div(:indentation_pull_down, class: "oo-ui-toolGroup-tools oo-ui-clippableElement-clippable", index: 3) - span(:insert_citation, css: ".oo-ui-flaggedElement-primary > a:nth-child(1) > span:nth-child(2)") - span(:insert_menu, class: "oo-ui-popupToolGroup-handle", index: 5) - div(:insert_pull_down, class: "oo-ui-toolGroup-tools oo-ui-clippableElement-clippable", index: 5) - div(:insert_references, class: "oo-ui-processDialog-location") - span(:insert_references_list, text: "Insert") - span(:insert_template, text: "Insert") - a(:internal_link, class: "ve-ce-linkAnnotation ve-ce-mwInternalLinkAnnotation") - div(:ip_warning, class: "ve-ui-mwNoticesPopupTool-item", text: /Your IP address/) - div(:language_notification, class: "tipsy-inner") - div(:left_navigation, id: "left-navigation") + span(:hamburger_menu, css: 'div.oo-ui-listToolGroup:nth-child(2) > span:nth-child(1) > span:nth-child(3)') + div(:heading_dropdown_menus, class: 'oo-ui-toolGroup-tools oo-ui-clippableElement-clippable') + div(:iframe, css: 'div.oo-ui-window-setup > div.oo-ui-window-frame') + span(:increase_indentation, class: 'oo-ui-iconElement-icon oo-ui-icon-indent-list') + div(:indentation_pull_down, class: 'oo-ui-toolGroup-tools oo-ui-clippableElement-clippable', index: 3) + span(:insert_citation, css: '.oo-ui-flaggedElement-primary > a:nth-child(1) > span:nth-child(2)') + span(:insert_menu, class: 'oo-ui-popupToolGroup-handle', index: 5) + div(:insert_pull_down, class: 'oo-ui-toolGroup-tools oo-ui-clippableElement-clippable', index: 5) + div(:insert_references, class: 'oo-ui-processDialog-location') + span(:insert_references_list, text: 'Insert') + span(:insert_template, text: 'Insert') + a(:internal_link, class: 've-ce-linkAnnotation ve-ce-mwInternalLinkAnnotation') + div(:ip_warning, class: 've-ui-mwNoticesPopupTool-item', text: /Your IP address/) + div(:language_notification, class: 'tipsy-inner') + div(:left_navigation, id: 'left-navigation') unordered_list(:link_list, class: 'oo-ui-widget oo-ui-widget-enabled oo-ui-selectWidget oo-ui-selectWidget-depressed oo-ui-clippableElement-clippable oo-ui-menuWidget oo-ui-textInputMenuWidget oo-ui-lookupWidget-menu ve-ui-mwLinkTargetInputWidget-menu') div(:link_overlay_does_not_exist, text: /New page/) div(:link_overlay_external_link, text: /External link.+New page/m) div(:link_overlay_wiki_page, text: /Matching page/) - span(:media_apply_changes, text: "Insert") - unordered_list(:media_caption, class: "ve-ui-contextMenuWidget") - span(:media_exit, text: "Return to save form") + span(:media_apply_changes, text: 'Insert') + unordered_list(:media_caption, class: 've-ui-contextMenuWidget') + span(:media_exit, text: 'Return to save form') figure(:media_image, index: 0) - span(:media_insert_menu, class: "oo-ui-tool-name-media") - text_field(:media_search, css: "div.oo-ui-textInputWidget > input") - div(:media_select, class: "ve-ui-mwMediaResultWidget-overlay") - div(:medium_dialog, class: "oo-ui-window oo-ui-dialog oo-ui-dialog-open oo-ui-dialog-medium") - checkbox(:minor_edit, id: "wpMinoredit") - div(:no_unused_fields, text: "No unused fields") - a(:new_link, class: "ve-ce-linkAnnotation ve-ce-mwInternalLinkAnnotation new") - span(:options_categories, class: "oo-ui-tool-title-text", text: "Categories") - span(:options_in_hamburger, class: "oo-ui-tool-title", text: "Options") - span(:option_advanced_settings, class: "oo-ui-tool-title", text: "Advanced settings") - span(:option_page_settings, class: "oo-ui-tool-title", text: "Page settings") - div(:options_page_title, class: "oo-ui-processDialog-location", text: "Options") - div(:options_settings_content_advanced, class: "oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout", text: /Advanced settings/) - div(:options_settings_content_categories, class: "oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout", text: /Categories/) - div(:options_settings_content_page_settings, class: "oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout", text: /Page settings/) - div(:page_option_menu, class: "oo-ui-toolGroup-tools oo-ui-clippableElement-clippable", index: 6) - span(:page_settings, class: "oo-ui-iconElement-icon oo-ui-icon-settings") - label(:page_settings_editlinks, class: "oo-ui-layout oo-ui-labelElement oo-ui-fieldLayout oo-ui-fieldLayout-align-inline", index: 4) - span(:page_settings_icon, class: "oo-ui-iconElement-icon oo-ui-icon-settings", index: 2) - div(:page_text, id: "mw-content-text") + span(:media_insert_menu, class: 'oo-ui-tool-name-media') + text_field(:media_search, css: 'div.oo-ui-textInputWidget > input') + div(:media_select, class: 've-ui-mwMediaResultWidget-overlay') + div(:medium_dialog, class: 'oo-ui-window oo-ui-dialog oo-ui-dialog-open oo-ui-dialog-medium') + checkbox(:minor_edit, id: 'wpMinoredit') + div(:no_unused_fields, text: 'No unused fields') + a(:new_link, class: 've-ce-linkAnnotation ve-ce-mwInternalLinkAnnotation new') + span(:options_categories, class: 'oo-ui-tool-title-text', text: 'Categories') + span(:options_in_hamburger, class: 'oo-ui-tool-title', text: 'Options') + span(:option_advanced_settings, class: 'oo-ui-tool-title', text: 'Advanced settings') + span(:option_page_settings, class: 'oo-ui-tool-title', text: 'Page settings') + div(:options_page_title, class: 'oo-ui-processDialog-location', text: 'Options') + div(:options_settings_content_advanced, class: 'oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout', text: /Advanced settings/) + div(:options_settings_content_categories, class: 'oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout', text: /Categories/) + div(:options_settings_content_page_settings, class: 'oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout', text: /Page settings/) + div(:page_option_menu, class: 'oo-ui-toolGroup-tools oo-ui-clippableElement-clippable', index: 6) + span(:page_settings, class: 'oo-ui-iconElement-icon oo-ui-icon-settings') + label(:page_settings_editlinks, class: 'oo-ui-layout oo-ui-labelElement oo-ui-fieldLayout oo-ui-fieldLayout-align-inline', index: 4) + span(:page_settings_icon, class: 'oo-ui-iconElement-icon oo-ui-icon-settings', index: 2) + div(:page_text, id: 'mw-content-text') a(:page_title, text: /Page title/) a(:paragraph, text: /Paragraph/) - div(:parameter_icon, text: "q") - unordered_list(:popup_icon, class: "ve-ui-contextMenuWidget") + div(:parameter_icon, text: 'q') + unordered_list(:popup_icon, class: 've-ui-contextMenuWidget') a(:preformatted, text: /Preformatted/) - label(:prevent_redirect, class: "oo-ui-layout oo-ui-labelElement oo-ui-fieldLayout oo-ui-fieldLayout-align-inline oo-ui-fieldLayout-disabled") - span(:ref_list_insert_menu, class: "oo-ui-tool-name-referencesList") - span(:refs_link, text: "Reference") - div(:references_title, class: "oo-ui-processDialog-location", text: /References/) - a(:remove_parameter, css: ".ve-ui-mwParameterPage-removeButton > a:nth-child(1)") - span(:return_to_save, class: "oo-ui-labelElement-label", text: "Return to save form") - span(:review_changes, class: "oo-ui-labelElement-label", text: "Review your changes") - span(:review_failed, text: "No changes to review") - div(:right_navigation, id: "p-views") - div(:save_disabled, class: "oo-ui-widget oo-ui-widget-disabled oo-ui-flaggedElement-constructive oo-ui-.oo-ui-buttonElement-framed") - a(:save_page, css: "div.ve-init-mw-viewPageTarget-toolbar-actions > div.oo-ui-flaggedElement-constructive > a") - div(:save_enabled, css: "div.ve-init-mw-viewPageTarget-toolbar-actions > div.oo-ui-flaggedElement-constructive.oo-ui-widget-enabled") - a(:second_reference, text: "[1]", index: 2) - span(:second_save_page, css: ".oo-ui-flaggedElement-primary > a:nth-child(1) > span:nth-child(2)") - div(:settings_apply_button, class: "oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-labelElement oo-ui-flaggedElement-primary oo-ui-buttonWidget oo-ui-actionWidget oo-ui-buttonElement-framed") - span(:special_character, class: "oo-ui-iconElement-icon oo-ui-icon-special-character") + label(:prevent_redirect, class: 'oo-ui-layout oo-ui-labelElement oo-ui-fieldLayout oo-ui-fieldLayout-align-inline oo-ui-fieldLayout-disabled') + span(:ref_list_insert_menu, class: 'oo-ui-tool-name-referencesList') + span(:refs_link, text: 'Reference') + div(:references_title, class: 'oo-ui-processDialog-location', text: /References/) + a(:remove_parameter, css: '.ve-ui-mwParameterPage-removeButton > a:nth-child(1)') + span(:return_to_save, class: 'oo-ui-labelElement-label', text: 'Return to save form') + span(:review_changes, class: 'oo-ui-labelElement-label', text: 'Review your changes') + span(:review_failed, text: 'No changes to review') + div(:right_navigation, id: 'p-views') + div(:save_disabled, class: 'oo-ui-widget oo-ui-widget-disabled oo-ui-flaggedElement-constructive oo-ui-.oo-ui-buttonElement-framed') + a(:save_page, css: 'div.ve-init-mw-viewPageTarget-toolbar-actions > div.oo-ui-flaggedElement-constructive > a') + div(:save_enabled, css: 'div.ve-init-mw-viewPageTarget-toolbar-actions > div.oo-ui-flaggedElement-constructive.oo-ui-widget-enabled') + a(:second_reference, text: '[1]', index: 2) + span(:second_save_page, css: '.oo-ui-flaggedElement-primary > a:nth-child(1) > span:nth-child(2)') + div(:settings_apply_button, class: 'oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-labelElement oo-ui-flaggedElement-primary oo-ui-buttonWidget oo-ui-actionWidget oo-ui-buttonElement-framed') + span(:special_character, class: 'oo-ui-iconElement-icon oo-ui-icon-special-character') a(:subheading1, text: /Sub-heading 1/) a(:subheading2, text: /Sub-heading 2/) a(:subheading3, text: /Sub-heading 3/) a(:subheading4, text: /Sub-heading 4/) - span(:switch_to_source_editing, class: "oo-ui-iconElement-icon oo-ui-icon-source") - label(:table_of_contents, class: "oo-ui-layout oo-ui-labelElement oo-ui-fieldLayout oo-ui-fieldLayout-align-top", index: 1) - span(:template_insert_menu, class: "oo-ui-tool-name-transclusion") - div(:toolbar, class: "ve-init-mw-viewPageTarget-toolbar") - div(:toolbar_actions, class: "oo-ui-toolbar-actions") - if ENV["BROWSER"] == "chrome" - div(:tools_menu, class: "oo-ui-widget oo-ui-widget-enabled oo-ui-toolGroup oo-ui-iconElement oo-ui-popupToolGroup oo-ui-listToolGroup") + span(:switch_to_source_editing, class: 'oo-ui-iconElement-icon oo-ui-icon-source') + label(:table_of_contents, class: 'oo-ui-layout oo-ui-labelElement oo-ui-fieldLayout oo-ui-fieldLayout-align-top', index: 1) + span(:template_insert_menu, class: 'oo-ui-tool-name-transclusion') + div(:toolbar, class: 've-init-mw-viewPageTarget-toolbar') + div(:toolbar_actions, class: 'oo-ui-toolbar-actions') + if ENV['BROWSER'] == 'chrome' + div(:tools_menu, class: 'oo-ui-widget oo-ui-widget-enabled oo-ui-toolGroup oo-ui-iconElement oo-ui-popupToolGroup oo-ui-listToolGroup') else - span(:tools_menu, class: "oo-ui-iconElement-icon oo-ui-icon-menu") + span(:tools_menu, class: 'oo-ui-iconElement-icon oo-ui-icon-menu') end - a(:transclusion, css: "span.oo-ui-widget.oo-ui-iconElement.oo-ui-tool.oo-ui-tool-name-transclusion.oo-ui-widget-enabled > a") - text_field(:transclusion_description, css: ".oo-ui-inputWidget > input:nth-child(1)") - text_field(:transclusion_textfield, css: "div.oo-ui-widget-enabled:nth-child(4) > input:nth-child(1)") - span(:ve_bold_text, class: "oo-ui-iconElement-icon oo-ui-icon-bold-b") - span(:ve_bullets, class: "oo-ui-iconElement-icon oo-ui-icon-bullet-list", index: 1) - span(:ve_computer_code, class: "oo-ui-iconElement-icon oo-ui-icon-code") - div(:ve_heading_menu, class: "oo-ui-iconElement-icon oo-ui-icon-down") - span(:ve_italics, class: "oo-ui-iconElement-icon oo-ui-icon-italic-i") - span(:ve_link_icon, class: "oo-ui-iconElement-icon oo-ui-icon-link") - span(:ve_media_menu, class: "oo-ui-iconElement-icon oo-ui-icon-picture") - span(:ve_more_markup_options, css: "span.oo-ui-tool-name-more-fewer:nth-child(10) > a:nth-child(1) > span:nth-child(2) > span:nth-child(1)") - a(:ve_more_references_options, css: "span.oo-ui-tool-name-more-fewer:nth-child(9) > a:nth-child(1)") - span(:ve_numbering, class: "oo-ui-iconElement-icon oo-ui-icon-number-list") - span(:ve_references, class: "oo-ui-iconElement-icon oo-ui-icon-references") - span(:ve_strikethrough, class: "oo-ui-iconElement-icon oo-ui-icon-strikethrough-s") - span(:ve_subscript, class: "oo-ui-iconElement-icon oo-ui-icon-subscript") - span(:ve_superscript, class: "oo-ui-iconElement-icon oo-ui-icon-superscript") - span(:ve_text_style, class: "oo-ui-iconElement-icon oo-ui-icon-text-style") - span(:ve_underline, class: "oo-ui-iconElement-icon oo-ui-icon-underline-u") - div(:visual_editor_toolbar, class: "oo-ui-toolbar-tools") - text_area(:wikitext_editor, id: "wpTextbox1") + a(:transclusion, css: 'span.oo-ui-widget.oo-ui-iconElement.oo-ui-tool.oo-ui-tool-name-transclusion.oo-ui-widget-enabled > a') + text_field(:transclusion_description, css: '.oo-ui-inputWidget > input:nth-child(1)') + text_field(:transclusion_textfield, css: 'div.oo-ui-widget-enabled:nth-child(4) > input:nth-child(1)') + span(:ve_bold_text, class: 'oo-ui-iconElement-icon oo-ui-icon-bold-b') + span(:ve_bullets, class: 'oo-ui-iconElement-icon oo-ui-icon-bullet-list', index: 1) + span(:ve_computer_code, class: 'oo-ui-iconElement-icon oo-ui-icon-code') + div(:ve_heading_menu, class: 'oo-ui-iconElement-icon oo-ui-icon-down') + span(:ve_italics, class: 'oo-ui-iconElement-icon oo-ui-icon-italic-i') + span(:ve_link_icon, class: 'oo-ui-iconElement-icon oo-ui-icon-link') + span(:ve_media_menu, class: 'oo-ui-iconElement-icon oo-ui-icon-picture') + span(:ve_more_markup_options, css: 'span.oo-ui-tool-name-more-fewer:nth-child(10) > a:nth-child(1) > span:nth-child(2) > span:nth-child(1)') + a(:ve_more_references_options, css: 'span.oo-ui-tool-name-more-fewer:nth-child(9) > a:nth-child(1)') + span(:ve_numbering, class: 'oo-ui-iconElement-icon oo-ui-icon-number-list') + span(:ve_references, class: 'oo-ui-iconElement-icon oo-ui-icon-references') + span(:ve_strikethrough, class: 'oo-ui-iconElement-icon oo-ui-icon-strikethrough-s') + span(:ve_subscript, class: 'oo-ui-iconElement-icon oo-ui-icon-subscript') + span(:ve_superscript, class: 'oo-ui-iconElement-icon oo-ui-icon-superscript') + span(:ve_text_style, class: 'oo-ui-iconElement-icon oo-ui-icon-text-style') + span(:ve_underline, class: 'oo-ui-iconElement-icon oo-ui-icon-underline-u') + div(:visual_editor_toolbar, class: 'oo-ui-toolbar-tools') + text_area(:wikitext_editor, id: 'wpTextbox1') in_iframe(index: 0) do |frame| - div(:extension_reference, class: "ve-ui-mwReferenceResultWidget-shield", frame: frame) - span(:existing_reference, text: "Use an existing reference", frame: frame) - a(:remove_template, title: "Remove template", frame: frame) - div(:ve_link_ui, class: "oo-ui-window-head", text: /Link/, frame: frame) - div(:suggestion_list, class: "ve-ui-mwTitleInputWidget-menu") - span(:another_save_page, class: "oo-ui-labelElement-label", text: "Save page", frame: frame) + div(:extension_reference, class: 've-ui-mwReferenceResultWidget-shield', frame: frame) + span(:existing_reference, text: 'Use an existing reference', frame: frame) + a(:remove_template, title: 'Remove template', frame: frame) + div(:ve_link_ui, class: 'oo-ui-window-head', text: /Link/, frame: frame) + div(:suggestion_list, class: 've-ui-mwTitleInputWidget-menu') + span(:another_save_page, class: 'oo-ui-labelElement-label', text: 'Save page', frame: frame) text_field(:link_textfield, index: 0, frame: frame) - span(:links_done, text: "Done", frame: frame) - div(:content_box, class: "ve-ce-documentNode ve-ce-branchNode", frame: frame) #ALSO USED IN LANGUAGE SCREENSHOT + span(:links_done, text: 'Done', frame: frame) + div(:content_box, class: 've-ce-documentNode ve-ce-branchNode', frame: frame) #ALSO USED IN LANGUAGE SCREENSHOT #USED IN LANGUAGE SCREENSHOT TEST: - text_field(:media_alternative_text, css: "div.oo-ui-widget.oo-ui-widget-enabled.oo-ui-inputWidget.oo-ui-textInputWidget.ve-ui-mwMediaDialog-altText > input", frame: frame) - div(:media_alternative_block, class: "oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout", index: 1, frame: frame) - list_item(:media_advanced_settings, class: "oo-ui-widget oo-ui-widget-enabled oo-ui-optionWidget oo-ui-decoratedOptionWidget oo-ui-outlineItemWidget oo-ui-outlineItemWidget-level-0 oo-ui-iconElement oo-ui-labelElement", frame: frame) - a(:insert_media, css: "div.oo-ui-processDialog-actions-primary > div.oo-ui-buttonElement-frameless > a", frame: frame) - text_area(:formula_area, class: "oo-ui-ltr", frame: frame) + text_field(:media_alternative_text, css: 'div.oo-ui-widget.oo-ui-widget-enabled.oo-ui-inputWidget.oo-ui-textInputWidget.ve-ui-mwMediaDialog-altText > input', frame: frame) + div(:media_alternative_block, class: 'oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout', index: 1, frame: frame) + list_item(:media_advanced_settings, class: 'oo-ui-widget oo-ui-widget-enabled oo-ui-optionWidget oo-ui-decoratedOptionWidget oo-ui-outlineItemWidget oo-ui-outlineItemWidget-level-0 oo-ui-iconElement oo-ui-labelElement', frame: frame) + a(:insert_media, css: 'div.oo-ui-processDialog-actions-primary > div.oo-ui-buttonElement-frameless > a', frame: frame) + text_area(:formula_area, class: 'oo-ui-ltr', frame: frame) end end diff --git a/modules/ve-mw/tests/browser/features/support/pages/zarticlepage.rb b/modules/ve-mw/tests/browser/features/support/pages/zarticlepage.rb index cedd007..ed379ff 100644 --- a/modules/ve-mw/tests/browser/features/support/pages/zarticlepage.rb +++ b/modules/ve-mw/tests/browser/features/support/pages/zarticlepage.rb @@ -1,5 +1,5 @@ class ZtargetPage < VisualEditorPage include URL - page_url URL.url("<%=params[:article_name]%>?vehidebetadialog=true&veaction=edit") + page_url URL.url('<%=params[:article_name]%>?vehidebetadialog=true&veaction=edit') include PageObject end diff --git a/modules/ve-mw/tests/browser/spec/rectangle_spec.rb b/modules/ve-mw/tests/browser/spec/rectangle_spec.rb index 0639821..42ae8ac 100644 --- a/modules/ve-mw/tests/browser/spec/rectangle_spec.rb +++ b/modules/ve-mw/tests/browser/spec/rectangle_spec.rb @@ -1,14 +1,14 @@ require_relative '../features/support/language_screenshot' # Rectangle is defined as set of co-ordinates represented by top left x, top left y, width, height -describe "Rectangle" do - it "should return the co-ordinates of provided 1 rectangle" do +describe 'Rectangle' do + it 'should return the co-ordinates of provided 1 rectangle' do input_rectangle = [0,0,1,1] input_rectangles = [input_rectangle] expect(rectangle(input_rectangles)).to eq(input_rectangle) end - it "should return the co-ordinates of the rectangle which is inside a iframe" do + it 'should return the co-ordinates of the rectangle which is inside a iframe' do input_rectangle = [50,50,10,10] iframe_rectangle = [100,100,20,20] input_rectangles = [input_rectangle] @@ -16,14 +16,14 @@ expect(rectangle(input_rectangles, iframe_rectangle)).to eq(output_rectangle) end - it "if we provide 2 rectangles and if one contains the other then it should return co-ordinates of bigger rectangle" do + it 'if we provide 2 rectangles and if one contains the other then it should return co-ordinates of bigger rectangle' do input_rectangle_1 = [0,0,1,1] input_rectangle_2 = [0,0,2,2] input_rectangles = [input_rectangle_1, input_rectangle_2] expect(rectangle(input_rectangles)).to eq(input_rectangle_2) end - it "if we provide 2 rectangles it should return co-ordinates of third rectangle which contains both" do + it 'if we provide 2 rectangles it should return co-ordinates of third rectangle which contains both' do input_rectangle_1 = [0,0,1,1] input_rectangle_2 = [1,0,1,1] input_rectangles_1 = [input_rectangle_1, input_rectangle_2] @@ -37,7 +37,7 @@ expect(rectangle(input_rectangles_2)).to eq(output_rectangle_2) end - it "if we provide 3 rectangles it should return co-ordinates the rectangle which contains all the input rectangles" do + it 'if we provide 3 rectangles it should return co-ordinates the rectangle which contains all the input rectangles' do input_rectangle_1 = [1,1,1,1] input_rectangle_2 = [2,2,1,1] input_rectangle_3 = [3,3,1,1] @@ -47,16 +47,16 @@ end end -describe "Calculate topleft co-ordinates" do +describe 'Calculate topleft co-ordinates' do - it "if we provide 1 rectangle then it should return top left co-ordinates of the input rectangle" do + it 'if we provide 1 rectangle then it should return top left co-ordinates of the input rectangle' do input_rectangle = [2,2,1,1] input_rectangles = [input_rectangle] output_coordinates = [2,2] expect(top_left_x_y(input_rectangles)).to eq(output_coordinates) end - it "if we provide 2 rectangles then it should return top left co-ordinates of the biggest rectangle containing both rectangles" do + it 'if we provide 2 rectangles then it should return top left co-ordinates of the biggest rectangle containing both rectangles' do input_rectangle_1 = [1,0,1,1] input_rectangle_2 = [0,0,1,1] input_rectangles = [input_rectangle_1, input_rectangle_2] @@ -64,7 +64,7 @@ expect(top_left_x_y(input_rectangles)).to eq(output_coordinates) end - it "if we provide 3 rectangles then it should return top left co-ordinates of the biggest rectangle containing both rectangles" do + it 'if we provide 3 rectangles then it should return top left co-ordinates of the biggest rectangle containing both rectangles' do input_rectangle_1 = [3,3,1,1] input_rectangle_2 = [2,2,1,1] input_rectangle_3 = [1,1,1,1] @@ -75,16 +75,16 @@ end -describe "Topleft co-ordinates x" do +describe 'Topleft co-ordinates x' do - it "if we provide 1 rectangle then it should return array of top left x co-ordinate of the input rectangle" do + it 'if we provide 1 rectangle then it should return array of top left x co-ordinate of the input rectangle' do input_rectangle = [2,2,1,1] input_rectangles = [input_rectangle] output_coordinates = [2] expect(top_left_x_coordinates(input_rectangles)).to eq(output_coordinates) end - it "if we provide 2 rectangles then it should return array top left x co-ordinates" do + it 'if we provide 2 rectangles then it should return array top left x co-ordinates' do input_rectangle_1 = [0,0,1,1] input_rectangle_2 = [1,0,1,1] input_rectangles = [input_rectangle_1, input_rectangle_2] @@ -92,7 +92,7 @@ expect(top_left_x_coordinates(input_rectangles)).to eq(output_coordinates) end - it "if we provide 3 rectangles then it should return array of top left x co-ordinates" do + it 'if we provide 3 rectangles then it should return array of top left x co-ordinates' do input_rectangle_1 = [3,3,1,1] input_rectangle_2 = [2,2,1,1] input_rectangle_3 = [1,1,1,1] @@ -103,16 +103,16 @@ end -describe "Topleft co-ordinates y" do +describe 'Topleft co-ordinates y' do - it "if we provide 1 rectangle then it should return array of top left y co-ordinate of the input rectangle" do + it 'if we provide 1 rectangle then it should return array of top left y co-ordinate of the input rectangle' do input_rectangle = [2,2,1,1] input_rectangles = [input_rectangle] output_coordinates = [2] expect(top_left_y_coordinates(input_rectangles)).to eq(output_coordinates) end - it "if we provide 2 rectangles then it should return array top left y co-ordinates" do + it 'if we provide 2 rectangles then it should return array top left y co-ordinates' do input_rectangle_1 = [0,0,1,1] input_rectangle_2 = [1,0,1,1] input_rectangles = [input_rectangle_1, input_rectangle_2] @@ -120,7 +120,7 @@ expect(top_left_y_coordinates(input_rectangles)).to eq(output_coordinates) end - it "if we provide 3 rectangles then it should return array of top left y co-ordinates" do + it 'if we provide 3 rectangles then it should return array of top left y co-ordinates' do input_rectangle_1 = [3,3,1,1] input_rectangle_2 = [2,2,1,1] input_rectangle_3 = [1,1,1,1] @@ -131,16 +131,16 @@ end -describe "Calculate bottomright co-ordinates" do +describe 'Calculate bottomright co-ordinates' do - it "if we provide 1 rectangle then it should return bottom right co-ordinates of the input rectangle" do + it 'if we provide 1 rectangle then it should return bottom right co-ordinates of the input rectangle' do input_rectangle = [2,2,1,1] input_rectangles = [input_rectangle] output_coordinates = [3,3] expect(bottom_right_x_y(input_rectangles)).to eq(output_coordinates) end - it "if we provide 2 rectangles then it should return bottom right co-ordinates of the biggest rectangle containing both rectangles" do + it 'if we provide 2 rectangles then it should return bottom right co-ordinates of the biggest rectangle containing both rectangles' do input_rectangle_1 = [1,0,1,1] input_rectangle_2 = [0,0,1,1] input_rectangles = [input_rectangle_1, input_rectangle_2] @@ -148,7 +148,7 @@ expect(bottom_right_x_y(input_rectangles)).to eq(output_coordinates) end - it "if we provide 3 rectangles then it should return bottom right co-ordinates of the biggest rectangle containing both rectangles" do + it 'if we provide 3 rectangles then it should return bottom right co-ordinates of the biggest rectangle containing both rectangles' do input_rectangle_1 = [3,3,1,1] input_rectangle_2 = [2,2,1,1] input_rectangle_3 = [1,1,1,1] @@ -159,16 +159,16 @@ end -describe "Bottom right co-ordinates x" do +describe 'Bottom right co-ordinates x' do - it "if we provide 1 rectangle then it should return array of bottom right x co-ordinate of the input rectangle" do + it 'if we provide 1 rectangle then it should return array of bottom right x co-ordinate of the input rectangle' do input_rectangle = [2,2,1,1] input_rectangles = [input_rectangle] output_coordinates = [3] expect(bottom_right_x_coordinates(input_rectangles)).to eq(output_coordinates) end - it "if we provide 2 rectangles then it should return array bottom right x co-ordinates" do + it 'if we provide 2 rectangles then it should return array bottom right x co-ordinates' do input_rectangle_1 = [0,0,1,1] input_rectangle_2 = [1,0,1,1] input_rectangles = [input_rectangle_1, input_rectangle_2] @@ -176,7 +176,7 @@ expect(bottom_right_x_coordinates(input_rectangles)).to eq(output_coordinates) end - it "if we provide 3 rectangles then it should return array of bottom right x co-ordinates" do + it 'if we provide 3 rectangles then it should return array of bottom right x co-ordinates' do input_rectangle_1 = [3,3,1,1] input_rectangle_2 = [2,2,1,1] input_rectangle_3 = [1,1,1,1] @@ -187,16 +187,16 @@ end -describe "Bottom right co-ordinates y" do +describe 'Bottom right co-ordinates y' do - it "if we provide 1 rectangle then it should return array of bottom right y co-ordinate of the input rectangle" do + it 'if we provide 1 rectangle then it should return array of bottom right y co-ordinate of the input rectangle' do input_rectangle = [2,2,1,1] input_rectangles = [input_rectangle] output_coordinates = [3] expect(bottom_right_y_coordinates(input_rectangles)).to eq(output_coordinates) end - it "if we provide 2 rectangles then it should return array bottom right y co-ordinates" do + it 'if we provide 2 rectangles then it should return array bottom right y co-ordinates' do input_rectangle_1 = [0,0,1,1] input_rectangle_2 = [1,0,1,1] input_rectangles = [input_rectangle_1, input_rectangle_2] @@ -204,7 +204,7 @@ expect(bottom_right_y_coordinates(input_rectangles)).to eq(output_coordinates) end - it "if we provide 3 rectangles then it should return array of bottom right y co-ordinates" do + it 'if we provide 3 rectangles then it should return array of bottom right y co-ordinates' do input_rectangle_1 = [3,3,1,1] input_rectangle_2 = [2,2,1,1] input_rectangle_3 = [1,1,1,1] diff --git a/modules/ve-mw/tests/browser/upload.rb b/modules/ve-mw/tests/browser/upload.rb index 4be73c8..390bc10 100644 --- a/modules/ve-mw/tests/browser/upload.rb +++ b/modules/ve-mw/tests/browser/upload.rb @@ -1,5 +1,5 @@ def license(language_code, file_name) - require "date" + require 'date' date = Date.today.to_s "=={{int:filedesc}}== {{Information @@ -20,7 +20,7 @@ def upload_image(file_path, client) language_code = ENV['LANGUAGE_SCREENSHOT_CODE'] - file_name = File.basename(file_path, "") + file_name = File.basename(file_path, '') file_license = license(language_code, file_name) client.upload_image(file_name, file_path, file_license, true) @@ -28,15 +28,15 @@ end def upload_images - screenshot_directory = ENV["LANGUAGE_SCREENSHOT_PATH"] || "./screenshots" + screenshot_directory = ENV['LANGUAGE_SCREENSHOT_PATH'] || './screenshots' require 'mediawiki_api' - client = MediawikiApi::Client.new ENV["MEDIAWIKI_API_UPLOAD_URL"] - client.log_in ENV["MEDIAWIKI_USER"], ENV["MEDIAWIKI_PASSWORD"] + client = MediawikiApi::Client.new ENV['MEDIAWIKI_API_UPLOAD_URL'] + client.log_in ENV['MEDIAWIKI_USER'], ENV['MEDIAWIKI_PASSWORD'] Dir["#{screenshot_directory}/*.png"].each do |file_path| puts "Uploading #{file_path}" upload_image file_path, client end end -ENV["MEDIAWIKI_PASSWORD"] = ENV[ENV["MEDIAWIKI_PASSWORD_VARIABLE"]] if ENV["MEDIAWIKI_PASSWORD_VARIABLE"] +ENV['MEDIAWIKI_PASSWORD'] = ENV[ENV['MEDIAWIKI_PASSWORD_VARIABLE']] if ENV['MEDIAWIKI_PASSWORD_VARIABLE'] upload_images -- To view, visit https://gerrit.wikimedia.org/r/174959 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0608aea2bd634156bf800b3be47a5c2a6d9fadca Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Cmcmahon <cmcma...@wikimedia.org> Gerrit-Reviewer: Zfilipin <zfili...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits