resolve description from assigned name value

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

resolve description from assigned name value

NorbertHartl
Hi,

I'm trying to align my tests a little bit more at
the moment. I'm using seaside testing for the tests
and magritte for most of the model objects.

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?

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.

thanks,

Norbert




_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: resolve description from assigned name value

Lukas Renggli
> 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.

> 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'

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: resolve description from assigned name value

NorbertHartl
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




_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki