Nikerabbit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/80388


Change subject: Two scenarios for ULS settings live preview feature
......................................................................

Two scenarios for ULS settings live preview feature

Change-Id: Ib3bd53e2c3186bb899a122a792ee348a6241eaec
---
M features/step_definitions/uls_cog_sidebar_user_steps.rb
M features/support/pages/random_page.rb
M features/uls_cog_sidebar_logged_user.feature
3 files changed, 86 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests 
refs/changes/88/80388/1

diff --git a/features/step_definitions/uls_cog_sidebar_user_steps.rb 
b/features/step_definitions/uls_cog_sidebar_user_steps.rb
index 0a423f5..482b7f5 100644
--- a/features/step_definitions/uls_cog_sidebar_user_steps.rb
+++ b/features/step_definitions/uls_cog_sidebar_user_steps.rb
@@ -150,3 +150,48 @@
 Then(/^I should see the How to use link near the Malayalam transliteration 
item$/) do
   on(InterlanguagePage).how_to_use_ml_transliteration_element.should be_visible
 end
+
+Given(/^my interface language is English$/) do
+  @browser.driver.find_element( :xpath => 'html' ).attribute( 'lang' ).should 
== 'en'
+end
+
+When(/^I use the panel to change my interface language to German$/) do
+  on(RandomPage).language_filter = 'de'
+  on(RandomPage).language_filter_element.send_keys :return
+end
+
+When(/^I open input settings of ULS settings panel$/) do
+  on(RandomPage).uls_open_input_settings_element.click
+end
+
+Then(/^the Cancel button says (.*)/) do |text|
+  # This doesn't work, GRRR!
+  # on(RandomPage).uls_input_settings_cancel.should == text
+  on(RandomPage).uls_input_settings_cancel_element.text.should == text
+end
+
+Then(/^the Apply button says (.*)/) do |text|
+  on(RandomPage).uls_input_settings_apply_element.text.should == text
+end
+
+Given(/^I inspect the font of the page content$/) do
+  @uls_original_content_font = @browser.execute_script(
+  """
+  return jQuery('#mw-content-text').css('font-family');
+  """
+  )
+end
+
+When(/^I change font for content language to OpenDyslexic$/) do
+  Selenium::WebDriver::Support::Select.new(
+    @browser.driver.find_element(:id, 'content-font-selector')
+  ).select_by(:text, "OpenDyslexic")
+end
+
+Then(/^the font of the content should be the same as earlier$/) do
+  @browser.execute_script(
+  """
+  return jQuery('#mw-content-text').css('font-family');
+  """
+  ).should == @uls_original_content_font
+end
diff --git a/features/support/pages/random_page.rb 
b/features/support/pages/random_page.rb
index fe0ebae..43d268b 100644
--- a/features/support/pages/random_page.rb
+++ b/features/support/pages/random_page.rb
@@ -22,5 +22,15 @@
   li(:uls_malayalam_inscript2_item, data_ime_inputmethod: 'ml-inscript2')
   button(:search_button, id: 'searchButton')
   text_field(:search_input, id: 'searchInput')
+
+  # Used by ULS
   a(:uls_trigger, class: 'uls-trigger')
+
+  div(:uls_open_display_settings, id: 'display-settings-block')
+  div(:uls_open_input_settings, id: 'input-settings-block')
+
+  button(:uls_input_settings_cancel, class: 'uls-input-settings-cancel')
+  button(:uls_input_settings_apply, class: 'uls-input-settings-apply')
+
+  div(:page_content, id: 'mw-content-text')
 end
diff --git a/features/uls_cog_sidebar_logged_user.feature 
b/features/uls_cog_sidebar_logged_user.feature
index 9ce7ed4..48fe966 100644
--- a/features/uls_cog_sidebar_logged_user.feature
+++ b/features/uls_cog_sidebar_logged_user.feature
@@ -66,3 +66,34 @@
       And I see Worldwide
       And I see Language Search
       And I can navigate back to Language Settings
+
+
+  Scenario: Temporary live preview for menu language
+
+  ULS settings panel language changes for previewing and is reverted back when
+  canceled.
+
+    Given my interface language is English
+    When I click the cog icon by Languages in the sidebar
+      # The default view is Display settings
+      And I click the button with the ellipsis
+      And I use the panel to change my interface language to German
+      And I click Input
+      And I click X
+      And I click the cog icon by Languages in the sidebar
+    # Now it opens display settings, last used view
+    Then the Cancel button says Cancel
+      And the Apply button says Apply
+
+
+  Scenario: Temporary live preview for content font change
+
+  The chosen font is applied immediately for preview, but should be reverted if
+  the change is canceled.
+
+    Given I inspect the font of the page content
+    When I click the cog icon by Languages in the sidebar
+      And I click Fonts
+      And I change font for content language to OpenDyslexic
+      And I click X
+    Then the font of the content should be the same as earlier

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3bd53e2c3186bb899a122a792ee348a6241eaec
Gerrit-PatchSet: 1
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to