wdi5 icon indicating copy to clipboard operation
wdi5 copied to clipboard

Native methods of UI5 aggregation filterGroupItems cannot be invoked for sap.ui.comp.filterbar.FilterBar

Open borceacristiann opened this issue 1 year ago • 1 comments

Describe the bug Similar to something what is described in this issue, none of the filterGroupItems methods can be used.

FilterBar has an aggregation called filterGroupItems of type sap.ui.comp.filterbar.FilterGroupItem. Each FilterGroupItem has a property called label.

The below is my code. I'm just invoking the getLabel method

const filterBar =  await browser.asControl({
            selector: {
                id: /.*tableId$/,
                controlType: "sap.ui.table.Table",
                interaction: "root"
            },
            forceSelect: true
        })
const fiterGroupItems = await filterBar.getFilterGroupItems();

const firstLabel = await fiterGroupItems[0].getLabel()

expect(fisrtLabel).toBeTruthy()

This doesn't work, because the native UI5 methods of FilterGroupItem don't seem to be available on each of the items in aggregation. This leads to a type error about missing function

To Reproduce Invoke getLabel on items of filterGroupItems aggregation of FilterBar

Expected behavior The label of the filter item

Logs/Console Output getLabel is not a function

Screenshots

Runtime Env (please complete the following information):

  • wdi5/wdio-ui5-service-version: 0.9.13
  • UI5 version: 1.96.0
  • wdio-version: 7.25.0
  • node-version: 14.17.3
  • OS: macOS Monterey 12.6
  • Browser + Version: Chrome 106.0.0

borceacristiann avatar Oct 03 '22 09:10 borceacristiann

Hello, do you have any news related to this issue?

borceacristiann avatar Oct 27 '22 11:10 borceacristiann

Hi @borceacristiann, sry for late response.

I am litte confused. Your selector indicates you try to select an sap.ui.table.Table.

Can you please double check the length of the result array of await filterBar.getFilterGroupItems() so we are sure the elements are retuned in the first place.

Can you please try the shorthand https://ui5-community.github.io/wdi5/#/usage?id=getshorthand-conveniences await filterBar.getFilterGroupItems(0)

Thank you

dominikfeininger avatar Nov 07 '22 11:11 dominikfeininger