lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] GUI test: 'paste_census' update


From: Greg Chicares
Subject: Re: [lmi] GUI test: 'paste_census' update
Date: Tue, 15 Dec 2015 02:26:35 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

On 2015-12-15 01:25, Vadim Zeitlin wrote:
> On Mon, 14 Dec 2015 19:40:03 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> I've updated 'pasting_to_a_census.html', and would like to update its
> GC> unit test. I started out by replacing the example in the unit test with
> GC> the new user-manual example, but the kludges I had to add to make it
> GC> work gave me pause--see below.
> 
>  Sorry if I'm missing something obvious, but which of the changes do you
> object to in particular? I don't see any really bad here compared to the
> existing code.

Oh. I thought it was so bad that I hesitated to commit it.

> GC> @@ -301,8 +300,12 @@
> GC>              LMI_ASSERT(gender_radiobox);
> GC> 
> GC>              wxUIActionSimulator ui;
> GC> -            ui.Char(WXK_DOWN); // Select the last, "Unisex", radio 
> button.
> GC> +            // Select the last, "Unisex", radio button, by simulating
> GC> +            // down-arrow twice: female --> male, then male --> unisex.
> GC> +            ui.Char(WXK_DOWN);
> GC>              wxYield();
> GC> +            ui.Char(WXK_DOWN);
> GC> +            wxYield();
> 
>  This one is ugly and it would be better if wxUIActionSimulator::Select()
> could work with radio boxes too, but currently it doesn't because they're
> completely different from list/combo boxes internally for which that method
> was written.

Okay. And radioboxes don't seem to use Home or End (or any other keystroke
I can find) to select the first or the last item in a group (on either msw
or gtk), so I guess this is as elegant as it's going to get.

> GC> @@ -337,7 +340,8 @@
> GC>      unsigned int const
> GC>          gender_column = find_model_column_by_title(list_window, 
> "Gender");
> GC>      LMI_ASSERT_EQUAL(list_model->GetCount(), number_of_rows);
> GC> -    for(std::size_t row = 0; row < number_of_rows; ++row)
> GC> +    // Only the first two rows are affected. This seems fragile.
> GC> +    for(std::size_t row = 0; row < 2; ++row)
> GC>          {
> GC>          wxVariant value;
> GC>          list_model->GetValueByRow(value, row, gender_column);
> 
>  Again, this is definitely not particularly beautiful, but I don't think
> it's worth extracting the number of rows having the same class as the first
> row from the census data here. All I would change would be to make the
> comment more explicit, saying that we check only the first two rows because
> they are the only ones that use the class that we have just edited. But
> other than that, what can we do?

Those are the only options I could see, other than setting up a special
census screen just for this purpose, with every cell in one 'EmployeeClass'.

>  Sorry if I completely missed the point of your email (as I suspect I did),

You missed nothing. Perhaps GUI-testing code is necessarily quite
different from production code.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]