2023-10-23 02:46:10 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PageObjects
|
|
|
|
module Pages
|
|
|
|
class AdminUserBadges < PageObjects::Pages::Base
|
|
|
|
def visit_page(user)
|
|
|
|
page.visit "/admin/users/#{user.id}/#{user.username}/badges"
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def user_badges_table
|
|
|
|
page.find(:table, id: "user-badges", visible: true)
|
|
|
|
end
|
2023-12-15 10:46:04 -05:00
|
|
|
|
2023-10-23 02:46:10 -04:00
|
|
|
def find_badge_row_by_granter(granter)
|
|
|
|
user_badges_table.find(:table_row, { "Granted By" => "#{granter.username}" })
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|