Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native methods of UI5 aggregation items cannot be invoked for sap.m.MultiComboBox #354

Closed
borceacristiann opened this issue Oct 3, 2022 · 5 comments
Assignees

Comments

@borceacristiann
Copy link

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

MultiComboBox has an aggregation called items of type sap.ui.core.Item.
Each Items has a property called text.

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

const multicomboBox =  await browser.asControl({
            selector: {
                id: /.*id$/,
                controlType: "sap.m.MultiComboBox",
                interaction: "root"
            },
            forceSelect: true
        })
await multiComboBox.open();

const items = await multiComboBox.getItems();

const firstItemText = await items[0].getText()

expect(firstItemText).toBeTruthy()

This doesn't work, because the native UI5 methods of sap.ui.core.Item 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 getText on items of items aggregation of multiComboBox

Expected behavior
The text of the item

Logs/Console Output
getText 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
@dominikfeininger dominikfeininger self-assigned this Oct 5, 2022
@dominikfeininger dominikfeininger linked a pull request Oct 5, 2022 that will close this issue
@dominikfeininger
Copy link
Collaborator

dominikfeininger commented Oct 5, 2022

Added a test in PR.

Also note the rendered Item is type sap.m.StandardListItem -> getText() needs to be getTitle(). This is a UI5 flaw and will be documented in the wdi5 documentation. Same applies for sap.m.Combobox recipes

@vobu vobu closed this as completed in 3432687 Oct 26, 2022
@borceacristiann
Copy link
Author

Hi @dominikfeininger, thanks for pointing me to the correct method. (getTitle)

However, the problem persists because no UI5 method is generated for the combobox items. I have attached some screenshots that I took while debugging, please take a look.

image

Screenshot 2022-10-27 at 15 35 54

image

@borceacristiann
Copy link
Author

Hello colleagues, please reopen this issue because as I mentioned in the previous message the problem still persists.

@vobu
Copy link
Contributor

vobu commented Jan 13, 2023

happy to reopen this, but FTR: we included a test just for this bug and its fix:

it("get text from items list", async () => {

...where we're doing essentially the same thing as you: open a multi combo box and operate on an aggregation item.
maybe the referenced test can help you as a blueprint, specifically the interaction: "root" as part of the combox box selector?

@vobu vobu reopened this Jan 13, 2023
@borceacristiann
Copy link
Author

Hello, I tested once more and everything seems to work fine.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants