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

Unable to invoke UI5 native methods for SmartFilterBar #173

Closed rwnbiad closed 2 years ago

rwnbiad commented 2 years ago

Describe the bug I'm able to find the UI5 control (sap.ui.comp.smartfilterbar.SmartFilterBar) control using locator having id (below).

const smartFilterBar = await browser.asControl({
      forceSelect: true,
      selector: {
        id: 'smartFilterBar',
        controlType: 'sap.ui.comp.smartfilterbar.SmartFilterBar',
        viewName: viewName,
        interaction: 'root'
      }
    })

During runtime, proxy methods for all the methods that would be available on sap.ui.comp.smartfilterbar.SmartFilterBar (ex: setFilterData, getAllFilterItems) seem to be available on the located control as well.

Screen Shot 2022-03-09 at 12 39 31 AM

However, while trying to invoke a method on smartfilterbar, the below error comes up.

const smartFilterBar = await browser.asControl({
      forceSelect: true,
      selector: {
        id: 'smartFilterBar',
        controlType: 'sap.ui.comp.smartfilterbar.SmartFilterBar',
        viewName: viewName,
        interaction: 'root'
      }
    }).getAllFilterItems()

[wdi5]call of _getControl() failed because of: Error: waitAsync is already running and cannot be called again at this moment

Just for the sake of completeness, I also tried using setFilterData method on SmartFilterBar.

const control = await browser.asControl({
      forceSelect: true,
      selector: {
        id: 'smartFilterBar',
        controlType: 'sap.ui.comp.smartfilterbar.SmartFilterBar',
        viewName: viewName,
        interaction: 'root'
      }
    })
    await control.setFilterData({ productDisplayId: 'D2O_XY00174197' })

Again, during debugging the proxy method seems available.

Screen Shot 2022-03-09 at 1 54 34 AM

But running the test to completion results in the below error.

[wdi5]call of setFilterData failed because of: function setFilterData does not exist on control sap.ui.comp.smartfilterbar.SmartFilterBar!

To Reproduce Steps to reproduce the behavior:

Expected behavior I thought this is a fairly straight-forward use case. It should return an array for filter items.

Logs/Console Output [wdi5]call of _getControl() failed because of: Error: waitAsync is already running and cannot be called again at this moment

Screenshots See above

Runtime Env (please complete the following information):

vobu commented 2 years ago

hi, thanks for providing details and context for your issue 👍 and indeed, this smells 👃 like a bug could you please upgrade wdi5 (or more precisely wdio-ui5-service) to the latest 0.9.0-alpha.1 and see if your issue still persists? we had a major rewrite happening from 0.8.x → 0.9.x. thanks!

rwnbiad commented 2 years ago

@vobu Thanks. The above two native UI5 APIs of SmartFilterBar work fine with 0.9.0-alpha.1 Can we use the release of wdio-ui5-service productively? Or is there some sort of wait time.

I'm closing this issue since, those methods I originally reported work fine. However, there seems to be another issue. I'll create another Github issue for it. Thanks again.

vobu commented 2 years ago

Can we use the release of wdio-ui5-service productively? Or is there some sort of wait time.

0.9.0-* is safe to use in the sense that we'll not change APIs or method signatures anymore. There'll mostly be additions to the overall feature scope. This week, a first release candidate will drop; the final 0.9.0 release will most likely happen toward the end of the month.