action #37327

action #36712: [sle][functional][y][yast][hackweek][saga] Use YaST specific framework for GUI testing

action #38876: [functional][y][epic] Automate yast2 hostname test suite using YaST framework which is not relying on shortcuts

[sle][functional][y] Improve YaST GUI testing framework to operate on tables

Added by riafarov over 1 year ago. Updated over 1 year ago.

Status:ResolvedStart date:13/06/2018
Priority:LowDue date:20/11/2018
Assignee:cwh% Done:

0%

Category:New testEstimated time:13.00 hours
Target version:SUSE QA tests - Milestone 20
Difficulty:
Duration: 115

Description

Motivation

For writing test we would need widget ids and other properties of widgets. For some we cannot elaborate internal structure to trigger events. For example: tables.
Good start would be to display internal structure, so then it will be easily possible to implement search. With

Acceptance criteria

  1. It's possible to select row in the table using cell value or row number

Further details

See #42188 and explore parts done by Lada, which we can use as a base for further development.

Here are useful links:
1. https://github.com/lslezak/cucumber-yast#installing-cucumber-ruby-gem
2. https://hackweek.suse.com/17/projects/yast-integration-tests-using-cucumber
3. https://github.com/libyui/libyui-qt/tree/http_server


Related issues

Precedes (14 days) openQA Tests - action #38879: [functional][y] Implement yast2 hostname test using ncurs... Rejected 11/12/2018 11/01/2019

History

#1 Updated by okurz over 1 year ago

  • Category set to New test

when would you like this to be scheduled?

#2 Updated by okurz over 1 year ago

  • Target version set to future

#3 Updated by okurz over 1 year ago

  • Target version changed from future to future

#4 Updated by okurz over 1 year ago

  • Due date set to 31/12/2018

#5 Updated by riafarov over 1 year ago

  • Parent task changed from #36712 to #38876

#6 Updated by riafarov over 1 year ago

  • Due date changed from 31/12/2018 to 28/08/2018

Suggest for S24

#7 Updated by okurz over 1 year ago

  • Target version changed from future to Milestone 18

#8 Updated by okurz over 1 year ago

  • Precedes action #38879: [functional][y] Implement yast2 hostname test using ncurses with YCP added

#9 Updated by riafarov over 1 year ago

  • Due date changed from 28/08/2018 to 11/09/2018
  • Target version changed from Milestone 18 to Milestone 19

#10 Updated by riafarov over 1 year ago

  • Status changed from New to Workable

#11 Updated by riafarov over 1 year ago

  • Due date changed from 11/09/2018 to 25/09/2018
  • Estimated time set to 13.00

I guess I need to split it to smaller parts, as we don't have enough capacity.

#12 Updated by riafarov over 1 year ago

  • Priority changed from Normal to Low

#13 Updated by cwh over 1 year ago

  • Status changed from Workable to Blocked

I asked Stefan Hundhammer as an experienced YaST GUI developer about the widget spy and libyui tables.

The result is, that it is not trivial to implement a widget-spy-like tool for searching libyui tables by values.
That means
a) we as QA cannot implement this on our own. It needs to be delegated to the YaST team.
b) it is questionable at all that we can ever get this feature.

So I doubt this task is is either workable in this sprint or even in any near future.

#14 Updated by riafarov over 1 year ago

@cwh Thanks for the feedback. As a feature itself it's not that important, but having functionality to do actions on any kind of controls is a must. As this testing framework was kind of abandoned, I believe YaST team doesn't have capacity to do the development and my proposal, which got positive feedback from stakeholders, is to do that development inside of QA team as of now. Complexity was understood from very beginning, whereas I don't have an idea better and smaller than this. Continuing using openQA for all GUI tests is not scalable option.

#15 Updated by okurz over 1 year ago

  • Status changed from Blocked to Workable

My own opinion is somewhere in the middle between cwh's and riafarov's but I am supporting you to have the capacity to explore further feasibility.

Regarding our ticket management process. Please use "Blocked" only with a reference to another ticket or place where we can see what this ticket is "blocked" by. Also use an assignee to track the other ticket then. You can use "Feedback" however when you consider a ticket as not "Workable" and want to get feedback.

#16 Updated by riafarov over 1 year ago

  • Assignee set to riafarov

Taking over, had fruitful discussion with Christopher and Stefan Hundhammer, next step is to organize a meeting to decide how to start, then I will create tickets accordingly.

#17 Updated by riafarov over 1 year ago

  • Due date deleted (25/09/2018)
  • Assignee deleted (riafarov)

We have to postpone again, having discussions on future architecture as YCP is planned to be dropped, communicating steps with YaST team. Returning to the team backlog.

#18 Updated by riafarov over 1 year ago

  • Subject changed from [sle][functional][y] Improve YaST widget spy to work with more complex structures and implement row selection to [sle][functional][y] Improve YaST GUI testing framework to operate on tables
  • Description updated (diff)
  • Due date set to 23/10/2018

As per evaluation done in #42188, we can proceed with it using that approach. Changed ticket description.

#19 Updated by riafarov over 1 year ago

  • Due date changed from 23/10/2018 to 06/11/2018

Wrong sprint defined.

#20 Updated by okurz over 1 year ago

  • Target version changed from Milestone 19 to Milestone 20

#21 Updated by cwh over 1 year ago

  • Status changed from Workable to In Progress
  • Assignee set to cwh

#22 Updated by cwh over 1 year ago

For YTable in libyui currently neither get nor set is implemented for a bunch of properties:

bool
YTable::setProperty( const std::string & propertyName, const YPropertyValue & val )
{
    propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch

    if      ( propertyName == YUIProperty_Value         )       return false; // Needs special handling
    else if ( propertyName == YUIProperty_CurrentItem   )       return false; // Needs special handling
    else if ( propertyName == YUIProperty_SelectedItems )       return false; // Needs special handling
    else if ( propertyName == YUIProperty_Items         )       return false; // Needs special handling
    else if ( propertyName == YUIProperty_Cell          )       return false; // Needs special handling
    else if ( propertyName == YUIProperty_Item          )       return false; // Needs special handling
    …

So we need not only to enhance the API.
Changes to libyui itself (including ~-qt and ~-ncurses) are necessary.

#23 Updated by cwh over 1 year ago

Asked Huha about how to proceed. Her pointed me to the UI-interpreter.
Continue investigation.

#24 Updated by cwh over 1 year ago

Code blindness hit me: For tables the currently selected item is already shown in the json output - but a bit different than I expected:

  {
    "labels" : 
    [
      "fe00::0",
      "ipv6-localnet",
      ""
    ],
    "selected" : true
  },

#25 Updated by cwh over 1 year ago

I implemented a select_table API call.

Unfortunately it brought up an libyui bug in a method returning the label of a table cell.
It got fixed but now I need to rebuild also some other packages.

-> WIP

#26 Updated by cwh over 1 year ago

select_table API call to select table rows works now.
https://github.com/libyui/libyui/pull/139

It searches the labels in the first column of the table by value and selects the first match.
curl -X POST 'http://d133.suse.de:14155/widgets?id=table&action=select_table&value=ff02::1'

#27 Updated by cwh over 1 year ago

My next step is to provide always up-to-date rpm to make it available to others.

#28 Updated by riafarov over 1 year ago

  • Due date changed from 06/11/2018 to 20/11/2018

#29 Updated by riafarov over 1 year ago

  • Status changed from In Progress to Resolved

I believe we can resolve this one. After discussion on yast-devel, we now need to start a new project and enable this functionality as a plugin, keeping change to SUT minimal.

Also available in: Atom PDF