Welcome to mirror list, hosted at ThFree Co, Russian Federation.

password.rb « profile « page « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5f07cdb6f25eb7218c06112b50e503084238b306 (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
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

module QA
  module Page
    module Profile
      class Password < Page::Base
        view 'app/views/user_settings/passwords/edit.html.haml' do
          element :current_password_field
          element :new_password_field
          element :confirm_password_field
          element :save_password_button
        end

        view 'app/views/user_settings/passwords/new.html.haml' do
          element :current_password_field
          element :new_password_field
          element :confirm_password_field
          element :set_new_password_button
        end

        def update_password(new_password, current_password)
          find_element(:current_password_field).set current_password
          find_element(:new_password_field).set new_password
          find_element(:confirm_password_field).set new_password
          click_element(:save_password_button)
        end

        def set_new_password(new_password, current_password)
          fill_element :current_password_field, current_password
          fill_element :new_password_field, new_password
          fill_element :confirm_password_field, new_password
          click_element :set_new_password_button
        end
      end
    end
  end
end