2016-04-13 21:21:38 +00:00
|
|
|
class SpecialPreferencesPage
|
|
|
|
include PageObject
|
|
|
|
page_url 'Special:Preferences'
|
|
|
|
|
|
|
|
a(:beta_features_tab, css: '#preftab-betafeatures')
|
2016-10-24 18:27:09 +00:00
|
|
|
text_field(:hovercards_checkbox, css: '[name=wppopups]')
|
2016-04-13 21:21:38 +00:00
|
|
|
button(:submit_button, css: '#prefcontrol')
|
2016-04-20 12:33:34 +00:00
|
|
|
div(:notification, css: ".mw-notification")
|
2016-04-13 21:21:38 +00:00
|
|
|
|
|
|
|
def enable_hovercards
|
|
|
|
beta_features_tab_element.when_present.click
|
|
|
|
return unless hovercards_checkbox_element.attribute('checked').nil?
|
|
|
|
hovercards_checkbox_element.click
|
|
|
|
submit_button_element.when_present.click
|
2016-04-20 12:33:34 +00:00
|
|
|
|
|
|
|
# Note well that Element#wait_until_present is more semantic but is
|
|
|
|
# deprecated. Fortunately, #when_present simply wraps #wait_until_present.
|
|
|
|
notification_element.when_present
|
2016-04-13 21:21:38 +00:00
|
|
|
end
|
2016-04-20 12:33:34 +00:00
|
|
|
end
|