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.
  • Loading branch information...
1 parent c88c90a commit cf0d14907c008156dcc8d85021db74f0ef162c0b @sarcas committed 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
View
@@ -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 cf0d149

Please sign in to comment.