Cmcmahon has uploaded a new change for review. https://gerrit.wikimedia.org/r/65428
Change subject: Replaced and implemented uls_cog_sidebar_logged_user_steps.rb ...................................................................... Replaced and implemented uls_cog_sidebar_logged_user_steps.rb Change-Id: I5682ffb18f4e3ea91e92a1bb005d23adb71fb4e5 --- A features/backlog/uls_cog_tooltip_revert-logged_user.feature A features/step_definitions/uls_cog_sidebar_logged_user_steps.rb A features/support/pages/interlanguage_page.rb A features/support/pages/no_interlanguage_page.rb A features/uls_cog_sidebar_logged_user.feature 5 files changed, 150 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests refs/changes/28/65428/1 diff --git a/features/backlog/uls_cog_tooltip_revert-logged_user.feature b/features/backlog/uls_cog_tooltip_revert-logged_user.feature new file mode 100644 index 0000000..bcc1541 --- /dev/null +++ b/features/backlog/uls_cog_tooltip_revert-logged_user.feature @@ -0,0 +1,23 @@ +Feature: ULS cog tooltip allows to revert language changes for logged-in users + +Background: In all of the following scenarios the global variable $wgULSPosition is set to 'interlanguage' for the wiki + And the base language at the start of the test is English + And the tests needs to run with a logged-in user + And setlang=fr is used + And the URL http://en.wikipedia.beta.wmflabs.org/wiki/Main_Page is used + +Scenario: The cog icon tooltip announces the possibility to revert to the previous language + Given I am in a page with the user language in French + When the page is loaded + Then I should see a tooltip appear that includes a link with the "English" label + +Scenario: The cog icon tooltip announces the possibility to revert to the previous language on hover + Given I am in a page with the user language in French + When I move the cursor over the cog icon + Then I should see a tooltip that includes a link with the "English" label + +Scenario: The cog icon tooltip allows to revert to the previous language + Given I am in a page with the user language in French + When I move the cursor over the cog icon + And I click on the "English" link + Then I get the user interface in English diff --git a/features/step_definitions/uls_cog_sidebar_logged_user_steps.rb b/features/step_definitions/uls_cog_sidebar_logged_user_steps.rb new file mode 100644 index 0000000..7f3fad4 --- /dev/null +++ b/features/step_definitions/uls_cog_sidebar_logged_user_steps.rb @@ -0,0 +1,53 @@ +Given(/^I am on a page without interlanguage links$/) do + on(NoInterlanguagePage).add_links_element.should be_visible +end + +When(/^I click the cog icon by Languages in the sidebar$/) do + on(NoInterlanguagePage).cog_element.click +end + +Then(/^I see the Language Settings panel$/) do + on(NoInterLanguagePage) do |page| + page.language_button_element.should be_visible + page.fonts_button_element.should be_visible + page.default_language_button.should be_visible + page.other_language_button.should be_visible + end +end + +Given(/^I am on a page with interlanguage links$/) do + on(InterlanguagePage) +end + +When(/^I navigate to the talk page$/) do + on(InterlanguagePage).talk_element.click +end + +Given(/^I navigate to the Language Settings panel$/) do + step 'I am on a page with interlanguage links' + step 'I navigate to the talk page' + step 'I see the Language Settings panel' +end + +When(/^I click X$/) do + on(InterLanguagePage).x_element.click +end + +Then(/^I do not see the Language Settings panel$/) do + on(InterlanguagePage) do |page| + page.cog_element.should be_visible + page.language_button_element.should_not be_visible + page.fonts_button_element.should_not be_visible + page.default_language_button.should_not be_visible + page.other_language_button.should_not be_visible + end +end + +Then(/^the cog icon continues to function$/) do + step 'I click the cog icon by Languages in the sidebar' + step 'I see the Language Settings panel' +end + +When(/^I click Apply Settings$/) do + on(InterlanguagePage).apply_settings_element.click +end \ No newline at end of file diff --git a/features/support/pages/interlanguage_page.rb b/features/support/pages/interlanguage_page.rb new file mode 100644 index 0000000..d2cd68a --- /dev/null +++ b/features/support/pages/interlanguage_page.rb @@ -0,0 +1,19 @@ +class InterlanguagePage + include PageObject + + include URL + def self.url + URL.url('Boleyn_family') + end + page_url url + + span(:apply_settings, class: 'uls-settings-trigger') + span(:cog, class: 'uls-settings-trigger') + button(:default_language_button, class: 'button uls-language-button down') + button(:fonts_button, id: 'uls-display-settings-fonts-tab') + button(:language_button, id: 'uls-display-settings-language-tab') + button(:other_language_button, class: 'button uls-language-button') + a(:talk, text: 'Discussion') + span(:x, id: 'languagesettings-close') + +end \ No newline at end of file diff --git a/features/support/pages/no_interlanguage_page.rb b/features/support/pages/no_interlanguage_page.rb new file mode 100644 index 0000000..50b654e --- /dev/null +++ b/features/support/pages/no_interlanguage_page.rb @@ -0,0 +1,19 @@ +class NoInterlanguagePage + include PageObject + + include URL + def self.url + URL.url('Think_Like_a_Cat') + end + page_url url + + a(:add_links, id: 'wbc-linkToItem-link') + span(:cog, class: 'uls-settings-trigger') + button(:language_button, id: 'uls-display-settings-language-tab') + button(:fonts_button, id: 'uls-display-settings-fonts-tab') + button(:default_language_button, class: 'button uls-language-button down') + button(:other_language_button, class: 'button uls-language-button') + a(:talk, text: 'Discussion') + span(:x, id: 'languagesettings-close') + span(:apply_settings, class: 'uls-settings-trigger') +end \ No newline at end of file diff --git a/features/uls_cog_sidebar_logged_user.feature b/features/uls_cog_sidebar_logged_user.feature new file mode 100644 index 0000000..9e43c33 --- /dev/null +++ b/features/uls_cog_sidebar_logged_user.feature @@ -0,0 +1,36 @@ +@en.wikipedia.beta.wmflabs.org @login +Feature: ULS cog behaviour on the side-bar for logged in users + + Scenario: Page without interlanguage links has cog icon and language selector + Given I am on a page without interlanguage links + When I click the cog icon by Languages in the sidebar + Then I see the Language Settings panel + + Scenario: Page with interlanguage links has cog icon and language selector + Given I am on a page with interlanguage links + When I click the cog icon by Languages in the sidebar + Then I see the Language Settings panel + + Scenario: Page without interlanguage links has cog icon and language selector on Talk page + Given I am on a page without interlanguage links + When I navigate to the talk page + And I click the cog icon by Languages in the sidebar + Then I see the Language Settings panel + + Scenario: Page with interlanguage links has cog icon and language selector on Talk page + Given I am on a page with interlanguage links + When I navigate to the talk page + And I click the cog icon by Languages in the sidebar + Then I see the Language Settings panel + + Scenario: Language Settings closes and opens with X button + Given I navigate to the Language Settings panel + When I click X + Then I do not see the Language Settings panel + And the cog icon continues to function + + Scenario: Language Settings closes and opens with Apply Settings buttons + Given I navigate to the Language Settings panel + When I click Apply Settings + Then I do not see the Language Settings panel + And the cog icon continues to function \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/65428 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5682ffb18f4e3ea91e92a1bb005d23adb71fb4e5 Gerrit-PatchSet: 1 Gerrit-Project: qa/browsertests Gerrit-Branch: master Gerrit-Owner: Cmcmahon <cmcma...@wikimedia.org> Gerrit-Reviewer: Arrbee <run...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits