From joahking at gmail.com Sat Feb 14 15:36:33 2009 From: joahking at gmail.com (Joaquin Rivera Padron) Date: Sat, 14 Feb 2009 21:36:33 +0100 Subject: [Celerity-users] asserting browser location Message-ID: <8277b7f40902141236j70c98330g1174c7ed9e745f2b@mail.gmail.com> hello there, have started using celerity (and culerity) with cucumber and looks pretty good, I have searched through docs and examples but did not seem to find this here: how could I do something like? browser.location.should == some_path and how about being able to do this: Then I should not navigate away and the step maybe like this: browser.last_location == browser.location to spec browser does not navigate away from current page. what do you think? does that make sense? forgive the newbiness cheers joaquin -- www.least-significant-bit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From joahking at gmail.com Sat Feb 14 15:50:00 2009 From: joahking at gmail.com (Joaquin Rivera Padron) Date: Sat, 14 Feb 2009 21:50:00 +0100 Subject: [Celerity-users] asserting browser location In-Reply-To: <8277b7f40902141236j70c98330g1174c7ed9e745f2b@mail.gmail.com> References: <8277b7f40902141236j70c98330g1174c7ed9e745f2b@mail.gmail.com> Message-ID: <8277b7f40902141250q7da6e500r6c70477eae56b041@mail.gmail.com> ok, got it exactly 5 minutes after asking and cloning celerity from github. browser.url is the one thanks joaquin 2009/2/14 Joaquin Rivera Padron > hello there, > have started using celerity (and culerity) with cucumber and looks pretty > good, I have searched through docs and examples but did not seem to find > this here: how could I do something like? > > browser.location.should == some_path > > and how about being able to do this: > > Then I should not navigate away > > and the step maybe like this: > > browser.last_location == browser.location > > to spec browser does not navigate away from current page. what do you > think? does that make sense? > > forgive the newbiness > cheers > joaquin > > -- > www.least-significant-bit.com > -- www.least-significant-bit.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashley.moran at patchspace.co.uk Sat Feb 14 16:16:33 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Sat, 14 Feb 2009 21:16:33 +0000 Subject: [Celerity-users] asserting browser location In-Reply-To: <8277b7f40902141236j70c98330g1174c7ed9e745f2b@mail.gmail.com> References: <8277b7f40902141236j70c98330g1174c7ed9e745f2b@mail.gmail.com> Message-ID: <2208A785-48C2-4559-9F0C-C017D0C96151@patchspace.co.uk> On 14 Feb 2009, at 20:36, Joaquin Rivera Padron wrote: > have started using celerity (and culerity) with cucumber and looks > pretty good, Hi Joaquin Welcome to the club of Cucumber+Celerity users =) I am a huge fan of both, although I don't use nearly as many of the features of Celerity as I'm sure I could > I have searched through docs and examples but did not seem to find > this here: how could I do something like? > > browser.location.should == some_path I do this with @browser.url.should =~ %r|/items/new| or whatever... > and how about being able to do this: > > Then I should not navigate away > > and the step maybe like this: > > browser.last_location == browser.location > > to spec browser does not navigate away from current page. what do > you think? does that make sense? There's a Browser#back method, but I've never used it. Does that help? > forgive the newbiness If you're never a newbie you're never learning something new! You may find a crude example of Celerity and Cumumber I wrote ages ago[1] of some use. Let me know if you find it helpful, as I'm planning to do a repeat of this talk. (Much as I'd like, I don't get time to prepare much new BDD material...) Ashley [1] http://aviewfromafar.net/2008/10/2/geekup-sheffield-vi-from-specification-to-success -- http://www.patchspace.co.uk/ http://aviewfromafar.net/ http://twitter.com/ashleymoran From joahking at gmail.com Sun Feb 15 06:49:09 2009 From: joahking at gmail.com (Joaquin Rivera Padron) Date: Sun, 15 Feb 2009 12:49:09 +0100 Subject: [Celerity-users] asserting browser location In-Reply-To: <2208A785-48C2-4559-9F0C-C017D0C96151@patchspace.co.uk> References: <8277b7f40902141236j70c98330g1174c7ed9e745f2b@mail.gmail.com> <2208A785-48C2-4559-9F0C-C017D0C96151@patchspace.co.uk> Message-ID: <8277b7f40902150349q10076b96sdb162b3288c70f9a@mail.gmail.com> hey Ashley, thank for the answers, regarding your Ramaze project at GeekUp I have already play with it :-) yesterday, found it useful. thanks for sharing joaquin -------------- next part -------------- An HTML attachment was scrubbed... URL: From tinius.alexander at lystadonline.no Mon Feb 16 19:57:55 2009 From: tinius.alexander at lystadonline.no (T. Alexander Lystad) Date: Tue, 17 Feb 2009 01:57:55 +0100 Subject: [Celerity-users] This is a test message :) Message-ID: <499A0B93.40703@lystadonline.no> Did you expect something interesting here? -- T. Alexander Lystad www.lystadonline.com From saimonmoore at gmail.com Thu Feb 19 07:00:35 2009 From: saimonmoore at gmail.com (Saimon Moore) Date: Thu, 19 Feb 2009 13:00:35 +0100 Subject: [Celerity-users] Testing for delayed javascript actions... Message-ID: Hi all, I've just discovered celerity and I'm using it in conjunction with cucumber to write acceptance tests for my application. However, I've come up across a problem I'm not sure how I can solve. I've written a basic login feature that mostly works fine. What actually happens during the log in process is that, once successfully logged in, the user is redirected to their own home page. Once the dom on that page is loaded, the user is logged into their jabber account (via bosh). A successfull connection is indicated by the fact that a js callback changes the src of the user's avatar img to the online version (this usually happends a couple of seconds after the page has loaded). So in my login feature, I'm trying to detect this switch of the avatar src but have been unable to do so. I've tried: @browser.wait_until { @browser.images.any? {|img| img.src =~ /tiny_online.png/ } } I've tried sleeping just after the login... No matter what I try, it appears as if the switch is never happening. The weird thing is that if when running the feature I use a celerity viewer ( and create snapshots) I can see that the switch has indeed occurred as the avatar shown is the online version. I'm not sure what else to try at this stage, short of switching back to firewatir (which now that've found celerity I really don't want to do). I'd appreciate any pointers... Regards, Saimon From saimonmoore at gmail.com Thu Feb 19 10:56:07 2009 From: saimonmoore at gmail.com (Saimon Moore) Date: Thu, 19 Feb 2009 16:56:07 +0100 Subject: [Celerity-users] Testing for delayed javascript actions... In-Reply-To: References: Message-ID: Hi Jari... Well I only got one copy so I guess it's the cc to me that got through. (ccing you too just in case) See inline... On Thu, Feb 19, 2009 at 2:05 PM, Jari Bakken wrote: > Hi Saimon, > >> So in my login feature, I'm trying to detect this switch of the avatar >> >> src but have been unable to do so. > > Some suggestions: > * Try with the latest gem from > github: http://github.com/jarib/celerity/tree/master I am :) (dadd32724dba8853e43b2abf0f6702e6a078e830) > * Read http://wiki.github.com/jarib/celerity/ajax > * Make sure to run the browser with full logging + javascript exceptions so > nothing goes unnoticed: > Browser.new(:log_level => :all, :javascript_exceptions => true) Hmm I was using :finest. Not sure if there's any difference or not. My current declaration: @browser = Celerity::Browser.new(:browser => :firefox, :resynchronize => true, :css => true, :log_level => :all, :javascript_exceptions => true) > Two options for synchronizing HtmlUnit (mentioned on the wiki): > * Call Browser.wait() after the action that triggers the JS stuff. (This > makes HtmlUnit wait for all jobs to finish before continuing). Tried this. What I do is call browser.wait just after I submit the form. > * Use HtmlUnit synchronization by either: I should have tried this earlier. It's helped in that now I know there seems to be a problem establishing the bosh session when using htmlunit. I need to figure out why that is when ff/webkit have no such problem. Thanks again, I think I'm going to fork and start contributing back... > Browser.new(:resynchronize => true) > or just for a specific part of your code: > browser.resynchronized do > # ... trigger js ... > end > >> >> The weird thing is that if when running the feature I use a celerity >> >> viewer ( and create snapshots) I can see that the switch has indeed >> >> occurred as the avatar shown is the online version. > > The viewers are essentially a hack and won't always show you the correct > representation of Celerity's DOM state. This is because it simply hands the > current HTML to the viewer, and you might see DOM changes happen that is > caused by the viewer itself evaluating javascript (before Celerity has > updated the page again). I know this can be quite confusing when dealing > with Ajax stuff. > Hope this helps! > > PS. I've had some issues replying to the list - hope this gets through ok. -- Saimon Moore Freelance Web Developer (Available for hire - For details visit http://saimonmoore.net) Skype: saimonmoore Yahoo IM: saimonmoore Google IM: saimonmoore From jari.bakken at gmail.com Thu Feb 19 11:17:11 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Thu, 19 Feb 2009 17:17:11 +0100 Subject: [Celerity-users] Testing for delayed javascript actions... In-Reply-To: References: Message-ID: > > > > I should have tried this earlier. It's helped in that now I know there > seems to be a problem establishing the bosh session when using > htmlunit. I need to figure out why that is when ff/webkit have no such > problem. OK. If you find issues with HtmlUnit, their mailing list is quiet active and they are very responsive. > > > Thanks again, > > I think I'm going to fork and start contributing back... > Great! -------------- next part -------------- An HTML attachment was scrubbed... URL: From saimonmoore at gmail.com Fri Feb 20 08:21:36 2009 From: saimonmoore at gmail.com (Saimon Moore) Date: Fri, 20 Feb 2009 14:21:36 +0100 Subject: [Celerity-users] Testing for delayed javascript actions... In-Reply-To: References: Message-ID: Just a FYI, I tracked down the problem to the fact that htmlunit's XmlDocument.xml method was generating an extra <#document> tag wrapped around the real xml (for whatever reason). I've hacked my bosh client to remove that tag before sending to the server and things are working great. I've also sent an email to the htmlunit enquiring about this behaviour but I'm having trouble getting through to the list too... Thanks, Saimon On Thu, Feb 19, 2009 at 5:17 PM, Jari Bakken wrote: >> >> >> I should have tried this earlier. It's helped in that now I know there >> seems to be a problem establishing the bosh session when using >> htmlunit. I need to figure out why that is when ff/webkit have no such >> problem. > > OK. If you find issues with HtmlUnit, their mailing list is quiet active and > they are very responsive. > >> >> Thanks again, >> >> I think I'm going to fork and start contributing back... > > Great! > -- Saimon Moore Freelance Web Developer (Available for hire - For details visit http://saimonmoore.net) Skype: saimonmoore Yahoo IM: saimonmoore Google IM: saimonmoore From ashley.moran at patchspace.co.uk Fri Feb 20 10:42:42 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Fri, 20 Feb 2009 15:42:42 +0000 Subject: [Celerity-users] Celerity LinkedIn Group Message-ID: <6586E603-47B0-4CAE-9D1C-2FB792D8F6DE@patchspace.co.uk> Hi all I created a Celerity LinkedIn group[1] if anyone wants to join. Prob should have asked here if anyone wanted to run one, but I ended up doing the RSpec/Cucumber one. If anyone on the Celerity team wants to be a manager or even just claim the thing, please let me know. Also, hope nobody objects to the blatant theft of the Celerity site logo =) Ashley [1] http://www.linkedin.com/e/vgh/1814903/eml-grp-sub/ -- http://www.patchspace.co.uk/ http://aviewfromafar.net/ http://twitter.com/ashleymoran From joahking at gmail.com Fri Feb 20 12:41:35 2009 From: joahking at gmail.com (Joaquin Rivera Padron) Date: Fri, 20 Feb 2009 18:41:35 +0100 Subject: [Celerity-users] Celerity LinkedIn Group In-Reply-To: <6586E603-47B0-4CAE-9D1C-2FB792D8F6DE@patchspace.co.uk> References: <6586E603-47B0-4CAE-9D1C-2FB792D8F6DE@patchspace.co.uk> Message-ID: <8277b7f40902200941n5260573aka0cbf01406e45723@mail.gmail.com> cool Ashley, I am there waiting for your approval :-) cheers joaquin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jari.bakken at gmail.com Fri Feb 20 12:54:37 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Fri, 20 Feb 2009 18:54:37 +0100 Subject: [Celerity-users] Celerity LinkedIn Group In-Reply-To: <6586E603-47B0-4CAE-9D1C-2FB792D8F6DE@patchspace.co.uk> References: <6586E603-47B0-4CAE-9D1C-2FB792D8F6DE@patchspace.co.uk> Message-ID: <23A75A42-AEEF-49C4-B589-982258ACE4EE@gmail.com> Great, Ashley! Guess I need to get a LinkedIn account now. :) Den 20. feb.. 2009 kl. 16.42 skrev Ashley Moran : > Hi all > > I created a Celerity LinkedIn group[1] if anyone wants to join. > Prob should have asked here if anyone wanted to run one, but I ended > up doing the RSpec/Cucumber one. If anyone on the Celerity team > wants to be a manager or even just claim the thing, please let me > know. Also, hope nobody objects to the blatant theft of the > Celerity site logo =) > > Ashley > > [1] http://www.linkedin.com/e/vgh/1814903/eml-grp-sub/ > > > -- > http://www.patchspace.co.uk/ > http://aviewfromafar.net/ > http://twitter.com/ashleymoran > > > > _______________________________________________ > Celerity-users mailing list > Celerity-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/celerity-users From joahking at gmail.com Mon Feb 23 04:15:20 2009 From: joahking at gmail.com (Joaquin Rivera Padron) Date: Mon, 23 Feb 2009 10:15:20 +0100 Subject: [Celerity-users] cucumber now runs Celerity and Webrat together Message-ID: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> hey there, I have Cucumber running Webrat and Celerity (using culerity) together, check it out in the sample project: http://github.com/joahking/cukes/tree/masters It's a first try, but it runs. I get them by following a feature directory structure similar to the suggested in http://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium (also thanks to the hints Ben Mabbey pointed) by defining profiles for webrat and celerity you can run features with any of them: cucumber -p webrat and cucumber -p celerity only I don't seem to get Celerity browser to receive the ajax pushing from rails action (have tried browser.wait, also other recommendations from celerity github wiki, but it wont go) I will dig into culerity to see the internals (I am new to the project too), maybe there's some issue with the proxy objects it uses or something, but any help would be appreciated. cheers, joaquin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jari.bakken at gmail.com Mon Feb 23 06:12:49 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Mon, 23 Feb 2009 12:12:49 +0100 Subject: [Celerity-users] cucumber now runs Celerity and Webrat together In-Reply-To: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> References: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> Message-ID: <1BE97F41-31CD-4CD6-9251-821998E53F77@gmail.com> On 23. feb.. 2009, at 10.15, Joaquin Rivera Padron wrote: > hey there, > I have Cucumber running Webrat and Celerity (using culerity) > together, check it out in the sample project: > http://github.com/joahking/cukes/tree/masters > Cool. You might be interested in the work being done on a Celerity adapter for Webrat here: http://github.com/kamal/webrat/tree/master > only I don't seem to get Celerity browser to receive the ajax > pushing from rails action (have tried browser.wait, also other > recommendations from celerity github wiki, but it wont go) Works for me with Celerity directly, with resynchronization enabled: browser = Celerity::Browser.new(:resynchronize => true) browser.goto "localhost:80/cukes" browser.text.match /ajaxed cukes/ # => nil browser.link(:text, 'ajax link').click browser.text.match /ajaxed cukes/ # => # From ashley.moran at patchspace.co.uk Mon Feb 23 06:42:36 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Mon, 23 Feb 2009 11:42:36 +0000 Subject: [Celerity-users] cucumber now runs Celerity and Webrat together In-Reply-To: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> References: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> Message-ID: <58F0A089-41FC-4A42-B101-644AF03FC100@patchspace.co.uk> On 23 Feb 2009, at 09:15, Joaquin Rivera Padron wrote: > I have Cucumber running Webrat and Celerity (using culerity) > together, check it out in the sample project: > http://github.com/joahking/cukes/tree/masters Hi Joaquin Without judgement - if you are using Celerity, what is the advantage of also using Webrat? Ashley -- http://www.patchspace.co.uk/ http://aviewfromafar.net/ http://twitter.com/ashleymoran From joahking at gmail.com Mon Feb 23 08:04:38 2009 From: joahking at gmail.com (Joaquin Rivera Padron) Date: Mon, 23 Feb 2009 14:04:38 +0100 Subject: [Celerity-users] cucumber now runs Celerity and Webrat together In-Reply-To: <58F0A089-41FC-4A42-B101-644AF03FC100@patchspace.co.uk> References: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> <58F0A089-41FC-4A42-B101-644AF03FC100@patchspace.co.uk> Message-ID: <8277b7f40902230504j4f7e2a91lb1d3d9b35b7b0d96@mail.gmail.com> yes, good question... I don't know Ashley... I guess mainly because of speed concerns (of course I would have to prove that with benchmarks and such) but it feels like celerity is slower(?) than webrat. What are you observing? is the slowness not too critical? but maybe it would be useful being able to start using cucumber+webrat and when the ajax testing moment comes the switch can be made as painless as possible (this part is easily achieveable, as it seems now). I am not opposed to change my mind, it's mainly learning and experimentation, and speed concerns at the moment, should I give testjour a try? also I am using culerity mainly because it was the fastest (the only, actually :-> ) way I've tried to get things running, but there are issues that are making me want to jump directly into celerity... I'll take a detailed tour through celerity.rubyforge ... I've been playing with this idea of getting both running for 2 weekends now, but the time comes when results (the main project is waiting for its ajax tests) are a must and then experimentation should loose some weight... (let's see) so please feel free to ask, advice and/or everything, always learning mindframe here :-) by the way, celerity does rock! thanks for the answers joaquin -------------- next part -------------- An HTML attachment was scrubbed... URL: From joahking at gmail.com Mon Feb 23 09:29:09 2009 From: joahking at gmail.com (Joaquin Rivera Padron) Date: Mon, 23 Feb 2009 15:29:09 +0100 Subject: [Celerity-users] cucumber now runs Celerity and Webrat together In-Reply-To: <8277b7f40902230504j4f7e2a91lb1d3d9b35b7b0d96@mail.gmail.com> References: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> <58F0A089-41FC-4A42-B101-644AF03FC100@patchspace.co.uk> <8277b7f40902230504j4f7e2a91lb1d3d9b35b7b0d96@mail.gmail.com> Message-ID: <8277b7f40902230629u1b1fc81fha2b0fd7c8fe4fb37@mail.gmail.com> hey Jari, you got it running, cool, seems like it could be a culerity issue (the proxy objects it uses) yep, seems like I'll be switching to celerity directly and avoid culerity thanks joaquin -------------- next part -------------- An HTML attachment was scrubbed... URL: From ashley.moran at patchspace.co.uk Mon Feb 23 16:32:23 2009 From: ashley.moran at patchspace.co.uk (Ashley Moran) Date: Mon, 23 Feb 2009 21:32:23 +0000 Subject: [Celerity-users] cucumber now runs Celerity and Webrat together In-Reply-To: <8277b7f40902230504j4f7e2a91lb1d3d9b35b7b0d96@mail.gmail.com> References: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> <58F0A089-41FC-4A42-B101-644AF03FC100@patchspace.co.uk> <8277b7f40902230504j4f7e2a91lb1d3d9b35b7b0d96@mail.gmail.com> Message-ID: <43E95427-FAFC-4C1D-BA56-9EC64E588031@patchspace.co.uk> On Feb 23, 2009, at 1:04 pm, Joaquin Rivera Padron wrote: > yes, good question... I don't know Ashley... > > I guess mainly because of speed concerns (of course I would have to > prove that with benchmarks and such) but it feels like celerity is > slower(?) than webrat. What are you observing? is the slowness not > too critical? I've so far found Celerity more than fast enough. In most cases, the setup code takes longer to run than the features. So for the way I'm working, there would not be an order of magnitude improvement even if I replaced Celerity with something infinitely faster[1]. I'm sure I will reach a point on a project where this is not true, but right now speed is not a concern. [1] http://en.wikipedia.org/wiki/Amdahl%27s_law > but maybe it would be useful being able to start using cucumber > +webrat and when the ajax testing moment comes the switch can be > made as painless as possible (this part is easily achieveable, as it > seems now). I am not opposed to change my mind, it's mainly learning > and experimentation, and speed concerns at the moment, should I give > testjour a try? > > also I am using culerity mainly because it was the fastest (the > only, actually :-> ) way I've tried to get things running, but there > are issues that are making me want to jump directly into > celerity... I'll take a detailed tour through celerity.rubyforge ... > > I've been playing with this idea of getting both running for 2 > weekends now, but the time comes when results (the main project is > waiting for its ajax tests) are a must and then experimentation > should loose some weight... (let's see) Personally, I don't see an advantage to starting with Webrat, expecting to switch to Celerity when you add in JS. The reason being you're more likely to add JS than you are to encounter performance issues with Celerity. If you knew from the outset that you'd be writing a huge number of features and not add JS, then Webrat would be worth considering. All IMHO. Ashley -- http://www.patchspace.co.uk/ http://aviewfromafar.net/ http://twitter.com/ashleymoran From joahking at gmail.com Tue Feb 24 04:00:45 2009 From: joahking at gmail.com (Joaquin Rivera Padron) Date: Tue, 24 Feb 2009 10:00:45 +0100 Subject: [Celerity-users] cucumber now runs Celerity and Webrat together In-Reply-To: <43E95427-FAFC-4C1D-BA56-9EC64E588031@patchspace.co.uk> References: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> <58F0A089-41FC-4A42-B101-644AF03FC100@patchspace.co.uk> <8277b7f40902230504j4f7e2a91lb1d3d9b35b7b0d96@mail.gmail.com> <43E95427-FAFC-4C1D-BA56-9EC64E588031@patchspace.co.uk> Message-ID: <8277b7f40902240100u7a35fe55s28e77782d34d4a71@mail.gmail.com> I am getting little by little to entirely agree with you, I am new to Celerity (coming from webrat) but in the end seems like I'd be reusing mi implemented Webrat steps easily by defining celerity methods like visit, click and such following the Webrat API, and that will be it... (of course there will be ajax-only steps with no webrat counterpart) thanks a lot for your responses, you really help get to the "best" approach which is: running all features in jruby and celerity (maintaining the webrat API for existing common non-JS steps) sometimes is only a matter of asking the right question, this time it was Ashley's one: "if you are using Celerity, what is the advantage of also using Webrat?" bang! click! :-) thanks again, cheers joaquin -------------- next part -------------- An HTML attachment was scrubbed... URL: From kamal.fariz at gmail.com Tue Feb 24 04:27:55 2009 From: kamal.fariz at gmail.com (Kamal Fariz Mahyuddin) Date: Tue, 24 Feb 2009 17:27:55 +0800 Subject: [Celerity-users] cucumber now runs Celerity and Webrat together In-Reply-To: <8277b7f40902240100u7a35fe55s28e77782d34d4a71@mail.gmail.com> References: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> <58F0A089-41FC-4A42-B101-644AF03FC100@patchspace.co.uk> <8277b7f40902230504j4f7e2a91lb1d3d9b35b7b0d96@mail.gmail.com> <43E95427-FAFC-4C1D-BA56-9EC64E588031@patchspace.co.uk> <8277b7f40902240100u7a35fe55s28e77782d34d4a71@mail.gmail.com> Message-ID: <13d1fccd0902240127q665c1456xbbc53906ad9a3a4d@mail.gmail.com> I wrote the celerity adapter for webrat as my team came from having cucumber tests written with webrat. Webrat supports ajax links if the app uses Rails helpers like link_to_remote, or link_to ... :method => :put by cheating a little. So for us, using celerity with webrat was to avoid rewriting stuff. We also switched to jQuery and use event bindings which made webrat unable to cheat anymore. Another reason is because webrat supports other adapters like Selenium. So, theoretically I could run the same steps over Selenium by changing the webrat mode. Joaquin, I'm curious which ajax-only steps are you thinking of which has no webrat counterparts? kamal From joahking at gmail.com Tue Feb 24 04:49:52 2009 From: joahking at gmail.com (Joaquin Rivera Padron) Date: Tue, 24 Feb 2009 10:49:52 +0100 Subject: [Celerity-users] cucumber now runs Celerity and Webrat together In-Reply-To: <13d1fccd0902240127q665c1456xbbc53906ad9a3a4d@mail.gmail.com> References: <8277b7f40902230115n161a9abfya8f83b8faa68925d@mail.gmail.com> <58F0A089-41FC-4A42-B101-644AF03FC100@patchspace.co.uk> <8277b7f40902230504j4f7e2a91lb1d3d9b35b7b0d96@mail.gmail.com> <43E95427-FAFC-4C1D-BA56-9EC64E588031@patchspace.co.uk> <8277b7f40902240100u7a35fe55s28e77782d34d4a71@mail.gmail.com> <13d1fccd0902240127q665c1456xbbc53906ad9a3a4d@mail.gmail.com> Message-ID: <8277b7f40902240149s196016a6leedcab4fd148f40d@mail.gmail.com> > > Joaquin, I'm curious which ajax-only steps are you thinking of which has no > webrat counterparts? > at this moment have no idea which, I was only not throwing away the idea that there could be some of them, but if you are more experienced and found that all of them have counterparts then great :-) cheers joaquin -------------- next part -------------- An HTML attachment was scrubbed... URL: From pat.maddox at gmail.com Tue Feb 24 16:04:08 2009 From: pat.maddox at gmail.com (Pat Maddox) Date: Tue, 24 Feb 2009 13:04:08 -0800 Subject: [Celerity-users] Checking for hidden elements Message-ID: <2c7e61990902241304j32b9f47y8297eb4c2e8d92f7@mail.gmail.com> I'm getting started with celerity and cucumber. I've got some code that hides a div on a page. Now I'd like to test that the text doesn't appear...the generated "Then I should not see 'some text'" doesn't work because it just checks if the text appears within the html...which it does if I create an element with style=display:none. Is there an easy way to verify that this text is hidden? Pat From jari.bakken at gmail.com Tue Feb 24 16:57:09 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Tue, 24 Feb 2009 22:57:09 +0100 Subject: [Celerity-users] Checking for hidden elements In-Reply-To: <2c7e61990902241304j32b9f47y8297eb4c2e8d92f7@mail.gmail.com> References: <2c7e61990902241304j32b9f47y8297eb4c2e8d92f7@mail.gmail.com> Message-ID: <92B4DDB8-44D7-4ACA-B3CC-5FB91833C50E@gmail.com> On 24. feb.. 2009, at 22.04, Pat Maddox wrote: > which it does if I create an element with style=display:none. > Is there an easy way to verify that this text is hidden? Try this: browser.div(:id, 'foo').should_not be_visible http://celerity.rubyforge.org/yard/Celerity/Element.html#visible%3F-instance_method From pat.maddox at gmail.com Tue Feb 24 17:32:52 2009 From: pat.maddox at gmail.com (Pat Maddox) Date: Tue, 24 Feb 2009 14:32:52 -0800 Subject: [Celerity-users] Checking for hidden elements In-Reply-To: <92B4DDB8-44D7-4ACA-B3CC-5FB91833C50E@gmail.com> References: <2c7e61990902241304j32b9f47y8297eb4c2e8d92f7@mail.gmail.com> <92B4DDB8-44D7-4ACA-B3CC-5FB91833C50E@gmail.com> Message-ID: <2c7e61990902241432u3278f9bfwad4017d9155be751@mail.gmail.com> On Tue, Feb 24, 2009 at 1:57 PM, Jari Bakken wrote: > > On 24. feb.. 2009, at 22.04, Pat Maddox wrote: > >> which it does if I create an element with style=display:none. >> Is there an easy way to verify that this text is hidden? > > > Try this: > > browser.div(:id, 'foo').should_not be_visible > > http://celerity.rubyforge.org/yard/Celerity/Element.html#visible%3F-instance_method hrm I don't have an element with an id...rather I'm trying to find an element that contains that text. Pat From jari.bakken at gmail.com Tue Feb 24 18:09:53 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Wed, 25 Feb 2009 00:09:53 +0100 Subject: [Celerity-users] Checking for hidden elements In-Reply-To: <2c7e61990902241432u3278f9bfwad4017d9155be751@mail.gmail.com> References: <2c7e61990902241304j32b9f47y8297eb4c2e8d92f7@mail.gmail.com> <92B4DDB8-44D7-4ACA-B3CC-5FB91833C50E@gmail.com> <2c7e61990902241432u3278f9bfwad4017d9155be751@mail.gmail.com> Message-ID: <5E59D1B8-E574-4B6C-AECB-93B4B659E238@gmail.com> On 24. feb.. 2009, at 23.32, Pat Maddox wrote: > On Tue, Feb 24, 2009 at 1:57 PM, Jari Bakken > wrote: >> >> On 24. feb.. 2009, at 22.04, Pat Maddox wrote: >> >>> which it does if I create an element with style=display:none. >>> Is there an easy way to verify that this text is hidden? >> >> >> Try this: >> >> browser.div(:id, 'foo').should_not be_visible >> >> http://celerity.rubyforge.org/yard/Celerity/Element.html#visible%3F-instance_method > > hrm I don't have an element with an id...rather I'm trying to find an > element that contains that text. OK. Celerity sort of assumes you know the kind of element (tag) and some way to identify it (an attribute or inner text). Either the exact text or a regexp should work fine: browser.div(:text, 'some text').should_not be_visible browser.div(:text, /some text/).should_not be_visible Of course, if the text is changed later _and_ you break the code that hides the div, your test won't catch that. I can see your point about browser.text returning "hidden" text, but we would need some support from HtmlUnit to avoid that. From saimonmoore at gmail.com Thu Feb 26 06:27:31 2009 From: saimonmoore at gmail.com (Saimon Moore) Date: Thu, 26 Feb 2009 12:27:31 +0100 Subject: [Celerity-users] Problems with mootools event handlers? Message-ID: Hi all, I'm trying to debug a problem I've come accross while testing my js heavy application with celerity. In order to try and track down the problem I wrote the following spec (within the spec directory of celerity itself - my own fork). patch against celerity src http://gist.github.com/70775 run with: jruby spec/custom_events_spec.rb It's just a simple html page that logs clicks on links. The links inside the ul list have click (and double click) event handlers attached to them via mootools addEvents(). The third link has an inline click event handler. The fourth link has a click (and double click) event handler attached to it via mootools addEvent(). The fifth and sixth links have a click (and double click) event handlers attached to their parent ul via mootools addEvents() (i.e. a test for event delegation). Needless to say this works fine in actual browsers (FF3, Safari, IE7) Currently as you can see only the following specs are passing: * checking that the init function is loading on dom loaded event * 3rd link spec (actual output: http://gist.github.com/70799) It appears that calling #click on the links with the mootools event handlers doesnt do anything. I've tried @browser.wait after the click. I've tried @browser.webclient.waitForJobsWithinDelayToFinish(1000) after the click (latest html-unit snapshot). I've tried resynchronising (both generally and with a block) Nothing I've tried is working. Not sure if this is a htmlunit bug or not but I'm putting this spec out there to see if anyone else can get it to pass. Now, in my own application I see something similar happening. When clicked on certain links (which have event handlers which perform ajax requests attached to them via mootools) either don't do anything OR (if I use @browser.webclient.waitForJobsWithinDelayToFinish(1000)) the js function get's triggered but the ajax request is never sent (as evidenced by logging statements). (It also takes ages while waiting for the jobs to finish). What's weird is that other links that have If you look closely at html/custom_events.html, you'll notice that I have some code commented out that allows custom event handlers for clickonce/clicktwice to be added to elements. The link in my application uses this code (i.e. it does something different on click/ dblclick). I was suspecting this to be the cause so that's why I wrote the spec. I initially specced the case for clickonce event on link1/2 but as it was failing I tried to get a passing spec using just the 'click' event and that's where I am now. I'd really appreciate it if another pair of eyes could take a look at this as I've already spent two days on this issue and I'm running out of ideas. Regards, Saimon PS: Jari sorry for ccing you in particular I've also been having trouble getting through to the list. -- Saimon Moore Freelance Web Developer (Available for hire - For details visit http://saimonmoore.net) Skype: saimonmoore Yahoo IM: saimonmoore Google IM: saimonmoore -------------- next part -------------- An HTML attachment was scrubbed... URL: From jari.bakken at gmail.com Thu Feb 26 08:23:05 2009 From: jari.bakken at gmail.com (Jari Bakken) Date: Thu, 26 Feb 2009 14:23:05 +0100 Subject: [Celerity-users] Problems with mootools event handlers? In-Reply-To: References: Message-ID: Hey Saimon On Thu, Feb 26, 2009 at 12:27 PM, Saimon Moore wrote: > > In order to try and track down the problem I wrote the following spec > (within the spec directory of celerity itself - my own fork). > The spec passes if you add :browser => :firefox when instantiating the Browser - so it's very likely a bug in HtmlUnit's IE implementation. If you need to run this with :internet_explorer, you should convert your reduced case to Java and submit it to their bug tracker. -------------- next part -------------- An HTML attachment was scrubbed... URL: From saimonmoore at gmail.com Thu Feb 26 09:49:04 2009 From: saimonmoore at gmail.com (Saimon Moore) Date: Thu, 26 Feb 2009 15:49:04 +0100 Subject: [Celerity-users] Problems with mootools event handlers? In-Reply-To: References: Message-ID: Hey Jari, Great. Don't why I didn't think of trying different browser combinations. In any case it's confirming what I thought. A bug with htmlunit. Btw I've enabled the custom events (clickonce/clicktwice) in the spec and they're now failing even with :browser => :firefox patch: http://gist.github.com/70775 output: http://gist.github.com/70799 Weird thing is that elements that have these custom events attached to them, not only don't register the clickonce and clicktwice but also the dblclick event. click though appears to get through on #double_click. Regards, Saimon On Thu, Feb 26, 2009 at 2:23 PM, Jari Bakken wrote: > Hey Saimon > > On Thu, Feb 26, 2009 at 12:27 PM, Saimon Moore > wrote: >> >> In order to try and track down the problem I wrote the following spec >> (within the spec directory of celerity itself - my own fork). > > > The spec passes if you add :browser => :firefox when instantiating the > Browser - so it's very likely a bug in HtmlUnit's IE implementation. If you > need to run this with :internet_explorer, you should convert your reduced > case to Java and submit it to their bug tracker. > > -- Saimon Moore Freelance Web Developer (Available for hire - For details visit http://saimonmoore.net) Skype: saimonmoore Yahoo IM: saimonmoore Google IM: saimonmoore From saimonmoore at gmail.com Thu Feb 26 19:20:34 2009 From: saimonmoore at gmail.com (Saimon Moore) Date: Fri, 27 Feb 2009 01:20:34 +0100 Subject: [Celerity-users] Problems with mootools event handlers? In-Reply-To: References: Message-ID: Hi, I've since opened up a bug report with HtmlUnit about this issue: https://sourceforge.net/tracker/index.php?func=detail&aid=2643655&group_id=47038&atid=448266 Will update when it's closed. Regards, Saimon On Thu, Feb 26, 2009 at 3:49 PM, Saimon Moore wrote: > Hey Jari, > > Great. Don't why I didn't think of trying different browser combinations. > > In any case it's confirming what I thought. A bug with htmlunit. > > Btw I've enabled the custom events (clickonce/clicktwice) in the spec > and they're now failing even with :browser => :firefox > > patch: > http://gist.github.com/70775 > > output: > > http://gist.github.com/70799 > > > Weird thing is that elements that have these custom events attached to > them, not only don't register the clickonce and clicktwice but also > the dblclick event. click though appears to get through on > #double_click. > > Regards, > > Saimon > > On Thu, Feb 26, 2009 at 2:23 PM, Jari Bakken wrote: >> Hey Saimon >> >> On Thu, Feb 26, 2009 at 12:27 PM, Saimon Moore >> wrote: >>> >>> In order to try and track down the problem I wrote the following spec >>> (within the spec directory of celerity itself - my own fork). >> >> >> The spec passes if you add :browser => :firefox when instantiating the >> Browser - so it's very likely a bug in HtmlUnit's IE implementation. If you >> need to run this with :internet_explorer, you should convert your reduced >> case to Java and submit it to their bug tracker. >> >> > > > > -- > Saimon Moore > Freelance Web Developer > (Available for hire - For details visit http://saimonmoore.net) > > Skype: saimonmoore > Yahoo IM: saimonmoore > Google IM: saimonmoore > -- Saimon Moore Freelance Web Developer (Available for hire - For details visit http://saimonmoore.net) Skype: saimonmoore Yahoo IM: saimonmoore Google IM: saimonmoore