On Fri, 2009-03-06 at 15:06 +0100, Lukas Renggli wrote:
Whenever a
model asComponent is rendered every
individual MAElementComponent is rendered with an
automatically assigned name attribute. Is it hard
to resolve the description by this name value?
That's Seaside that assigns the name attributes automatically, this
has nothing to do with Magritte. The name attribute is used to
generate the keys of a HTTP POST, it should not be used for anything
else.
Yes I know it is seaside. And I know it is not good to use this
value. But if I have a single test step that just gets the
rendered result and that wants to know which component rendered
that it is not too bad. At the moment I remember that the display of
the markup in the "toggle halos" mode does this. Maybe I should look
there.
This way it
would be possible to set values in a
form input fields. This is quite tedious at the
moment. The fields that use <label forId=""> it
is not too hard but not all of the input fields
have labels and not always are they the previous
sibling and so on... I know albatross has some
clever stuff to detect this but I like to do the
tests with seaside testing for the time being.
Give the description a CSS class, that's a reliable way to find things
in the DOM:
aDescription cssClass: 'nameInputField'
I'm a bit reluctant to assign css classes to each element just
to be able to find it while testing. Taken this I find the
above approach better and more reliable.
thanks,
Norbert