Faciliate Selenium test scripts by adding id's

0 views
Skip to first unread message

ep...@opensourceconnections.com

unread,
Aug 22, 2006, 9:49:26 AM8/22/06
to Rails Ajax Scaffold Generator
Last night I held "Selenium Boot Camp" where I led a couple folks
through using Selenium. We then started doing a lab exercise testing
agaist a little app the uses Ajax Scaffold extensively. I ran into the
obstacle that because none of the links have id's set up for them,
finding a specific "Delete" or "Edit" link out of a long list of links
is quite challenging.

I am going to play around with the existing generated pages I have, and
maybe add the id's there, but if I go back and add id's to the
templates in the gem, what is the process for submitting my patch? Are
there any preferred ways of adding the id's? I was thinking id's would
be like "delete_XXX" or "edit_XXX" and so on for all the links.

Any gotchas that you'all would recommend I be aware of?

ep...@opensourceconnections.com

unread,
Aug 22, 2006, 11:23:21 AM8/22/06
to Rails Ajax Scaffold Generator
How I quickly added some id's:

<%= link_to_remote "Edit",
{ :url => edit_options,
:loading =>
"Element.show('#{loading_indicator_id(@options)}');" },
{ :href => url_for(edit_options),
:id =>"edit_" +
event.send("#{Event.primary_key}").to_s
} %>

I just added the :id => bit. This could go right into the template.

rrwhite

unread,
Aug 29, 2006, 1:49:55 AM8/29/06
to Rails Ajax Scaffold Generator
Yeah, if we want to put that into ASG proper we'd abstract that out
into the ajax_scaffold.rb helper module. I hadn't done it up till this
point b/c a) no one has needed hooks into those elements to my
knowledge and b) I don't like lots of extra id/class elements if not
necessary.

Reply all
Reply to author
Forward
0 new messages