Merge "[BrowserTest] WIP adding cases to test other options under Page Settings to options.feature"

This commit is contained in:
jenkins-bot 2014-11-04 23:04:40 +00:00 committed by Gerrit Code Review
commit 309305b03e
5 changed files with 50 additions and 15 deletions

View file

@ -1 +1,4 @@
inherit_from: .rubocop_todo.yml
Metrics/ClassLength:
Enabled: false

View file

@ -23,11 +23,6 @@ Lint/ParenthesesAsGroupedExpression:
Lint/UnusedBlockArgument:
Enabled: false
# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 167
# Offense count: 185
# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:

View file

@ -1,9 +1,21 @@
@chrome @en.wikipedia.beta.wmflabs.org @firefox @internet_explorer_10 @safari @test2.wikipedia.org
Feature: VisualEditor Options
Scenario: Options
Background:
Given I go to the "Options VisualEditor Test" page with content "Options VisualEditor Test"
And I click in the editable part
When I click the hamburger menu
And I click Options
Then I should see the options overlay
And I click the hamburger menu
Scenario: Options
When I click Options
Then I should see the options overlay
Scenario: Advanced Settings
When I click Advanced Settings
Then I should see the options overlay
And the options overlay should display Advanced Settings
Scenario: Page Settings
When I click Page Settings
Then I should see the options overlay
And the options overlay should display Page Settings

View file

@ -1,12 +1,31 @@
When(/^I click the hamburger menu$/) do
on(VisualEditorPage).hamburger_menu_element.when_present.click
When(/^I click Advanced Settings$/) do
on(VisualEditorPage).option_advanced_settings_element.when_present.click
end
When(/^I click Options$/) do
on(VisualEditorPage).options_in_hamburger_element.when_present.click
end
Then(/^I should see the options overlay$/) do
on(VisualEditorPage).options_page_title_element.when_present.should be_visible
When(/^I click Page Settings$/) do
on(VisualEditorPage).option_page_settings_element.when_present.click
end
When(/^I click the hamburger menu$/) do
on(VisualEditorPage).hamburger_menu_element.when_present.click
end
When(/^I see options overlay$/) do
on(VisualEditorPage).options_page_title_element.when_present
end
Then(/^I should see the options overlay$/) do
expect(on(VisualEditorPage).options_page_title_element.when_present).to be_visible
end
Then(/^the options overlay should display Advanced Settings$/) do
expect(on(VisualEditorPage).options_settings_content_element.text).to match "Advanced settings"
end
Then(/^the options overlay should display Page Settings$/) do
expect(on(VisualEditorPage).options_settings_content_element.text).to match "Page settings"
end

View file

@ -26,6 +26,8 @@ class VisualEditorPage
span(:looks_good, class: "oo-ui-labelElement-label", text: "Looks good to me")
div(:medium_dialog, class: "oo-ui-window oo-ui-dialog oo-ui-dialog-open oo-ui-dialog-medium")
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(:page_text, id: "mw-content-text")
a(:page_title, text: /Page title/)
a(:paragraph, text: /Paragraph/)
@ -149,6 +151,8 @@ class VisualEditorPage
span(:confirm_switch_cancel_on_switch, text: "Cancel")
span(:confirm_switch_discard, text: "Discard changes")
div(:options_settings_content, class: "oo-ui-layout oo-ui-panelLayout oo-ui-panelLayout-scrollable oo-ui-panelLayout-expanded oo-ui-pageLayout oo-ui-pageLayout-active")
in_iframe(index: 0) do |frame|
a(:beta_warning, title: "Close", frame: frame)
div(:content_box, class: "ve-ce-documentNode ve-ce-branchNode", frame: frame)
@ -183,6 +187,7 @@ class VisualEditorPage
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)
div(:settings_apply_button, class: "oo-ui-processDialog-actions-primary", frame: frame)
end
# not having beta warning makes iframes off by one
@ -190,6 +195,7 @@ class VisualEditorPage
div(:links_diff_view, class: "ve-ui-mwSaveDialog-viewer", frame: frame)
span(:links_review_changes, class: "oo-ui-labelElement-label", text: "Review your changes", frame: frame)
div(:media_diff_view, class: "ve-ui-mwSaveDialog-viewer", frame: frame)
span(:media_exit, text: "Return to save form", frame: frame)
div(:advanced_settings_overlay, class:"oo-ui-layout oo-ui-iconElement oo-ui-labelElement oo-ui-fieldsetLayout", frame: frame)
end
end