mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
359dc1c532
With the introduction of the sidebar navigation menu, the design team at Discourse redesigned the user profile navigation to better coexist with the sidebar.
37 lines
907 B
Ruby
37 lines
907 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class User < PageObjects::Pages::Base
|
|
def visit(user)
|
|
page.visit("/u/#{user.username}")
|
|
self
|
|
end
|
|
|
|
def find(selector)
|
|
page.find(".new-user-wrapper #{selector}")
|
|
end
|
|
|
|
def active_user_primary_navigation
|
|
find(".user-navigation-primary li a.active")
|
|
end
|
|
|
|
def active_user_secondary_navigation
|
|
find(".user-navigation-secondary li a.active")
|
|
end
|
|
|
|
def has_warning_messages_path?(user)
|
|
page.has_current_path?("/u/#{user.username}/messages/warnings")
|
|
end
|
|
|
|
def click_staff_info_warnings_link(warnings_count: 0)
|
|
staff_counters = page.find(".staff-counters")
|
|
staff_counters.click_link(
|
|
"#{warnings_count} #{I18n.t("js.user.staff_counters.warnings_received")}",
|
|
)
|
|
self
|
|
end
|
|
end
|
|
end
|
|
end
|