master
 1require_relative "../page_model.rb"
 2
 3class NewRegistrationPage < PageModel
 4  def initialize
 5    super(new_registration_path)
 6  end
 7
 8  def register_with(username: FFaker::Internet.user_name,
 9                    email: FFaker::Internet.email,
10                    password: "password",
11                    accept_terms: true)
12    within "#new_user" do
13      fill_in "Username", with: username
14      fill_in "Email", with: email
15      fill_in "Password", with: password
16      check "I agree to the" if accept_terms
17      click_button "Register"
18    end
19  end
20end