[Windmill-dev] asserts and waits

Adam Christian adam at osafoundation.org
Wed Aug 29 13:31:49 PDT 2007


So for each element like what you are talking about, we will need to  
add a registry for the UI to dynamically build. If our main concern  
is that the UI is going to have 50 asserts and 50 waits I can  
understand why this is a little silly, especially when we get huge  
amounts of other functions. We want to have assertText be one  
function in the API (which for maintainability, we need each of these  
to be their own function) we would have to add specific code in there  
to say is it an assert, then split the string to find out which one,  
or for wait, do the same thing.. I have a feeling there is going to  
be more sets of things that share a common prefix.

  Using the registries we can easily build the additional UI  
component, and not muddy things up with tons of asserts and waits.

However it would be simple to not change any syntax

{"method": "assertText", "params": {"id" : "monthHeaderDiv",  
"validator" : "2008"}}

Maintain a simple registry called assertReg and have an entry for  
'text', 'node' etc.

When you select assert in the UI, a new drop down shows up with these  
options, when you play back, or write it out to a file, the logic  
will look and see if this second box exists, concats the values  
maintaining:

{"method": "assertText", "params": {"id" : "monthHeaderDiv",  
"validator" : "2008"}}

And achieving a cleaner UI.

If we prefer to just have one assert function for the user to worry  
about, we could use another param to specify which one, the code  
could check to see if this param exists in each call and do a concat  
to get the correct method,

Example JSON would be something like:

{ "method": "assert", "params": {"id":  
"blah","target":"Text","validator":"isthistexthere"}}

This would call assertText on the the node with id blah, and check if  
it contains the string "isthistexthere"

If we want to make the organization in code cleaner, it is easy to  
take all the asserts and put them in their own file, all the waits  
and put them in their own file, as they will still get loaded into  
the controllers namespace.

Adam

On Aug 29, 2007, at 12:55 PM, Mikeal Rogers wrote:

> We're starting to add more asserts and conditional waits to the  
> windmill controller API.
>
> This is starting to get ugly, as we seem to have gone the xUnit  
> router of using separate functions for every case. In the hope of  
> keeping our API and test writing UI clean I'd like to change this.
>
> I suggest we have only one wait() and one assert() and implement  
> the additional functionality as keyword arguments to those  
> functions. So,
>
> assertNode(id="asdf") becomes assert(node={"id":"asdf"}).
>
> Any complaints/issues, i know Adam has some concerns about adding  
> the dynamic UI for this but the longer we wait to clean this up the  
> worse it's going to get.
>
> -Mikeal
> _______________________________________________
> Windmill-dev mailing list
> Windmill-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/windmill-dev



More information about the Windmill-dev mailing list