[Lift] Re: cucumber + webrat with Lift (switch off auto generation of name/id attrs)
Hi, Thanks very much, that's exactly what I'm after ! For anyone reading this and wondering how to put Lift in test mode, here is one way if you're using maven+jetty : mvn jetty:run -Drun.mode=test --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: cucumber + webrat with Lift (switch off auto generation of name/id attrs)
On Fri, Oct 30, 2009 at 12:00 PM, ben wrote: > > Hi, > > I love how Lift generates name/id attributes on form values - its a > great security feature. > But it does tend to make acceptance frameworks like cucumber+webrat > impossible to use. > > For those not familar with cucumber+webrat, it is an acceptance > framework for testing, amongst other things, websites. > So if we were writing a test to submit a form, we would write a test > script which looked something like : > > fill_in "my_form_text_input_name", :with => inputValue > click_button "Submit" > > where the html would be : > > > > With Lift generating these automatic name/id attributes, it makes the > above impossible. > > So my question is : Is it possible to turn this auto-generation off > for use when testing and then turn it back on for production ? > Yes. When you run Lift apps in test mode, the field names are stable (they do not change from request to request). > > Thanks, > Ben > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: cucumber + webrat with Lift (switch off auto generation of name/id attrs)
Can't you go by input id instead of input name? You can use the _id_> arrow to set the bind name as the id Template: Snippet: bind("pre", xhtml, "label" _id_>SHtml.text( ... ) ) Should produce On Fri, Oct 30, 2009 at 3:00 PM, ben wrote: > > Hi, > > I love how Lift generates name/id attributes on form values - its a > great security feature. > But it does tend to make acceptance frameworks like cucumber+webrat > impossible to use. > > For those not familar with cucumber+webrat, it is an acceptance > framework for testing, amongst other things, websites. > So if we were writing a test to submit a form, we would write a test > script which looked something like : > > fill_in "my_form_text_input_name", :with => inputValue > click_button "Submit" > > where the html would be : > > > > With Lift generating these automatic name/id attributes, it makes the > above impossible. > > So my question is : Is it possible to turn this auto-generation off > for use when testing and then turn it back on for production ? > > Thanks, > Ben > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---