IRC Archive for channel #xwiki on 07 September 2008

Last modified by Vincent Massol on 2012/10/18 18:30

xwikibot - (07/09/2008 17:06): XWiki.HelderMassango was modified by XWiki.HelderMassango (Created user) - http://www.xwiki.org/xwiki/bin/view/XWiki/HelderMassango
jvelociter - (07/09/2008 17:51): vmassol: Hello, are you there ?
vmassol - (07/09/2008 17:51): jvelociter: yes...
jvelociter - (07/09/2008 17:52): If you have some time, I have a question for you
jvelociter - (07/09/2008 17:53): a question you will not like I'm sure :) : do you know a way or a workaround to "just wait" in selenium, not wait for something ?
jvelociter - (07/09/2008 17:55): I finally understand why my two tests do fail : at some point I open a page and it happens faster that the notification (old fashioned XWikiNotification) upon a document change I did just before, so the result I'm expecting is not available yet
jvelociter - (07/09/2008 17:58): I could use thread.sleep I guess
vmassol - (07/09/2008 18:14): jvelociter: no you should never wait
vmassol - (07/09/2008 18:15): never never never :)
jvelociter - (07/09/2008 18:15): :) I expected that line
jvelociter - (07/09/2008 18:15): but how can I do then ?
jvelociter - (07/09/2008 18:15): click here and there to wait the notification to happen ?
vmassol - (07/09/2008 18:15): wait for something
jvelociter - (07/09/2008 18:15): it's just the same
vmassol - (07/09/2008 18:15): same as what?
jvelociter - (07/09/2008 18:15): it's not AJAX
vmassol - (07/09/2008 18:16): it doesn't matter
jvelociter - (07/09/2008 18:16): same as Thread.sleep
vmassol - (07/09/2008 18:16): you should always wait for something
vmassol - (07/09/2008 18:16): and it's not the same at all
vmassol - (07/09/2008 18:16): in one case you have a fragile test
vmassol - (07/09/2008 18:16): that'll fail from time to time
vmassol - (07/09/2008 18:16): in the other case you have test that is strong and will never fail
jvelociter - (07/09/2008 18:17): but I don't see anything I can wait for in my case
vmassol - (07/09/2008 18:17): there are alwayd things
vmassol - (07/09/2008 18:17): you say you open a page
vmassol - (07/09/2008 18:17): if you use the open() api then it already waits
vmassol - (07/09/2008 18:17): so that is not the problem
jvelociter - (07/09/2008 18:18): let me rephrase my problem
vmassol - (07/09/2008 18:18): it's something else
jvelociter - (07/09/2008 18:18): I open the page, it opens good and fast, but actually _too_ fast : the XWikiNotification which result I want to check is not happened already
jvelociter - (07/09/2008 18:18): I do this :
jvelociter - (07/09/2008 18:18): 1/ edit and save a page that triggers a XWikiNotification
jvelociter - (07/09/2008 18:19): 2/ Open a page where I can check the result of this notification
jvelociter - (07/09/2008 18:19): but there is no way I can be sure the notification has done its job (which is write something in the DB) when I open the page
jvelociter - (07/09/2008 18:19): do you see what I mean ?
vmassol - (07/09/2008 18:19): notifications are asynchronous?
vmassol - (07/09/2008 18:19): (yes there are several ways)
jvelociter - (07/09/2008 18:19): yes, I think so
vmassol - (07/09/2008 18:20): I don't think so
jvelociter - (07/09/2008 18:20): let me check
vmassol - (07/09/2008 18:20): that's teh first thing to check
vmassol - (07/09/2008 18:20): but if it were
vmassol - (07/09/2008 18:20): you could do this:
vmassol - (07/09/2008 18:20): open the page and verify if the result is there
vmassol - (07/09/2008 18:21): if not, wait for 100ms and refresh the page, repeat till you get the result or there's a timeout
jvelociter - (07/09/2008 18:21): well : this is wait 
vmassol - (07/09/2008 18:21): this is basically implementing the waitForCondition
jvelociter - (07/09/2008 18:21): ok I see
vmassol - (07/09/2008 18:21): sure but that's ok since there's the check
vmassol - (07/09/2008 18:21): what shouldn't be done is thus wait some amount of time
vmassol - (07/09/2008 18:22): and expect that it'll be ready by that time
jvelociter - (07/09/2008 18:22): ok, got it
vmassol - (07/09/2008 18:22): s/thus/just
jvelociter - (07/09/2008 18:22): indeed, notifications seems synchronous
jvelociter - (07/09/2008 18:22): so I still don't understand wtf happens in my tests :)
vmassol - (07/09/2008 18:23): yep you need to trace that, maybe it's the write to the db
jvelociter - (07/09/2008 18:23): I downloaded the distrib after hudson's test run, and the data is actually there
jvelociter - (07/09/2008 18:24): but it's not there by the time I check it in the tests...
jvelociter - (07/09/2008 18:32): damned I'm blind
jvelociter - (07/09/2008 18:33): it was just in the front of me from the beginning
vmassol - (07/09/2008 18:33): :)
vmassol - (07/09/2008 18:46): jvelociter: I think clickEditSaveAndView should always do a waitPage, WDYT?
jvelociter - (07/09/2008 18:47): yes, that might be safer
jvelociter - (07/09/2008 18:47): every click on the buttom buttons actually
vmassol - (07/09/2008 18:47): no
vmassol - (07/09/2008 18:47): yes
vmassol - (07/09/2008 18:47): sorry
vmassol - (07/09/2008 18:47): :)
jvelociter - (07/09/2008 18:48): :)
vmassol - (07/09/2008 18:51): jvelociter: the wait is already there
vmassol - (07/09/2008 18:51): there's no need for waitPage that you added
jvelociter - (07/09/2008 18:52): oh you are right
jvelociter - (07/09/2008 18:52): is on clickLinkWithLocator(locator, true);
vmassol - (07/09/2008 18:52): yes

Get Connected