Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve autocomplete compatibility for sign-in form #11598

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aduth
Copy link
Member

@aduth aduth commented Dec 5, 2024

🛠 Summary of changes

Updates the sign-in form to assign autocomplete=username to the email address field.

This resolves a log message that's output in Chrome when all levels of console logging are visible:

image

To simulate this and add regression coverage, the logging preference for the Capybara Selenium ChromeDriver has been changed to output all logs, so that it'd be caught by existing log output checking.

While we accept email addresses as the username, autocomplete=username appears to be the correct value for use in a sign-in form.

Related resources:

📜 Testing Plan

Verify no console output:

  1. Go to http://localhost:3000
  2. Open Chrome DevTools console
  3. If dropdown shows "Default levels", expand and ensure "Verbose" is checked (screenshot)
  4. Refresh the page
  5. Verify no console output related to autocomplete attribute

Verify test coverage:

  1. git checkout main -- app/views/devise/sessions/new.html.erb
  2. rspec spec/features/accessibility/visitor_pages_spec.rb:6
  3. See output:
  1) Accessibility on pages that do not require authentication login / root path
     Failure/Error: raise BrowserConsoleLogError.new(javascript_errors) if javascript_errors.present?
     
     BrowserConsoleLogError:
       Unexpected browser console logging:
     
       http://127.0.0.1:58253/ - [DOM] Input elements should have autocomplete attributes (suggested: "username"): (More info: https://goo.gl/9p2vKq) %o

aduth added 2 commits December 5, 2024 11:19
Previously ignored informational messages
User-Facing Enhancements, Sign-in, Improve autocomplete compatibility for sign-in form
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants