<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On May 8, 2008, at 5:24 PM, Zach Dennis wrote:</div><div><br class="Apple-interchange-newline"><blockquote type="cite">David,<div><br></div><div>Can you provide any more info? Is it just being talked about or are people actively working on it now? I would be interested in assisting. I've done a lot with Selenium and the ruby driver and would be interested in providing beautiful high level helpers that allow people switch from non-Selenium based specs to Selenium-based specs with more ease. I know this can be a barrier for people. </div></blockquote><div><br></div><div>The short term plan is that Aslak will set up a spec-ui project up at github, at which point you, Ian Dees (who ha also expressed an interested in working on this), and anyone else who wishes can set up clones. It might take a while before there is a formal release (gem published to rubyforge), but at least this positions us to move forward with your assistance.</div><div><br></div><div>I don't want to commit to a time frame, but my suspicion is that we should have git repo up within the next week or two.</div><div><br></div><div>Cheers,</div><div>David</div><br><blockquote type="cite"> <div><span class="Apple-style-span" style="-webkit-text-stroke-width: -1; ">Zach </span></div><div><br><div class="gmail_quote">On Thu, May 8, 2008 at 11:15 AM, David Chelimsky <<a href="mailto:dchelimsky@gmail.com">dchelimsky@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <div style="word-wrap:break-word"><div>Just an FYI - spec-ui, an rspec extension that supports integration with selenium and watir, has been under some discussion lately and should see some new life soon.</div><br><div><div> <div></div><div class="Wj3C7c">On May 8, 2008, at 10:10 AM, Zach Dennis wrote:<br></div></div><blockquote type="cite"><div><div></div><div class="Wj3C7c"><div class="gmail_quote">I've had really iffy luck with Selenium plugins in the past (selenium-on-rails, seleniumfu_rc, selenium_rc, etc.) so I've started to write a RailsSeleniumStory. I also had to remove the ActiveRecordSafetyListener in my efforts.</div> <div class="gmail_quote"><br></div><div class="gmail_quote">The RailsSeleniumStory is a part of the mhs_testing plugin [0] and it provides higher level helpers. For example I love how form-test-helper is used to select and submit forms:</div> <div class="gmail_quote"><br></div><div class="gmail_quote"> # option 1</div><div class="gmail_quote"> form = select_form 'expense_form'</div><div class="gmail_quote"> form.expense.amount = 12.99</div><div class="gmail_quote"> form.submit</div><div class="gmail_quote"><br></div><div class="gmail_quote"> # option 2</div><div class="gmail_quote"> submit_form 'expense_form' do |form|</div><div class="gmail_quote"> form.expense.amount = 12.99</div> <div class="gmail_quote"> form.expense.category_id = 2</div><div class="gmail_quote"> form.expense.comments = "map for trip"</div><div class="gmail_quote"> end</div><div class="gmail_quote"><br></div> <div class="gmail_quote">You can use this same syntax within RailsSeleniumStories. Right now you can also use "have_tag" and "with_tag" matchers with Selenium. It supports basic matching (I wouldn't get to crazy with nesting or lots of assert-select/have-tag options), but it will be supporting more options shortly.</div> <div class="gmail_quote"><br></div><div class="gmail_quote">So your login example could just look like:</div><div class="gmail_quote"><br></div><div class="gmail_quote"> Given('log in as a admin user')</div><div class="gmail_quote"> open "/admin/login" </div><div class="gmail_quote"> submit_form "login_form" do |form|</div><div class="gmail_quote"> form.login = 'developer'</div><div class="gmail_quote"> form.password = 'test'</div><div class="gmail_quote"> end<br></div><div class="gmail_quote"> end</div><div class="gmail_quote"><br></div><div class="gmail_quote">Which IMO I really like because if you need variations of that you can pull out a helper method like:</div> <div class="gmail_quote"> </div><div class="gmail_quote"> def submit_login_form(user, password='test')</div><div class="gmail_quote"> submit_form "login_form" do |form|</div><div class="gmail_quote"> form.login = user.login</div><div class="gmail_quote"> form.password = passsword</div><div class="gmail_quote"> end</div><div class="gmail_quote"> end</div><div class="gmail_quote"><br></div><div class="gmail_quote"> And you could push your open into a helper as well:</div><div class="gmail_quote"> def go_to_login_page</div><div class="gmail_quote"> open "/admin/login"</div><div class="gmail_quote"> end</div><div class="gmail_quote"> <br></div><div class="gmail_quote">And now your Given could look like:</div><div class="gmail_quote"><div class="gmail_quote"> Given('log in as a admin user')</div><div class="gmail_quote"> go_to_login_page</div> <div class="gmail_quote"> submit_login_form @user, 'test'</div><div class="gmail_quote"> end<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Now granted submit_form and select_form both take a form's id, so each of your forms need to have one.</div> </div><div class="gmail_quote"><br></div><div class="gmail_quote">If you are interested and have the time please check it out. Granted it's in its infancy and there's not a whole lot of docs right now (there is a README.Selenium for instructions on how-to setup in your project), but you can find me on GTalk or in <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> (zdennis) and of course right here on the rspec ML. I am have 33 scenarios using the RailsSeleniumStory,</div> <div class="gmail_quote"><br></div><div class="gmail_quote">ttyl,</div><div class="gmail_quote"><br></div><div class="gmail_quote">Zach</div><div class="gmail_quote"><br></div><div class="gmail_quote">0 - <a href="http://github.com/mvanholstyn/mhs_testing/tree/master" target="_blank">http://github.com/mvanholstyn/mhs_testing/tree/master</a></div> <div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Thu, May 8, 2008 at 8:22 AM, Joseph Wilk <<a href="mailto:lists@ruby-forum.com" target="_blank">lists@ruby-forum.com</a>> wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have been using Rspec stories with Webrat feeling very productive and<br> happy.<br> <br> Then I needed to do something with Selenium (Webrat could have done what<br> I needed but it does not yet have the functionality).<br> <br> Selenium-core as part of a rails plugin looked nice but did not seem to<br> fit with rspec stories. So I went the Selenium-rc route.<br> <br> Since Selenium uses a separate instance of rails<br> (<a href="http://www.nabble.com/stories-with-selenium-and-the-db-td16190686.html" target="_blank">http://www.nabble.com/stories-with-selenium-and-the-db-td16190686.html</a>)<br> I had to turn off the ActiveRecordSafetyListener used in rspec to make<br> sure the db writes committed.<br> <br> Which in turn left me having to manually cleanup my selenium stories :(<br> <br> So that required writing a new, rather gritty scenario listener which<br> dealt with the cleaning operation. It has to do lots of horrible things<br> like remove all listeners for a selenium story and then re-add them all<br> for the others stories.<br> <br> *Code Extract*<br> <br> def story_ended(title, narrative)<br> case title<br> when 'Edit a page'<br> <br> #We have finished the selenium story<br> $selenium_driver.stop<br> <br> #Do we need to re-add some listeners<br> if !@listener_reloaded<br> Spec::Story::Runner.scenario_runner.add_listener(ActiveRecordSafetyListener.instance)<br> @listener_reloaded=true<br> end<br> end<br> end<br> <br> <br> I had to duplicate a lot of the story steps since now any previous<br> post/gets did not work since they post to the test instance and not the<br> selenium rails instance.<br> <br> I also needed to invoke against the selenium driver so even when the<br> steps would work I had to duplicate them with<br> $selenium_driver.do_something()<br> <br> <br> This nice Given:<br> <br> Given('log in as a admin user')<br> post '/admin/sessions/create', :login => @user.login, :password =><br> @user.password<br> end<br> <br> Being duplicated with this<br> <br> Given('log in as a admin user')<br> $selenium_driver.open '/admin/login'<br> $selenium_driver.type 'login', 'developer'<br> $selenium_driver.type 'password', 'test'<br> $selenium_driver.click 'commit'<br> end<br> <br> After some very painful testing and a lot of time I got my Selenium-rc<br> and Webrat stories working. This experience really opened my eyes to the<br> big void introduced by Selenium-rc running outside of the test instance.<br> <br> This has made me wonder whether I should have rspec stories stepping<br> outside of the test rails instance to drive Selenium tests.<br> <br> Has anyone managed to make this process easier?<br> <br> I'm hoping I'm doing something silly which is making it all harder!<br> <br> Is it feasible to bring selenium into the test rails instances?<br> <br> Is it just always going to be painful?<br> <br> I was skipping along having a lot of fun with stories and Webrat, now<br> I'm face down in a puddle of mud, dreading that Selenium moment.<br> <br> --<br> Joseph Wilk<br> <a href="http://www.joesniff.co.uk" target="_blank">http://www.joesniff.co.uk</a><br> <font color="#888888">--<br> Posted via <a href="http://www.ruby-forum.com/" target="_blank">http://www.ruby-forum.com/</a>.<br> _______________________________________________<br> rspec-users mailing list<br> <a href="mailto:rspec-users@rubyforge.org" target="_blank">rspec-users@rubyforge.org</a><br> <a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br> </font></blockquote></div><br><br clear="all"><br>-- <br>Zach Dennis<br></div></div><a href="http://www.continuousthinking.com" target="_blank">http://www.continuousthinking.com</a> _______________________________________________<div class="Ih2E3d"> <br>rspec-users mailing list<br><a href="mailto:rspec-users@rubyforge.org" target="_blank">rspec-users@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a></div> </blockquote></div><br></div><br>_______________________________________________<br> rspec-users mailing list<br> <a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br> <a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Zach Dennis<br><a href="http://www.continuousthinking.com">http://www.continuousthinking.com</a> </div> _______________________________________________<br>rspec-users mailing list<br><a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>http://rubyforge.org/mailman/listinfo/rspec-users</blockquote></div><br></body></html>