Closed soraY27 closed 2 years ago
thanks for providing such a detailed error description and log!
i just checked and indeed we don't have a sap.m.Select
in our tests yet.
let us get onto this, then we'll check back in here with the results.
bug confirmend, fix underway
please also note that due to the implementation of the sap.m.Select
, you have to first interact with the dropdown before its' items appear in the DOM and are thus selectable.
See the respective test for a code example: https://github.com/js-soft/wdi5/blob/10eae1d3fd07aa26d4335bafa290f142535c9e03/examples/ui5-js-app/webapp/test/e2e/locators-basic.test.js#L71-L80
Wow you guys are really fast! Thank you dear WDI5 team for the quick solution 🙏
hmm. Just wondering: will select.open() work (be enough) if the select is disabled (enabled=false and/or editable=false)?
you'll need the select.open()
only for getting to the items aggregation.
for locating the select
itself, browser.asControl(selector)
is sufficient.
getSelectedItem
wasn't working before the patch (which is an aggregation, but an aggregation to a single item, visible while select is closed - but I have not the slightest idea whether the rendered HTML has enough information to describe that item object).
I'm not sure whether we ever need the getSelectedItem
for a disabled select. but without getSelectedItem
there is no way to find out, what is currently shown in the select control (what is visible to the user)
PS: I guess, using getSelectedKey should work if we know the key, which may be a "random" guid, though
PPS: select.setEnabled(true)
+ select.open()
should work in combination, so probably not that big deal after all...
Describe the bug While writing the tests it was noticed that the method "getSelectedItem()" of the control "sap.m.Select" (https://sapui5.hana.ondemand.com/#/api/sap.m.Select%23methods/getSelectedItem) does not return a WDI5Control object. Instead, the object is output as a string on the console and returned as a simple object (Not of the type WDI5Control). This makes it impossible to continue working with the requested control.
To Reproduce Steps to reproduce the behavior:
Expected behavior The object is not output to the console and is instead stored as an WDI5Control object in a variable.
Logs/Console Output Output.txt
Screenshots
Runtime Env (please complete the following information):
wdi5/wdio-ui5-service
-version: 0.9.3UI5
version: 1.102.1wdio
-version (output ofwdio --version
): 8.3.2node
-version (output ofnode --version
): v14.18.3