2023-11-07 21:02:19 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
|
|
module Modals
|
|
|
|
class AvatarSelector < PageObjects::Modals::Base
|
|
|
|
BODY_SELECTOR = ".avatar-selector"
|
|
|
|
MODAL_SELECTOR = ".avatar-selector-modal"
|
2024-02-02 07:32:45 +08:00
|
|
|
AVATAR_UPLOAD_BUTTON_SELECTOR = ".avatar-uploader__button"
|
2023-11-07 21:02:19 +08:00
|
|
|
|
|
|
|
def select_avatar_upload_option
|
|
|
|
body.choose("avatar", option: "custom")
|
|
|
|
end
|
|
|
|
|
|
|
|
def select_system_assigned_option
|
|
|
|
body.choose("avatar", option: "system")
|
|
|
|
end
|
|
|
|
|
|
|
|
def click_avatar_upload_button
|
2024-02-02 07:32:45 +08:00
|
|
|
body.find(AVATAR_UPLOAD_BUTTON_SELECTOR).click
|
|
|
|
end
|
|
|
|
|
|
|
|
def has_avatar_upload_button?
|
|
|
|
has_css?(AVATAR_UPLOAD_BUTTON_SELECTOR)
|
|
|
|
end
|
|
|
|
|
|
|
|
def has_no_avatar_upload_button?
|
|
|
|
has_no_css?(AVATAR_UPLOAD_BUTTON_SELECTOR)
|
2023-11-07 21:02:19 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def has_user_avatar_image_uploaded?
|
|
|
|
body.has_css?(".avatar[src*='uploads/default']")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|