Ian M
unread,Mar 14, 2011, 9:53:49 AM3/14/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Spock Framework - User
Hi,
Say you have a html data table headed by years across the top, and
each row with a td, with the month name in the 1st column has anyone
managed to come up with a generic means of testing that accessing with
the value via some generic parametrized function/test.
i.e. we really want to get the value (tableID=myReport,column=2008,
row=Mar)
| |2007|2008|
|Jan|943|645|
|Feb|234|187|
|Mar|129|165|
|April|103|671|
Test from Spec:
myReport_March_2008_Value.text()=="€2,307"
Page defintion:
myReport_March_2008_10Value{ $("#myReport table tbody tr:nth-child(2)
td:nth-child(2)") }
Disadvantage of the page definition is that if the table gains/looses
columns - years in this case, then the test will fail due for reason
not due to the application code. I guess that's what some would call a
brittle test? Either way, I think it would be easier to specificy
table cell evalutors with a col,row heading rather than an integer.
This would hopefully make it easier to write, and then more people
will write tests :)
Would be great to get your thoughts.
Cheers,
Ian.
p.s. Sorry for any confusion over which element of Spock/Geb etc I'm
referring to here - I'm new! :)