SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.96k stars 1.24k forks source link

sap.ui.test.RecordReplay.findDOMElementByControlSelector returns wrong control for sap.m.List when "growing=true" #3111

Closed dominikfeininger closed 3 years ago

dominikfeininger commented 3 years ago

A sap.m.List displays the paging footer correctly when "growing=true" and "growingThreshold=3" is set. But the sap.ui.test.RecordReplay.findDOMElementByControlSelector method returns wrong control for a sap.m.List with these properties.

OpenUI5 version: 1.85

Browser/version (+device/version): Chrome on Mac Version 87.0.4280.88

Any other tested browsers/devices(OK/FAIL): None

URL (minimal example if possible): https://github.com/js-soft/wdi5/blob/74c5c9eec7a8178c32bb5fd684d90d7724bf960b/test/ui5-app/webapp/test/e2e/aggregation.test.js#L36

User/password (if required and possible - do not post any confidential information here):

Steps to reproduce the problem:

  1. execute the findControlSelectorByDOMElement function on a sap.m.List
  2. check the id of the retuned control
  3. the id ends with ...-trigger

What is the expected result? The retuned control is the sap.m.List control

What happens instead? The retuned control is the trigger

Any other information? (attach screenshot if possible)

Martotko commented 3 years ago

Hi @dominikfeininger ,

As per the documentation(https://sapui5.hana.ondemand.com/#/api/sap.ui.test.RecordReplay%23methods/sap.ui.test.RecordReplay.findControlSelectorByDOMElement) the method returns the 'best' result with the least possible inspection, which in your case is the trigger. Maybe will be better to use another method or update the selector.

Best regards, Martin

dominikfeininger commented 3 years ago

Hi @Martotko, thanks. Do you have any recommendations for an 'updated' selector which delivers the expected result?

vobu commented 3 years ago

hi @Martotko, if you look at the selector https://github.com/js-soft/wdi5/blob/issue/listgrowing/test/ui5-app/webapp/test/e2e/aggregation.test.js#L39, this becomes more of a problem: the selector explicitly sets sap.m.List as desired controlType; but handed the list id PeopleListGrowing, sap.ui.test.RecordReplay.findDOMElementByControlSelector returns a sap.m.CustomListItem instead. Please kindly have another look at the matter. Thanks, Volker

Martotko commented 3 years ago

Hello @vobu ,

Thank you for sharing this finding. I've created an internal incident 2080456636. The status of the issue will be updated here in GitHub.

Regards, Martin

tsaleksandrova commented 3 years ago

Hi Dominik, the method findDOMElementByControlSelector returns a DOM element, not a control. You can modify the result and get the list DOM reference by adding interaction: "root" Lists have a special handling to make clicking on them (their trigger item) easier and a click is the most expected action, so the dafault state is intended.

Regards, Tsvetelina

vobu commented 3 years ago

confirmed! undocumented gem šŸ˜„ šŸ’Ž @dominikfeininger please close