discourse/spec/system/page_objects/modals/base.rb
Osama Sayegh a5497b74be
UX: Simplify invite modal (#28974)
This commit simplifies the initial state of the invite modal when it's opened to make it one click away from creating an invite link. The existing options/fields within the invite modal are still available, but are now hidden behind an advanced mode which can be enabled.

On the technical front, this PR also switches the invite modal to use our FormKit library.

Internal topic: t/134023.
2024-10-21 13:11:43 +03:00

61 lines
1021 B
Ruby

# frozen_string_literal: true
module PageObjects
module Modals
class Base
include Capybara::DSL
include RSpec::Matchers
BODY_SELECTOR = ""
def header
find(".d-modal__header")
end
def body
find(".d-modal__body#{BODY_SELECTOR}")
end
def footer
find(".d-modal__footer")
end
def has_footer?
has_css?(".d-modal__footer")
end
def has_no_footer?
has_no_css?(".d-modal__footer")
end
def close
find(".modal-close").click
end
def cancel
find(".d-modal-cancel").click
end
def click_outside
find(".d-modal").click(x: 0, y: 0)
end
def click_primary_button
footer.find(".btn-primary").click
end
def has_content?(content)
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