mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 04:59:22 -06:00
35 lines
597 B
Ruby
35 lines
597 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Modals
|
|
class Base
|
|
include Capybara::DSL
|
|
include RSpec::Matchers
|
|
|
|
def close
|
|
find(".modal-close").click
|
|
end
|
|
|
|
def cancel
|
|
find(".d-modal-cancel").click
|
|
end
|
|
|
|
def click_outside
|
|
find(".modal-outer-container").click(x: 0, y: 0)
|
|
end
|
|
|
|
def click_primary_button
|
|
find(".modal-footer .btn-primary").click
|
|
end
|
|
|
|
def open?
|
|
has_css?(".modal.d-modal")
|
|
end
|
|
|
|
def closed?
|
|
has_no_css?(".modal.d-modal")
|
|
end
|
|
end
|
|
end
|
|
end
|