Zfilipin has submitted this change and it was merged.

Change subject: add tests for ULS Input and Fonts and More Languages
......................................................................


add tests for ULS Input and Fonts and More Languages

Change-Id: Ife0c9381dfde2d621df86e34f08f1ebb27ffda06
---
M features/step_definitions/uls_cog_sidebar_logged_user_steps.rb
M features/support/modules/interlanguage_module.rb
M features/uls_cog_sidebar_logged_user.feature
3 files changed, 96 insertions(+), 7 deletions(-)

Approvals:
  Zfilipin: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/features/step_definitions/uls_cog_sidebar_logged_user_steps.rb 
b/features/step_definitions/uls_cog_sidebar_logged_user_steps.rb
index 23e2e79..1afb3c0 100644
--- a/features/step_definitions/uls_cog_sidebar_logged_user_steps.rb
+++ b/features/step_definitions/uls_cog_sidebar_logged_user_steps.rb
@@ -3,7 +3,8 @@
 end
 
 Given(/^I am on a page without interlanguage links$/) do
-  visit(NoInterlanguagePage).add_links_element.should be_visible
+  visit NoInterlanguagePage #  .add_links_element.when_visible.should 
be_visible
+  # cannot do this because of 
https://bugzilla.wikimedia.org/show_bug.cgi?id=49139
 end
 
 Given(/^I am on a talk page with interlanguage links$/) do
@@ -28,6 +29,17 @@
   on(InterlanguagePage).cancel_element.click
 end
 
+When(/^I click Fonts$/) do
+  on(InterlanguagePage).fonts_settings
+end
+
+When(/^I click Input$/) do
+  on(InterlanguagePage).input_settings_element.click
+end
+
+When(/^I click the button with the ellipsis$/) do
+  on(InterlanguagePage).ellipsis_button_element.click
+end
 
 When(/^I click the cog icon by Languages in the sidebar$/) do
   on(NoInterlanguagePage).cog_element.click
@@ -41,6 +53,29 @@
   on(InterlanguagePage).talk_element.click
 end
 
+Then(/^a font selectbox appears$/) do
+  on(InterlanguagePage).content_font_selectbox_element.should be_visible
+end
+
+Then(/^I can disable input methods$/) do
+  on(InterlanguagePage).disable_input_methods_element.when_visible.should 
be_visible
+end
+
+Then(/^I can enable input methods$/) do
+  on(InterlanguagePage).enable_input_methods_element.when_visible.should 
be_visible
+end
+
+Then(/^I can navigate back to Language Settings$/) do
+  on(InterlanguagePage) do |page|
+    page.back_to_display
+    page.x_element.should be_visible
+  end
+end
+
+When(/^I choose a different language for writing$/) do
+  on(InterlanguagePage).non_default_language_element.when_visible.click
+end
+
 Then(/^I do not see the Language Settings panel$/) do
   on(InterlanguagePage) do |page|
     page.language_button_element.should_not be_visible
@@ -48,6 +83,14 @@
     page.default_language_button_element.should_not be_visible
     page.other_language_button_element.should_not be_visible
   end
+end
+
+Then(/^I see Common Languages$/) do
+  on(InterlanguagePage).language_list.should match Regexp.escape('Common 
languages')
+end
+
+Then(/^I see Language Search$/) do
+  on(InterlanguagePage).language_search_element.should be_visible
 end
 
 Then(/^I see the Language Settings panel$/) do
@@ -59,8 +102,18 @@
   end
 end
 
+Then(/^I see Worldwide$/) do
+   on(InterlanguagePage) do |page|
+    page.language_list.should match Regexp.escape('Worldwide')
+    page.english_link_element.should be_visible
+  end
+end
+
 Then(/^the cog icon brings up Language Settings again$/) do
   step 'I click the cog icon by Languages in the sidebar'
   step 'I see the Language Settings panel'
 end
 
+Then(/^a font selectbox appears for content$/) do
+  on(InterlanguagePage).content_font_selectbox_element.should be_visible
+end
diff --git a/features/support/modules/interlanguage_module.rb 
b/features/support/modules/interlanguage_module.rb
index e814bae..499b146 100644
--- a/features/support/modules/interlanguage_module.rb
+++ b/features/support/modules/interlanguage_module.rb
@@ -2,14 +2,25 @@
   include PageObject
 
   a(:add_links, id: 'wbc-linkToItem-link')
-  span(:cog, class: 'uls-settings-trigger')
+  span(:apply_settings, class: 'uls-settings-trigger')
+  a(:back_to_display, text: 'Back to display settings')
   button(:cancel, class: 'button uls-display-settings-cancel')
-  button(:language_button, id: 'uls-display-settings-language-tab')
-  button(:fonts_button, id: 'uls-display-settings-fonts-tab')
+  span(:cog, class: 'uls-settings-trigger')
+  select_list(:content_font_selectbox, id: 'content-font-selector')
   button(:default_language_button, class: 'button uls-language-button down')
+  button(:disable_input_methods, class: 'active green button 
uls-input-toggle-button')
+  button(:ellipsis_button, class: 'uls-more-languages button')
+  button(:enable_input_methods, class: 'active green button 
uls-input-toggle-button')
+  a(:english_link, text: 'English')
+  button(:fonts_button, id: 'uls-display-settings-fonts-tab')
+  button(:fonts_settings, id: 'uls-display-settings-fonts-tab')
+  div(:input_settings, id: 'input-settings-block')
+  button(:language_button, id: 'uls-display-settings-language-tab')
+  div(:language_list, class: 'row uls-language-list lcd')
+  text_field(:language_search, id: 'languagefilter')
+  button(:non_default_language, class: 'button uls-language-button', index: 1)
   button(:other_language_button, class: 'button uls-language-button')
   a(:talk, text: 'Discussion')
+  select_list(:ui_font_selectbox, id: 'ui-font-selector')
   span(:x, id: 'languagesettings-close')
-  span(:apply_settings, class: 'uls-settings-trigger')
 end
-
diff --git a/features/uls_cog_sidebar_logged_user.feature 
b/features/uls_cog_sidebar_logged_user.feature
index 43e0110..de680c2 100644
--- a/features/uls_cog_sidebar_logged_user.feature
+++ b/features/uls_cog_sidebar_logged_user.feature
@@ -40,4 +40,29 @@
     Given I navigate to the Language Settings panel
     When I click Cancel
     Then I do not see the Language Settings panel
-      And the cog icon brings up Language Settings again
\ No newline at end of file
+      And the cog icon brings up Language Settings again
+
+  Scenario: Input settings display
+    Given I navigate to the Language Settings panel
+    When I click Input
+    Then I can enable input methods
+      And I can disable input methods
+
+  Scenario: Fonts default settings and display
+    Given I navigate to the Language Settings panel
+    When I click Fonts
+    Then a font selectbox appears
+
+  Scenario: Fonts not default settings and display
+    Given I navigate to the Language Settings panel
+    When I choose a different language for writing
+      And I click Fonts
+    Then a font selectbox appears for content
+
+  Scenario: More languages
+    Given I navigate to the Language Settings panel
+    When I click the button with the ellipsis
+    Then I see Common Languages
+      And I see Worldwide
+      And I see Language Search
+      And I can navigate back to Language Settings

-- 
To view, visit https://gerrit.wikimedia.org/r/66307
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ife0c9381dfde2d621df86e34f08f1ebb27ffda06
Gerrit-PatchSet: 14
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>
Gerrit-Reviewer: Alolita <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Arrbee <[email protected]>
Gerrit-Reviewer: Cmcmahon <[email protected]>
Gerrit-Reviewer: Rachel99 <[email protected]>
Gerrit-Reviewer: Siebrand <[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

Reply via email to