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

Jifty commits jifty-commit at lists.jifty.org
Fri Feb 8 12:08:23 EST 2008


Author: gugod
Date: Fri Feb  8 12:08:22 2008
New Revision: 5078

Added:
   jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/Dispatcher.pm
Modified:
   jifty/branches/jquery/t/TestApp-JiftyJS/t/5-action.t
   jifty/branches/jquery/t/TestApp-JiftyJS/t/6-offer-actions.t

Log:
Add an default dispatcher rule to allow AddTwoNumber action for testing.
Found a way to pause after certain actions rather then set_speed(1000),
which make it pretty slow to finish the whole test suite


Added: jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/Dispatcher.pm
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/t/TestApp-JiftyJS/lib/TestApp/JiftyJS/Dispatcher.pm	Fri Feb  8 12:08:22 2008
@@ -0,0 +1,11 @@
+package TestApp::JiftyJS::Dispatcher;
+use strict;
+use warnings;
+use Jifty::Dispatcher -base;
+
+before '*' => run {
+    Jifty->api->allow("AddTwoNumbers");
+};
+
+1;
+

Modified: jifty/branches/jquery/t/TestApp-JiftyJS/t/5-action.t
==============================================================================
--- jifty/branches/jquery/t/TestApp-JiftyJS/t/5-action.t	(original)
+++ jifty/branches/jquery/t/TestApp-JiftyJS/t/5-action.t	Fri Feb  8 12:08:22 2008
@@ -8,11 +8,13 @@
 use Jifty::Test::WWW::Selenium;
 use utf8;
 
-if ($ENV{'SELENIUM_RC_BROWSER'} eq '*iexplore') {
-    plan(skip_all => "Temporarily, until the 'Operation Abort' bug is solved.");
-}
-else {
-    plan(tests => 10);
+BEGIN {
+    if ($ENV{'SELENIUM_RC_BROWSER'} eq '*iexplore') {
+        plan(skip_all => "Temporarily, until the 'Operation Abort' bug is solved.");
+    }
+    else {
+        plan(tests => 10);
+    }
 }
 
 my $server = Jifty::Test->make_server;
@@ -20,7 +22,10 @@
 my $URL    = $server->started_ok;
 
 $sel->open("/");
-$sel->set_speed(1000);
+
+if ($ENV{'SELENIUM_RC_BROWSER'} eq '*iexplore') {
+    $sel->set_speed(1000);
+}
 
 {
     # Test "Play" action's parameter.
@@ -36,17 +41,24 @@
     $sel->type_ok($tags, "FOO");
     $sel->fire_event($tags, "blur");
 
+    $sel->pause(1000);
+
     my $tag_value = $sel->get_value($tags);
     is $tag_value, 'foo', "Tags are canonicalized to lower-case";
 
     $sel->type_ok($mood, "FOO");
     $sel->fire_event($tags, "blur");
+    $sel->pause(1000);
+
     is($sel->get_text('//span[contains(@class, "error text argument-mood")]'),
        "That doesn't look like a correct value",
        "mood validation error");
 
     $sel->type_ok($mood, "angry");
     $sel->fire_event($tags, "blur");
+
+    $sel->pause(1000);
+
     is($sel->get_text('//span[contains(@class, "error text argument-mood")]'),
        "",
        "mood validation ok");

Modified: jifty/branches/jquery/t/TestApp-JiftyJS/t/6-offer-actions.t
==============================================================================
--- jifty/branches/jquery/t/TestApp-JiftyJS/t/6-offer-actions.t	(original)
+++ jifty/branches/jquery/t/TestApp-JiftyJS/t/6-offer-actions.t	Fri Feb  8 12:08:22 2008
@@ -23,7 +23,6 @@
 my $URL    = $server->started_ok;
 
 $sel->open("/");
-$sel->set_speed(1000);
 
 for (@commands) {
     my ($cmd, $arg1, $arg2) = (split(/\n\s*/, $_, 3), "", "");
@@ -50,6 +49,9 @@
 click
     xpath=//div[contains(@class,"submit_button")]//input
 
+pause
+    1000
+
 wait_for_element_present
     xpath=//span[contains(@class, "value")][contains(@class, "argument-name")][contains(@class, "text")]
 
@@ -80,6 +82,9 @@
 click
     xpath=//div[@class="submit_button"]/input[@type="submit"][contains(@name,"J:ACTIONS=auto-")]
 
+pause
+    1000
+
 wait_for_element_present
     xpath=//input[@type="checkbox"][@checked]
 


More information about the Jifty-commit mailing list