summaryrefslogtreecommitdiff
path: root/qa/qa/page/main/sign_up.rb
blob: 9a834e94b818651246d674f8c4d42adf2d0723ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
module QA
  module Page
    module Main
      class SignUp < Page::Base
        view 'app/views/devise/shared/_signup_box.html.haml' do
          element :name, 'text_field :name'
          element :username, 'text_field :username'
          element :email_field, 'email_field :email'
          element :email_confirmation, 'email_field :email_confirmation'
          element :password, 'password_field :password'
          element :register_button, 'submit "Register"'
        end

        def sign_up!(name:, username:, email:, password:)
          fill_in :new_user_name, with: name
          fill_in :new_user_username, with: username
          fill_in :new_user_email, with: email
          fill_in :new_user_email_confirmation, with: email
          fill_in :new_user_password, with: password
          click_button 'Register'

          Page::Menu::Main.act { has_personal_area? }
        end
      end
    end
  end
end