2023-09-29 11:46:31 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PageObjects
|
|
|
|
module Modals
|
|
|
|
class ChangeOwner < PageObjects::Pages::Base
|
|
|
|
USERS_DROPDOWN = ".select-kit"
|
|
|
|
|
|
|
|
def modal
|
|
|
|
find(".change-ownership-modal")
|
|
|
|
end
|
2023-12-15 23:46:04 +08:00
|
|
|
|
2023-09-29 11:46:31 +08:00
|
|
|
def select_new_owner(user)
|
|
|
|
within(modal) do
|
|
|
|
users_dropdown.expand
|
|
|
|
users_dropdown.search(user.username)
|
|
|
|
users_dropdown.select_row_by_value(user.username)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def confirm_new_owner
|
2023-11-15 18:14:47 +08:00
|
|
|
within(modal) { find(".d-modal__footer .btn").click }
|
2023-09-29 11:46:31 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def users_dropdown
|
|
|
|
@users_dropdown ||= PageObjects::Components::SelectKit.new(USERS_DROPDOWN)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|