2023-02-22 15:38:54 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PageObjects
|
|
|
|
module Components
|
|
|
|
class Dialog < PageObjects::Components::Base
|
2023-07-17 08:14:17 +08:00
|
|
|
def closed?
|
|
|
|
has_no_css?(".dialog-container")
|
|
|
|
end
|
|
|
|
|
|
|
|
def open?
|
|
|
|
has_css?(".dialog-container")
|
|
|
|
end
|
|
|
|
|
2023-02-22 15:38:54 +08:00
|
|
|
def has_content?(content)
|
|
|
|
find(".dialog-container").has_content?(content)
|
|
|
|
end
|
|
|
|
|
|
|
|
def click_yes
|
|
|
|
find(".dialog-footer .btn-primary").click
|
|
|
|
end
|
|
|
|
|
2024-05-03 07:31:16 +08:00
|
|
|
def click_danger
|
|
|
|
find(".dialog-footer .btn-danger").click
|
|
|
|
end
|
|
|
|
|
2024-03-26 09:14:26 +08:00
|
|
|
alias click_ok click_yes
|
|
|
|
|
2023-02-22 15:38:54 +08:00
|
|
|
def click_no
|
|
|
|
find(".dialog-footer .btn-default").click
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|