discourse/spec/system/page_objects/pages/admin_user_fields.rb
Ted Johansson 7b437c9401
FEATURE: Implement new required options in admin user fields UI (#27079)
We're planning to implement a feature that allows adding required fields for existing users. This PR does some preparatory refactoring to make that possible. There should be no changes to existing behaviour. Just a small update to the admin UI.
2024-05-23 19:18:25 +08:00

27 lines
642 B
Ruby

# frozen_string_literal: true
module PageObjects
module Pages
class AdminUserFields < PageObjects::Pages::Base
def visit
page.visit "admin/customize/user_fields"
self
end
def add_field(name: nil, description: nil, requirement: nil, preferences: [])
page.find(".user-fields .btn-primary").click
form = page.find(".user-field")
form.find(".user-field-name").fill_in(with: name)
form.find(".user-field-desc").fill_in(with: description)
form.find(".save").click
end
def has_user_field?(name)
page.has_text?(name)
end
end
end
end