jenkins-bot has submitted this change and it was merged.
Change subject: [BrowserTest] Fix `ve.init is undefined` error messages in
Selenium tests
......................................................................
[BrowserTest] Fix `ve.init is undefined` error messages in Selenium tests
All scenarios that are passing are enabled to run in Jenkins.
(The commit increases the number of passing scenarios from 2 to 18.)
Bug: T126966
Change-Id: I9789ca42717133120197c4625bb8dad4ea496aa8
---
M .rubocop.yml
M .rubocop_todo.yml
M modules/ve-mw/tests/browser/features/bullets.feature
M modules/ve-mw/tests/browser/features/general_markup.feature
M modules/ve-mw/tests/browser/features/indent_outdent.feature
M modules/ve-mw/tests/browser/features/multiedit_workflow.feature
M modules/ve-mw/tests/browser/features/options.feature
M modules/ve-mw/tests/browser/features/support/pages/visual_editor_page.rb
8 files changed, 51 insertions(+), 18 deletions(-)
Approvals:
Ryasmeen: Looks good to me, approved
Jforrester: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/.rubocop.yml b/.rubocop.yml
index 3d08c55..c4d7615 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,7 +1,23 @@
inherit_from: .rubocop_todo.yml
-Metrics/ClassLength:
- Enabled: false
+AllCops:
+ StyleGuideCopsOnly: true
+
+# uncomment when the offense is fixed
+# 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
index eec07d6..26e59ec 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,20 +1,15 @@
# This configuration was generated by `rubocop --auto-gen-config`
-# on 2015-02-03 11:42:20 -0800 using RuboCop version 0.28.0.
+# on 2016-02-15 14:53:20 +0100 using RuboCop version 0.32.1.
# 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: 3
-Metrics/AbcSize:
- Max: 20
+# Offense count: 1
+Lint/HandleExceptions:
+ Enabled: false
-# Offense count: 490
+# Offense count: 56
# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
- Max: 3224
-
-# Offense count: 5
-# Configuration parameters: AllowedVariables.
-Style/GlobalVars:
- Enabled: false
+ Max: 398
diff --git a/modules/ve-mw/tests/browser/features/bullets.feature
b/modules/ve-mw/tests/browser/features/bullets.feature
index 969b551..5f1262f 100644
--- a/modules/ve-mw/tests/browser/features/bullets.feature
+++ b/modules/ve-mw/tests/browser/features/bullets.feature
@@ -4,6 +4,7 @@
Given I go to the "Bullets VisualEditor Test" page with content "Bullets
VisualEditor Test"
And I make the text "Bullets VisualEditor Test" be selected
+ @en.wikipedia.beta.wmflabs.org @firefox
Scenario Outline: check strings for bullets and numbering
When I click <control>
And I click Save page
@@ -29,6 +30,7 @@
| Numbering | ## |
| Bullets | ** |
+ @en.wikipedia.beta.wmflabs.org @firefox
Scenario Outline: check decrease indent for bullets and numbering
When I click <control>
And I click Decrease indentation
diff --git a/modules/ve-mw/tests/browser/features/general_markup.feature
b/modules/ve-mw/tests/browser/features/general_markup.feature
index 18e2376..a5b2764 100644
--- a/modules/ve-mw/tests/browser/features/general_markup.feature
+++ b/modules/ve-mw/tests/browser/features/general_markup.feature
@@ -16,7 +16,6 @@
| Bold | '''General Markup VisualEditor Test''' |
| Italics | ''General Markup VisualEditor Test'' |
-
Scenario Outline: VisualEditor more general markup
When I click the text style menu
And I click the More option
diff --git a/modules/ve-mw/tests/browser/features/indent_outdent.feature
b/modules/ve-mw/tests/browser/features/indent_outdent.feature
index 9095abb..10c9886 100644
--- a/modules/ve-mw/tests/browser/features/indent_outdent.feature
+++ b/modules/ve-mw/tests/browser/features/indent_outdent.feature
@@ -1,3 +1,4 @@
[email protected] @firefox
Feature: VisualEditor Indent, Outdent
Background:
diff --git a/modules/ve-mw/tests/browser/features/multiedit_workflow.feature
b/modules/ve-mw/tests/browser/features/multiedit_workflow.feature
index 222d923..17c6930 100644
--- a/modules/ve-mw/tests/browser/features/multiedit_workflow.feature
+++ b/modules/ve-mw/tests/browser/features/multiedit_workflow.feature
@@ -10,7 +10,8 @@
to test multiple page edits within a single session.
Scenario: Make multiple edits to the same article
- Given I enter and save the first edit
+ Given I am on the Multiple edits page
+ And I enter and save the first edit
And I enter and save a second edit
And I enter and save a third edit
Then the saved page should contain all three edits.
diff --git a/modules/ve-mw/tests/browser/features/options.feature
b/modules/ve-mw/tests/browser/features/options.feature
index cf194f4..836e795 100644
--- a/modules/ve-mw/tests/browser/features/options.feature
+++ b/modules/ve-mw/tests/browser/features/options.feature
@@ -5,20 +5,24 @@
And I click in the editable part
And I click the hamburger menu
+ @en.wikipedia.beta.wmflabs.org @firefox
Scenario: Options
When I click Options
Then I should see the options overlay
+ @en.wikipedia.beta.wmflabs.org @firefox
Scenario: Advanced Settings
When I click Advanced Settings
Then I should see the options overlay
And the options overlay should display Advanced Settings
+ @en.wikipedia.beta.wmflabs.org @firefox
Scenario: Page Settings
When I click Page Settings
Then I should see the options overlay
And the options overlay should display Page Settings
+ @en.wikipedia.beta.wmflabs.org @firefox
Scenario: Categories
When I click Categories
Then I should see the options overlay
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 cb7bea6..0917211 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
@@ -200,16 +200,31 @@
div(:media_alternative_block, class: 'oo-ui-layout oo-ui-iconElement
oo-ui-labelElement oo-ui-fieldsetLayout', index: 2)
div(:media_advanced_settings, class: 'oo-ui-outlineOptionWidget-level-0',
index: 1)
+ def visual_editor_element(script)
+ Timeout.timeout(5) do
+ loop do
+ begin
+ browser.execute_script script
+ rescue Selenium::WebDriver::Error::JavascriptError => e
+ else
+ e = nil
+ end
+ break unless e.class == Selenium::WebDriver::Error::JavascriptError
+ end
+ end
+ browser.execute_script script
+ end
+
def ve_bold_text_element
- @browser.execute_script('return
ve.init.target.getToolbar().items[2].tools.bold.$link[0]')
+ visual_editor_element('return
ve.init.target.getToolbar().items[2].tools.bold.$link[0]')
end
def ve_italics_element
- @browser.execute_script('return
ve.init.target.getToolbar().items[2].tools.italic.$link[0]')
+ visual_editor_element('return
ve.init.target.getToolbar().items[2].tools.italic.$link[0]')
end
def content_element
- @browser.execute_script('return
ve.init.target.surface.view.documentView.documentNode.$element[0]')
+ visual_editor_element('return
ve.init.target.surface.view.documentView.documentNode.$element[0]')
end
def tools_menu_element
--
To view, visit https://gerrit.wikimedia.org/r/270724
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9789ca42717133120197c4625bb8dad4ea496aa8
Gerrit-PatchSet: 9
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Zfilipin <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Dduvall <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Ryasmeen <[email protected]>
Gerrit-Reviewer: Zfilipin <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits