From 698f36cdd40840334e1461ea52dbc1c34e7127a3 Mon Sep 17 00:00:00 2001 From: Cmcmahon Date: Tue, 17 Mar 2015 15:53:16 -0700 Subject: [PATCH] [BrowserTest] update Cite test for new UI * Access to Cite options changed * Various target locators also changed Paired with Rummana for these changes. Change-Id: Ib7c3fbd1842879745d3d3128c66d90cc2b4f98cb --- modules/ve-mw/tests/browser/features/cite.feature | 3 +-- .../tests/browser/features/step_definitions/cite_steps.rb | 4 ++-- .../browser/features/step_definitions/references_steps.rb | 2 +- .../browser/features/support/pages/visual_editor_page.rb | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/ve-mw/tests/browser/features/cite.feature b/modules/ve-mw/tests/browser/features/cite.feature index e00ce9d025..b19e68d59b 100644 --- a/modules/ve-mw/tests/browser/features/cite.feature +++ b/modules/ve-mw/tests/browser/features/cite.feature @@ -4,8 +4,7 @@ Feature: VisualEditor Cite Background: Given I go to the "Cite VisualEditor Test" page with content "Cite VisualEditor Test" And I click in the editable part - And I click the Cite button - And I can see the Cite User Interface + And I open the Cite menu Scenario: Website When I click Website 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 e9a083ced1..6810d164e0 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 @@ -1,5 +1,5 @@ -Given(/^I can see the Cite User Interface$/) do - on(VisualEditorPage).cite_select_element.when_present +Given(/^I open the Cite menu$/) do + on(VisualEditorPage).cite_menu_element.when_present.click end When(/^I click Add more information$/) do 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 6296fa1310..b934169d73 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 @@ -33,7 +33,7 @@ When(/^I click on Extension:VisualEditor reference$/) do end When(/^I create a reference using existing reference$/) do - step('I click the Cite button') + step('I open the Cite menu') step('I click use an existing reference button in References User Interface') step('I click on Extension:VisualEditor reference') 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 ab55703fcc..1e4d6f6dc6 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 @@ -20,22 +20,22 @@ class VisualEditorPage text_area(:cite_eighth_textarea, index: 14) 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') + span(:cite_basic_reference, css: '.oo-ui-tool-name-reference > a:nth-child(1) > span:nth-child(1)') a(:cite_book, css: '.oo-ui-tool-name-cite-book > a:nth-child(1)') div(:cite_button, class: 've-test-toolbar-cite') text_field(:cite_custom_field_name, css: '.oo-ui-searchWidget-query > div:nth-child(1) > input:nth-child(1)') text_field(:cite_group_name_textarea, css: 'div.oo-ui-indicatorElement:nth-child(1) > input:nth-child(1)') a(:cite_journal, css: '.oo-ui-tool-name-cite-journal > a:nth-child(1)') span(:cite_indicator_down, css: '.ve-test-toolbar-cite .oo-ui-indicator-down') + span(:cite_menu, css: '.ve-test-toolbar-cite > span:nth-child(1) > span:nth-child(3)') 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, css: '.ve-test-toolbar-cite .oo-ui-clippableElement-clippable') span(:cite_reuse_existing_reference, css: '.oo-ui-icon-reference-existing') - 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-frame') - div(:cite_visualeditor_user_interface, css: '.ve-ui-surfaceWidget') + div(:cite_visualeditor_user_interface, css: 'div.ve-ui-surface:nth-child(2)') span(:cite_website, css: '.oo-ui-icon-ref-cite-web') span(:confirm_switch, text: 'Keep changes') span(:confirm_switch_cancel, text: 'Resume editing')