mediawiki-extensions-Revisi.../tests/browser/features/support/pages/special_preferences_page.rb
addshore d7caa6c1f3 Start browser tests (Initial test for beta feature switch)
This adds 1 simple browser test to make sure that the placeholder
for the revision slider loads when the beta feature is enabled and
does not load when it is disabled

More tests will follow.

Bug: T133278
Change-Id: I5be9014b6c5ac03128c034fd866141e89fd7a0ed
2016-06-30 14:46:37 +01:00

22 lines
752 B
Ruby

class SpecialPreferencesPage
include PageObject
page_url 'Special:Preferences'
a(:beta_features_tab, css: '#preftab-betafeatures')
text_field(:revisionslider_checkbox, css: '#mw-input-wprevisionslider')
button(:submit_button, css: '#prefcontrol')
def enable_revisionslider
beta_features_tab_element.when_present.click
return unless revisionslider_checkbox_element.attribute('checked').nil?
revisionslider_checkbox_element.click
submit_button_element.when_present.click
end
def disable_revisionslider
beta_features_tab_element.when_present.click
return if revisionslider_checkbox_element.attribute('checked').nil?
revisionslider_checkbox_element.click
submit_button_element.when_present.click
end
end