[Jifty-commit] r5234 - in jifty/branches/jquery/t/TestApp-JiftyJS: lib/TestApp/JiftyJS

Jifty commits jifty-commit at lists.jifty.org
Wed Mar 26 10:35:03 EDT 2008


Author: gugod
Date: Wed Mar 26 10:35:02 2008
New Revision: 5234

Added:
   jifty/branches/jquery/t/TestApp-JiftyJS/t/8-placeholder.t
Modified:
   jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/View.pm

Log:
Add a failure test for placeholder js bug.


Modified: jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/View.pm
==============================================================================
--- jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/View.pm	(original)
+++ jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/View.pm	Wed Mar 26 10:35:02 2008
@@ -221,11 +221,25 @@
     my $action = new_action(class => 'Play2', moniker => "play2");
     form {
         render_action($action);
+
         form_next_page( url => "/redirected");
         form_submit( label => "Submit" );
     };
 };
 
+template '/act/play3' => page {
+    my $action = new_action(moniker => "play2", class => "Play2");
+    form {
+        $action
+            ->form_field('text',
+                         label => "Hi",
+                         sticky => 0,
+                         placeholder => "foobar click me to enter text")
+            ->render();
+        form_submit( label => "Submit" );
+    };
+};
+
 template '/redirected' => page {
     p { "Redirected!" }
 };

Added: jifty/branches/jquery/t/TestApp-JiftyJS/t/8-placeholder.t
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/t/TestApp-JiftyJS/t/8-placeholder.t	Wed Mar 26 10:35:02 2008
@@ -0,0 +1,45 @@
+# Test Action
+
+use strict;
+use warnings;
+use lib 't/lib';
+use Jifty::SubTest;
+use Jifty::Test;
+use Jifty::Test::WWW::Selenium;
+use utf8;
+
+BEGIN {
+    if (($ENV{'SELENIUM_RC_BROWSER'}||'') eq '*iexplore') {
+        plan(skip_all => "Temporarily, until the 'Operation Abort' bug is solved.");
+    }
+    else {
+        plan(tests => 4);
+    }
+}
+
+my $server = Jifty::Test->make_server;
+my $sel    = Jifty::Test::WWW::Selenium->rc_ok($server);
+my $URL    = $server->started_ok;
+
+$sel->open("/");
+
+$sel->set_speed(1000);
+
+{
+    # Test placeholder
+    $sel->open_ok("/act/play3");
+
+    my $input = 'css=input.placeholder';
+
+    $sel->is_element_present($input);
+    my $text = $sel->get_value($input);
+
+    is( $text, "foobar click me to enter text", "Initial content in the placeholder." );
+
+    $sel->click_ok($input);
+    $sel->fire_event($input, "focus");
+
+    is( $sel->get_value($input), "", "Placeholder goes empty after clicking on it" );
+}
+
+$sel->stop;


More information about the Jifty-commit mailing list