mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 11:40:43 +00:00
12e6631dde
The waitr click on the checkbox seems to be broken or is broken with intend since the actual OOUI checkbox has an opacity of 0. Additionally when_visible fails when the element is not present yet. The the way to go here seems to wait for the element to be there and then check for visibility. Also made use of PageObject method for checkboxes, the name selector and the link element. Bug: T158074 Change-Id: I2c3d6d963c8bcdc420bfbc57c1c2380bce7ef2f1
23 lines
791 B
Ruby
23 lines
791 B
Ruby
class SpecialPreferencesPage
|
|
include PageObject
|
|
page_url 'Special:Preferences'
|
|
|
|
link(:beta_features_tab, css: '#preftab-betafeatures')
|
|
checkbox(:revisionslider_checkbox, name: 'wprevisionslider')
|
|
div(:revisionslider_checkbox_div, xpath: '//*[@name="wprevisionslider"]//parent::div')
|
|
button(:submit_button, css: '#prefcontrol')
|
|
|
|
def enable_revisionslider
|
|
beta_features_tab_element.when_visible.click
|
|
return if revisionslider_checkbox_checked?
|
|
revisionslider_checkbox_div_element.click
|
|
submit_button_element.when_visible.click
|
|
end
|
|
|
|
def disable_revisionslider
|
|
beta_features_tab_element.when_visible.click
|
|
return unless revisionslider_checkbox_checked?
|
|
revisionslider_checkbox_div_element.click
|
|
submit_button_element.when_visible.click
|
|
end
|
|
end |