Bug 1273962 - New tooltips of in ovirt UI are not automation-friendly
Summary: New tooltips of in ovirt UI are not automation-friendly
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Frontend.WebAdmin
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ovirt-4.0.0-alpha
: ---
Assignee: Greg Sheremeta
QA Contact: Pavel Stehlik
URL:
Whiteboard: ux
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-21 15:17 UTC by movciari
Modified: 2016-02-10 19:22 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-13 22:05:11 UTC
oVirt Team: UX
Embargoed:
ecohen: ovirt-4.0.0?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1273970 0 high CLOSED Automation of UI tests needs way to check status of VM in userportal 2021-02-22 00:41:40 UTC

Internal Links: 1273970

Description movciari 2015-10-21 15:17:52 UTC
Description of problem:
Tooltips in ovirt 3.5 are easy to test automatically - we can just check if the element has the correct text in title attribute, but in 3.6 the tooltip is a completely separate element, which is not even close in DOM to the element it belongs to, so testing it would be cumbersome.

Elements with tooltips should at least have some data attribute which would contain text shown in tooltip.

Version-Release number of selected component (if applicable):
3.6.0-0.18.el6

How reproducible:
always

Additional info:
Low severity because tests for tooltips are less important than tests for other functionality, but it would still be nice to have tests for them, especially because new tooltips are not implemented using standard html title attribute

Comment 1 Vojtech Szocs 2015-10-23 16:03:11 UTC
Short-term workaround: utilize "aria-describedby" attribute that links to DOM element of the tooltip.

For example, VM main tab / Run Once button:

<div id="MainTabVirtualMachineView_table_Run" role="button">

After simulating mouse hover, it becomes:

<div id="MainTabVirtualMachineView_table_Run"
     role="button" aria-describedby="tooltipXXXXXX">

Test script would therefore need to:
- trigger mouse hover on given DOM element
- parse value of "aria-describedby" attribute
- locate associated tooltip DOM element by ID
- extract text from tooltip DOM element

Above mentioned workaround is too complicated, I think.

I believe we can modify tooltip'ed DOM element to include tooltip text via simple DOM attribute.

For example, upon mouse hover, Run Once button would become:

<div id="MainTabVirtualMachineView_table_Run"
     role="button" aria-describedby="tooltipXXXXXX"
     data-tooltip-text="Run">

In other words, (currently unused) "title" attribute would become "data-tooltip-text" attribute.

Comment 2 Greg Sheremeta 2015-11-13 22:05:11 UTC
Sorry for the trouble here.

Relying on the text in a tooltip is dangerous for automation because the tooltips don't convey a meaning. That is, they can be used for just about anything by developers.

A better way to test is to add data-xyz attributes as Vojtech suggests above. That way, if you want to check the status of a vm, simply read 'data-status.'

For specific places where you can no longer easily grab data because of the tooltip changes, please open a bug for each one and I'll get them fixed.

For Bug 1273970, I have added 'data-status' for vm status. 

Thanks!


Note You need to log in before you can comment on or make changes to this bug.