debian-mirror-gitlab/spec/support/helpers/modal_helpers.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
525 B
Ruby
Raw Permalink Normal View History

2022-01-26 12:08:38 +05:30
# 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