ui5-community / wdi5

official UI5 end-to-end test framework for UI5 web-apps. wdi5 = Webdriver.IO + UI5 Test API
https://ui5-community.github.io/wdi5/
Apache License 2.0
102 stars 43 forks source link

Can't retrieve the right control using controlType in value help dialog #324

Closed rotaryivy closed 2 years ago

rotaryivy commented 2 years ago

Can't retrieve the right control using controlType in value help dialog

Code segment

  const oTable = await browser.asControl({
      selector : {
          controlType: 'sap.ui.table.Table', 
          ancestor: {
              controlType: 'sap.ui.comp.valuehelpdialog.ValueHelpDialog',
          }
      }
  });
  const sId = await oTable.getId();
  wdi5.getLogger().log(`[ListPage]: table id: ${sId}`)
  wdi5.getLogger().log(`[ListPage]: table information: ${JSON.stringify(oTable.getControlInfo())}`)

Results

[0-0] [wdi5] [ListPage]: table id: com.sap.ctsm.s4.ui.clinicalsupplyorders::sap.suite.ui.generic.template.ListReport.view.ListReport::SupplyOrders--listReportFilter-filterItemControl_BASIC-StudyID-valueHelpDialog-table-0
[0-0] [wdi5] [ListPage]: table information: {"$":["$","$$","acceptAlert","addCommand","addCookie",...],"id":"com.sap.ctsm.s4.ui.clinicalsupplyorders::sap.suite.ui.generic.template.ListReport.view.ListReport::SupplyOrders--listReportFilter-filterItemControl_BASIC-StudyID-valueHelpDialog-table-0","methods":["getWidth","setWidth","getMinWidth","setMinWidth", ...],"className":"sap.ui.table.Column","key":"sapui.table.Table{\"controlType\":\"sap.ui.comp.valuehelpdialog.ValueHelpDialog\"}"}

image

The control info shows that class name is sap.ui.table.Column.

event though, I change the selector from controlType to id, the result is same.

  const oTable = await browser.asControl({
      selector : {
                id: /.*SupplyOrders--listReportFilter-filterItemControl_BASIC-StudyID-valueHelpDialog-table$/
      }
  });

Expected behavior should get the table in value help dialog, but get the column.

vobu commented 2 years ago

Hi, thanks for providing detailed info + context on the issue πŸ‘ as a quick first idea: can you try adding interaction: "root" to your selector?

selector : {
          interaction: 'root',
          controlType: 'sap.ui.table.Table', 
          ancestor: {
              controlType: 'sap.ui.comp.valuehelpdialog.ValueHelpDialog',
          }
      }

this property stems from the OPA5 matchers weβ€˜re using and is a well know trap πŸͺ€ πŸ˜„ documentation for this is upcoming in https://github.com/ui5-community/wdi5/pull/285

github-actions[bot] commented 2 years ago

hey πŸ‘‹ - silence for 30 days 🀐 ... anybody? πŸ˜€

github-actions[bot] commented 2 years ago

closed πŸ“΄ because silencio 🀫 since an additional 14 days after staleness πŸ“