Permalink
Browse files

Issue #1381: Autofocus on Email field on Login page

Wrote a simple test to check for the autofocus attribute on the Login page -
there isn't another way to check for this behaviour using SimpleTest as far as I can tell.

Added the attribute to the user field on the login page. All compatible browsers
will accept this.

Closes #1381, closes #1399
  • Loading branch information...
1 parent d02963a commit 5da1a7a88960bf31dbdde1e2e89f8b0395031212 @sarcas sarcas committed with ginatrapani Oct 22, 2012
Showing with 7 additions and 2 deletions.
  1. +6 −1 tests/WebTestOfLogin.php
  2. +1 −1 webapp/_lib/view/session.login.tpl
@@ -94,4 +94,9 @@ public function testLoginLockout() {
$i = $i + 1;
}
}
-}
+
+ public function testAutofocusOnUserField() {
+ $this->get($this->url.'/session/login.php');
+ $this->assertPattern('/autofocus="autofocus"/');
+ }
+}
@@ -22,7 +22,7 @@
</label>
</div>
<div class="grid_10 left">
- <input type="text" name="email" id="email"{if isset($email)} value="{$email|filter_xss}"{/if}>
+ <input type="text" name="email" id="email"{if isset($email)} value="{$email|filter_xss}"{/if} autofocus="autofocus">
</div>
</div>
<div class="clearfix">

0 comments on commit 5da1a7a

Please sign in to comment.