debian-mirror-gitlab/spec/support/helpers/modal_helpers.rb
2022-01-26 12:08:38 +05:30

27 lines
525 B
Ruby

# frozen_string_literal: true
module Spec
module Support
module Helpers
module ModalHelpers
def within_modal
page.within('[role="dialog"]') do
yield
end
end
def accept_gl_confirm(text = nil, button_text: 'OK')
yield if block_given?
within_modal do
unless text.nil?
expect(page).to have_content(text)
end
click_button button_text
end
end
end
end
end
end