mirror of
https://github.com/discourse/discourse.git
synced 2024-12-30 15:16:09 +08:00
29 lines
672 B
Ruby
29 lines
672 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module PageObjects
|
||
|
module Pages
|
||
|
class UserPreferencesAccount < PageObjects::Pages::Base
|
||
|
def visit(user)
|
||
|
page.visit("/u/#{user.username}/preferences/account")
|
||
|
self
|
||
|
end
|
||
|
|
||
|
def click_edit_avatar_button
|
||
|
page.find_button("edit-avatar").click
|
||
|
end
|
||
|
|
||
|
def open_avatar_selector_modal(user)
|
||
|
visit(user).click_edit_avatar_button
|
||
|
end
|
||
|
|
||
|
def has_custom_uploaded_avatar_image?
|
||
|
has_css?(".pref-avatar img.avatar[src*='user_avatar']")
|
||
|
end
|
||
|
|
||
|
def has_system_avatar_image?
|
||
|
has_css?(".pref-avatar img.avatar[src*='letter_avatar']")
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|