gitlab-org--gitlab-foss/app/views/devise/sessions/_new_base.html.haml
ddavison 390e0d8906
Introduce data-qa-selector to supplant .qa-class
In order to break away from using CSS classes as
our primary method of element identification, we
need to provide the ability to search for data
attributes.

Make Test::Sanity::Selectors now work

Utilize regex to match on literal strings of the element name

Suggest the data-qa-selector pattern vs the qa-

Add data-qa-selector to login page to start

We need a page that is heavily used in order to be
confident that this functionality works. Let's start
with the Login page

Use appropriate HAML data tag practices
2019-07-10 16:09:43 -07:00

20 lines
1.1 KiB
Text

= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'new_user gl-show-field-errors', 'aria-live' => 'assertive'}) do |f|
.form-group
= f.label "Username or email", for: "user_login", class: 'label-bold'
= f.text_field :login, class: "form-control top", autofocus: "autofocus", autocapitalize: "off", autocorrect: "off", required: true, title: "This field is required.", data: { qa_selector: 'login_field' }
.form-group
= f.label :password, class: 'label-bold'
= f.password_field :password, class: "form-control bottom", required: true, title: "This field is required.", data: { qa_selector: 'password_field' }
- if devise_mapping.rememberable?
.remember-me
%label{ for: "user_remember_me" }
= f.check_box :remember_me, class: 'remember-me-checkbox'
%span Remember me
.float-right.forgot-password
= link_to "Forgot your password?", new_password_path(:user)
%div
- if captcha_enabled?
= recaptcha_tags
.submit-container.move-submit-down
= f.submit "Sign in", class: "btn btn-success", data: { qa_selector: 'sign_in_button' }