discourse/spec/system/page_objects/modals/base.rb
Martin Brennan 9762e65758
FEATURE: Add Revise... option for queued post reviewable (#23454)
This commit adds a new Revise... action that can be taken
for queued post reviewables. This will open a modal where
the user can select a Reason from a preconfigured list
(or by choosing Other..., a custom reason) and provide feedback
to the user about their post.

The post will be rejected still, but a PM will also be sent to
the user so they have an opportunity to improve their post when
they resubmit it.
2023-10-13 11:28:31 +10:00

39 lines
690 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 has_content?(content)
find(".modal-body").has_content?(content)
end
def open?
has_css?(".modal.d-modal")
end
def closed?
has_no_css?(".modal.d-modal")
end
end
end
end