From jari.bakken at gmail.com Thu Jun 4 21:51:16 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Fri, 5 Jun 2009 03:51:16 +0200 Subject: [Celerity-users] Show hide Divs In-Reply-To: References: <412BB2DA-C1D9-4755-B0CB-8DBD0FFC94F7@dinshawdesign.com> <283B4C38-F263-4DA9-A01F-C3B112553A85@dinshawdesign.com> <74948418-B187-457A-9444-8F4F1E4F05E7@gmail.com> Message-ID: <7B870F87-E4BD-46EC-8512-AD2579EB6D62@gmail.com> On 4. juni. 2009, at 22.16, Dinshaw Gobhai wrote: > > I have tried: > @browser.div(:id, 'foo').visible? This should return false if the div is hidden. If not, can you tell me how your div is styled when in the hidden state? > @browser.text.should_not =~ /Hidden form text/ Same as above. > @browser.html.should_not =~ /Hidden form text/ @browser.html returns the HTML response from the server (before any JS changes). So if this fails, then that text _does_ exist before any scripts are executed. > @browser.div(:id, 'foo').should_not =~ /Hidden form text/ This expectation should pass, since Celerity::Element does not override Object#=~ (which will always return false). This should pass as well: @browser.div(:id, 'foo').should_not =~ /Hidden form text/ > And even Hipricot parsing the output of @browser.html > > Did I miss something? > Hard to tell what's going on without seeing an example that will reproduce this. And as always, try installing the latest version of Celerity from GitHub to see if it resolves your issue. jb From jari.bakken at gmail.com Fri Jun 5 17:04:48 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Fri, 5 Jun 2009 23:04:48 +0200 Subject: [Celerity-users] Celerity and LiveQuery In-Reply-To: <6E35EC59-D8F9-40F8-8205-C7E79ACE3E68@dinshawdesign.com> References: <412BB2DA-C1D9-4755-B0CB-8DBD0FFC94F7@dinshawdesign.com> <283B4C38-F263-4DA9-A01F-C3B112553A85@dinshawdesign.com> <74948418-B187-457A-9444-8F4F1E4F05E7@gmail.com> <7B870F87-E4BD-46EC-8512-AD2579EB6D62@gmail.com> <6E35EC59-D8F9-40F8-8205-C7E79ACE3E68@dinshawdesign.com> Message-ID: On Fri, Jun 5, 2009 at 10:44 PM, Dinshaw Gobhai wrote: > has anyone been testing any thing with LiveQuery ( > http://docs.jquery.com/Plugins/livequery) ? > I have some forms that are replaced in the dom each time the form is > submitted (successfully) and the "re-hooked" by LiveQuery to submit async. > The LIveQuery hooks do not seem to be working and Culerity is posting the > forms synchronously. > > I have tried setting :resynchronize => true even though I am not really > sure what it does, but it didn't work. > Did you see my response to your previous email? http://rubyforge.org/pipermail/celerity-users/2009-June/000083.html (Not sure why your messages won't show up in the archive - anyone know anything about that)? I haven't used livequery, so can't help you unless you can show me some code that will reproduce the issue. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jari.bakken at gmail.com Fri Jun 5 18:56:49 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Sat, 6 Jun 2009 00:56:49 +0200 Subject: [Celerity-users] Celerity and LiveQuery In-Reply-To: <07787991-7D32-4B88-9B8B-E888FD483A43@dinshawdesign.com> References: <412BB2DA-C1D9-4755-B0CB-8DBD0FFC94F7@dinshawdesign.com> <283B4C38-F263-4DA9-A01F-C3B112553A85@dinshawdesign.com> <74948418-B187-457A-9444-8F4F1E4F05E7@gmail.com> <7B870F87-E4BD-46EC-8512-AD2579EB6D62@gmail.com> <6E35EC59-D8F9-40F8-8205-C7E79ACE3E68@dinshawdesign.com> <07787991-7D32-4B88-9B8B-E888FD483A43@dinshawdesign.com> Message-ID: On Sat, Jun 6, 2009 at 12:09 AM, Dinshaw Gobhai wrote: > > The really strange part is that even if i wait, refresh the page > (@browser.refresh), hit the page again (@browser.goto(' > http://localhost:3001/tasks'), or navigate away and then come back to the > page, it still fails to post asynchronously. > I guess by "fails to post asynchronously", you mean it does a full browser HTTP request? > This is the first time i am trying to post a form twice in the > same feature . Any thoughts would be appreciated. > If you could create a small example that will reproduce the problem, it would be a lot easier to help. You can try enabling JavaScript execptions and turn on full logging: Celerity::Browser.new(:javascript_exceptions => true, :log_level => :all) The :resynchronize => true setting makes sure that everything happens synchronously - so you don't have to explicitly wait for Ajax calls to finish. It's recommended whenever you have Ajax in your app. Is there some sort of cache anywhere in the Celerity @browser? > Yes, HtmlUnit will cache "compiled JavaScript files and parsed CSS snippets". You can clear this cache by calling @browser.clear_cache on Celerity versions >= 0.0.6.4 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jari.bakken at gmail.com Tue Jun 9 17:28:10 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Tue, 9 Jun 2009 23:28:10 +0200 Subject: [Celerity-users] Logger / js output for Rails and Culerity In-Reply-To: References: Message-ID: <517D9075-347A-40E3-B78D-170054145327@gmail.com> On 9. juni. 2009, at 20.27, Dinshaw Gobhai wrote: > Is there a way to do do some js debugging in a celerity session? > I found the HtmlUnit log docs but don't really see how to use it > through Rails and Culerity. My best suggestion is using alert() and in your Ruby code do browser.add_listener(:alert) { |page, message| ... } That will probably get quite annoying when browsing the app manually though. It would be great to be able to do console.debug(...) in JavaScript and have HtmlUnit expose that log somewhere. However, http://htmlunit.sourceforge.net/javascript.html says: > Testing pages with JavaScript on them can produce a number of > errors. These errors occur for several reasons. Some browsers accept > shortcuts that are not part of the DOM model and currently not > duplicated by HtmlUnit. Also, HtmlUnit still does not implement all > of the extensions that have been added by the different browsers. If you can convince someone to add the console object to HtmlUnit's JS implementation, I'll be happy to add support for it in Celerity. Their mailing lists are at http://htmlunit.sourceforge.net/mail-lists.html :) From info at dinshawdesign.com Fri Jun 12 18:12:10 2009 From: info at dinshawdesign.com (Dinshaw Gobhai) Date: Fri, 12 Jun 2009 18:12:10 -0400 Subject: [Celerity-users] Sessions and subdomains Message-ID: Seems that after setting a session for example.com, the @browser cannot set a session for sub.example.com. Is this 'works-as-designed'? or maybe a problem with my implementation? I am doing features for a registration wizard and ended up having to stop one scenario after my wizard redirected to a subdomain, and start a new one. We are using standard Rails session setters (eg session[:user_id] = 1) and cookie based storage. Thanks, -Dinshaw From jari.bakken at gmail.com Fri Jun 12 18:44:39 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Sat, 13 Jun 2009 00:44:39 +0200 Subject: [Celerity-users] Sessions and subdomains In-Reply-To: References: Message-ID: <674AC4B8-770B-448F-905D-EDF01DC96669@gmail.com> On 13. juni. 2009, at 00.12, Dinshaw Gobhai wrote: > Seems that after setting a session for example.com, the @browser > cannot set a session for sub.example.com. > > Is this 'works-as-designed'? or maybe a problem with my > implementation? > Celerity/HtmlUnit should work like normal browsers. > I am doing features for a registration wizard and ended up having to > stop one scenario after my wizard redirected to a subdomain, and start > a new one. > > We are using standard Rails session setters (eg session[:user_id] = 1) > and cookie based storage. > If you can provide an example that will reproduce the issue, I'll be happy to take a look. From info at dinshawdesign.com Mon Jun 15 23:21:55 2009 From: info at dinshawdesign.com (Dinshaw Gobhai) Date: Mon, 15 Jun 2009 23:21:55 -0400 Subject: [Celerity-users] ActionMailer Message-ID: I am running into some strange results trying to test emails. Is there anything diferent about how one should treat mailer tests when using Culerity? I am using the email_spec plugin and the method described for Cucumber but, inside the Celerity session i always get ActionMailer::Base.deliveries.size == 0. If I dubug and actually send an email (UserMailer.deliver_invite(user)), then I see it in the ActionMailer::Base.deliveries. The log shows the emails being sent normally. P.S. Thanks for you help on the other emails I have sent, Jari. It seems that the app I am working on has some non-standard implementations that I am just getting to know so please seemingly crazy questions. -Dinshaw