discourse/spec/system/page_objects/pages/group.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
867 B
Ruby
Raw Normal View History

# 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