Well, this should have gone to the mozmill-dev group. Redirecting...
Hi all,
In the past weeks we had smaller discussion on IRC regarding how we
should handle wrappers like MozMillElement in the future. Having them
gives us lot of work in regards of pass-through methods, because for
each method and property of the underlying object, we would need an
equivalent method, which simply forwards the request.
Today I have seen something amazing, which would let us handle that with
a single method only. The feature I'm talking about is
Object.prototype.__no_such_method__():
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/noSuchMethod
Here we could define what to do if the used method is not available on
the wrapper. Lets say we have a MozElement which contains a textbox. If
you want to check its value you will have to call elem.getNode().value
in a Mozmill test. But with the above method we could simply call
elem.value() to retrieve the data.
I think that this would help us a lot when it comes to improving the
framework for all the available wrappers.
What do you think about?
--
Henrik Skupin
Software Engineer in Test
Mozilla Corporation