Make Preferences tests language-agnostic
authorCmcmahon <cmcmahon@wikimedia.org>
Fri, 27 Jun 2014 20:57:45 +0000 (13:57 -0700)
committerCmcmahon <cmcmahon@wikimedia.org>
Mon, 30 Jun 2014 16:58:31 +0000 (09:58 -0700)
Change-Id: I2a0bd6e4306de11a8b3f13505bc3e65439211e23

tests/browser/features/preferences.feature
tests/browser/features/step_definitions/preferences_appearance_steps.rb
tests/browser/features/support/pages/preferences_appearance_page.rb
tests/browser/features/support/pages/preferences_page.rb

index 2eb5de8..fa673cb 100644 (file)
@@ -25,7 +25,7 @@ Feature: Preferences
       And I can click Save
       And I can restore default settings
       And I can select date format
-      And I can see server time
+      And I can see time offset section
       And I can see local time
       And I can select my time zone
 
index d3e275e..0046af6 100644 (file)
@@ -18,7 +18,7 @@ When(/^I navigate to Preferences$/) do
 end
 
 Then(/^I can click Save$/) do
-  on(PreferencesAppearancePage).save_button_element.should exist
+  on(PreferencesPage).save_button_element.should exist
 end
 
 Then(/^I can restore default settings$/) do
@@ -26,12 +26,11 @@ Then(/^I can restore default settings$/) do
 end
 
 Then(/^I can see local time$/) do
-  @browser.text.should match Regexp.escape("Local time")
   on(PreferencesAppearancePage).local_time_span_element.should exist
 end
 
-Then(/^I can see server time$/) do
-  @browser.text.should match Regexp.escape("Server time")
+Then(/^I can see time offset section$/) do
+  on(PreferencesAppearancePage).time_offset_table_element.should be_visible
 end
 
 Then(/^I can select date format$/) do
@@ -49,7 +48,6 @@ Then(/^I can select image size$/) do
 end
 
 Then(/^I can select my time zone$/) do
-  @browser.text.should match Regexp.escape("Time zone")
   on(PreferencesAppearancePage) do |page|
     page.time_offset_select_element.should exist
     page.other_offset_element.should exist
index c01aab4..e7b64cd 100644 (file)
@@ -29,11 +29,11 @@ class PreferencesAppearancePage
   radio_button(:monobook, id: "mw-input-wpskin-monobook")
   radio_button(:no_preference_radio, id: "mw-input-wpdate-default")
   text_field(:other_offset, id: "mw-input-wptimecorrection-other")
-  a(:restore_default_link, text:/Restore all default settings/)
-  button(:save_button, text: "Save")
+  a(:restore_default_link, href: /reset/)
   select_list(:size_select, id: "mw-input-wpimagesize")
   select_list(:threshold_select, id: "mw-input-wpstubthreshold")
   select_list(:time_offset_select, id: "mw-input-wptimecorrection")
+  table(:time_offset_table, id: "mw-htmlform-timeoffset")
   select_list(:thumb_select, id: "mw-input-wpthumbsize")
   select_list(:underline_select, id: "mw-input-wpunderline")
   radio_button(:vector, id: "mw-input-wpskin-vector")
index b581ca4..919ba27 100644 (file)
@@ -15,14 +15,8 @@ class PreferencesPage
   include URL
   page_url URL.url("Special:Preferences")
 
-  a(:appearance_link, text: "Appearance")
-  a(:date_and_time_link, text: "Date and time")
-  a(:editing_link, text: "Editing")
-  a(:gadgets_link, text: "Gadgets")
-  a(:misc_link, text: "Misc")
-  a(:pending_changes_link, text: "Pending changes")
-  a(:recent_changes_link, text: "Recent changes")
-  a(:search_link, text: "Search")
-  a(:user_profile_link, text: "User profile")
-  a(:watchlist_link, text: "Watchlist")
+  a(:appearance_link, id: "preftab-rendering")
+  a(:editing_link, id: "preftab-editing")
+  a(:user_profile_link, id: "preftab-personal")
+  button(:save_button, id: "prefcontrol")
 end