diff options
author | ddavison <ddavison@gitlab.com> | 2019-05-30 02:47:53 +0300 |
---|---|---|
committer | ddavison <ddavison@gitlab.com> | 2019-07-11 02:09:43 +0300 |
commit | 390e0d8906c066996e8bbb14aa5824643f9798f8 (patch) | |
tree | 8b220d1d2e0770bc96cc958ce624043e1ae0885e /app/views/devise | |
parent | 48fa47e07d54979b70704beb16ea55548f2190c4 (diff) |
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
Diffstat (limited to 'app/views/devise')
-rw-r--r-- | app/views/devise/sessions/_new_base.html.haml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml index 7dacd0b1d72..2f10f08c839 100644 --- a/app/views/devise/sessions/_new_base.html.haml +++ b/app/views/devise/sessions/_new_base.html.haml @@ -1,10 +1,10 @@ = 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 qa-login-field", autofocus: "autofocus", autocapitalize: "off", autocorrect: "off", required: true, title: "This field is required." + = 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 qa-password-field", required: true, title: "This field is required." + = 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" } @@ -17,4 +17,4 @@ = recaptcha_tags .submit-container.move-submit-down - = f.submit "Sign in", class: "btn btn-success qa-sign-in-button" + = f.submit "Sign in", class: "btn btn-success", data: { qa_selector: 'sign_in_button' } |