You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Igor Drobiazko <ig...@gmail.com> on 2011/07/02 13:38:26 UTC

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

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, <ff...@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

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

Posted by Taha Hafeez <ta...@gmail.com>.
Hi Francois

I found a better way

Tapestry.Initializer.zoneRefresh = function(params)
{
   //  Ensure a valid period. Not required as PeriodicalUpdater already
takes care of it
   // but will will skip unnecessary steps
   if(params.period <= 0)
   {
      return;
   }

   // Function to be called for each refresh
   var keepUpdatingZone = function(e)
   {
      var zoneObject = Tapestry.findZoneManagerForZone($(params.id));
      Tapestry.purgeChildren($(params.id));

      if (!zoneObject)
         return;

      zoneObject.updateFromURL(params.URL);
      e.stop();
   };

   // Create and store the executor
   timer = new PeriodicalExecuter(keepUpdatingZone, params.period);
};

Will send you the full patch with new tests. Thanks for your patience

regards
Taha


2011/7/3 françois facon <fr...@gmail.com>

> Thank you Taha,
>
> I would be fine to check the current state of the client pool of ajax
> connections.
> But I'am afraid the condition depend on the way Prototype manage his pool.
> I guess it will failed when T5.ajax (TAP5-999) will be ready to call.
> Gasp!
>
>
> 2011/7/2 Taha Hafeez <ta...@gmail.com>:
> > 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 <fr...@gmail.com>
> >>
> >> Thanks for your advise Igor.
> >> I will change that test.
> >> Regards
> >> François
> >>
> >> 2011/7/2 Igor Drobiazko <ig...@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, <ff...@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
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

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

Posted by françois facon <fr...@gmail.com>.
Thank you Taha,

I would be fine to check the current state of the client pool of ajax
connections.
But I'am afraid the condition depend on the way Prototype manage his pool.
I guess it will failed when T5.ajax (TAP5-999) will be ready to call.
Gasp!


2011/7/2 Taha Hafeez <ta...@gmail.com>:
> 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 <fr...@gmail.com>
>>
>> Thanks for your advise Igor.
>> I will change that test.
>> Regards
>> François
>>
>> 2011/7/2 Igor Drobiazko <ig...@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, <ff...@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
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


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

Posted by Taha Hafeez <ta...@gmail.com>.
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 <fr...@gmail.com>

> Thanks for your advise Igor.
> I will change that test.
> Regards
> Fran�ois
>
> 2011/7/2 Igor Drobiazko <ig...@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, <ff...@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
>
>

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

Posted by françois facon <fr...@gmail.com>.
Thanks for your advise Igor.
I will change that test.
Regards
François

2011/7/2 Igor Drobiazko <ig...@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, <ff...@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