tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taha Hafeez <tawus.tapes...@gmail.com>
Subject Re: svn commit: r1142187 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/ main/java/org/apache/tapestry5/corelib/mixins/ main/resources/org/apache/tapestry5/corelib/mixins/ test/app1/ test/conf/ test/java/org/apache/t
Date Sat, 02 Jul 2011 17:09:51 GMT
Hi Francois

I googled about waitFor... methods and found this
http://agilesoftwaretesting.com/?p=111

The waitFor methods get messed up as the page that three zones which were
refreshing. So, I created two separate tests

also i replaced the checkZoneValues() method to

   private void checkZoneValues(String zone, int times) throws Exception
   {
      for(int i = 1; i <= times; ++i)
      {
         //Wait for ajax call to begin

 waitForCondition("selenium.browserbot.getCurrentWindow().Ajax.activeRequestCount
!= 0", "20000");

         //Wait for ajax call from end

 waitForCondition("selenium.browserbot.getCurrentWindow().Ajax.activeRequestCount
== 0", "20000");

         //Check the value changed
         assertText(zone, String.valueOf(i));
      }
   }

It first waits for a ajax call to begin and then waits for it to end and
then checks the value. So it will be good enough for even a slow server (20
seconds wait)

Thanks Igor for pointing it out and very very thanks Francois for adding
this patch

regards
Taha


2011/7/2 fran├žois facon <fra.facon@gmail.com>

> Thanks for your advise Igor.
> I will change that test.
> Regards
> Fran├žois
>
> 2011/7/2 Igor Drobiazko <igor.drobiazko@gmail.com>:
> > It's highly likely that this wait condition will break the build once the
> > build machine is busy. You should make use of Selenium's wait conditions.
> > Check out the wait methods like waitForElementToAppear, etc.
> >
> > On Sat, Jul 2, 2011 at 12:14 PM, <ffacon@apache.org> wrote:
> >>
> >> +
> >> +
> >> +   private void checkZoneValues(String zone, int times) throws
> Exception
> >> +   {
> >> +      Thread.sleep(300);
> >> +      for(int i = 0; i < times; ++i)
> >> +      {
> >> +         assertText(zone, String.valueOf(i));
> >> +         Thread.sleep(1000);
> >> +      }
> >> +   }
> >> +
> >> +}
> >
> >
> >
> > --
> > Best regards,
> >
> > Igor Drobiazko
> > http://tapestry5.de
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

Mime
View raw message