discourse/spec/system/page_objects/pages/group.rb
2023-09-27 13:54:44 +08:00

34 lines
867 B
Ruby

# frozen_string_literal: true
module PageObjects
module Pages
class Group < PageObjects::Pages::Base
def visit(group)
page.visit("/g/#{group.name}")
self
end
def find(selector)
page.find(".group #{selector}")
end
def add_users
find(".group-members-manage button.group-members-add").click
self
end
def select_user_and_add(user)
page.find(
".modal-container .user-chooser .multi-select-header .select-kit-header-wrapper",
).click
page.find(".modal-container .user-chooser .filter-input").set(user.username)
page.find(
".modal-container li.email-group-user-chooser-row[data-value='#{user.username}']",
).click
page.find(".modal-container button.add.btn-primary").click
self
end
end
end
end