mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
11 lines
362 B
Ruby
11 lines
362 B
Ruby
# frozen_string_literal: true
|
|
|
|
module BootstrapMacros
|
|
# Interact with Bootstrap Switch
|
|
def switch(locator, to:, **)
|
|
checkbox = find(:checkbox, locator, **, visible: :hidden)
|
|
|
|
checkbox.ancestor('.bootstrap-switch').click unless checkbox.checked? == to
|
|
expect(page).to have_selector(:checkbox, locator, **, visible: :hidden, checked: to)
|
|
end
|
|
end
|