Closed ph-alsvik closed 2 years ago
hi! all looking good on your code (except the timeout
selector option that doesn‘t exist (https://js-soft.github.io/wdi5/#/configuration?id=wdi5) 😝)
we still have an issue with ComboBox → see #121
so it‘s on our todo, but not yet done
ok for you to track this in #121 and closing this?
Thanks for your reply! Yes, I'll close this issue. Just want to add one final thing:
I did a little investigation myself. I think the issue is related to this part in executeControlMethod.js:
if (Array.isArray(result)) {
// expect the method call delivers non-primitive results (like getId())
// but delivers a complex/structured type
// -> currenlty, only getAggregation(...) is supported
result = window.wdi5.createControlIdMap(result)
done(["success", result, "aggregation"])
}
It seems that when the returned value of one of the get$Shorthand-methods is an array, wdi5 assumes its an array of objects, but in case of getSelectedKeys its an array of strings.
Perhaps you already know, but sharing my knowledge just in case 😃
Thanks for your reply! Yes, I'll close this issue. Just want to add one final thing:
I did a little investigation myself. I think the issue is related to this part in executeControlMethod.js:
if (Array.isArray(result)) { // expect the method call delivers non-primitive results (like getId()) // but delivers a complex/structured type // -> currenlty, only getAggregation(...) is supported result = window.wdi5.createControlIdMap(result) done(["success", result, "aggregation"]) }
It seems that when the returned value of one of the get$Shorthand-methods is an array, wdi5 assumes its an array of objects, but in case of getSelectedKeys its an array of strings.
Perhaps you already know, but sharing my knowledge just in case 😃
excellent, thanks for the hint! now that you're already that close to the root cause....how about giving a fix and a Pull Request a shot?!? 🚀
i'm just writing the dev time setup/onboarding doc (see #163), but here's the gist:
# you need npm 7+ → we're using npm's workspaces feature
$> npm --version
# will also install all deps in workspaces + setup pre-commit hooks
$> npm i
# build entire proj once
$> npm run build
# turn on build watcher
$> npm run build:watch
Then to work on a test: ...in terminal 1:
# start the sample js app
$> npm run _startApp:js
...in terminal 2:
# run a single test with wdi5/wdio
### runs the "test:websever" script from /examples/ui5-js-app/package.json
### in workspace "examples/ui5-js-app"
### but only any test file in /examples/ui5-js-app/webapp/test/e2e/**/* that
### matches "basic" in the filename
### and run in watch mode (browser stays open, test reruns when file changes)
### for true TDD
$> npm run test:webserver -w examples/ui5-js-app -- --spec basic --watch
Sure! I'll try to fix it 😄
Hello folks!
So I have an app with a MultiComboBox control with string-valued keys. I've written a simple test in wdi5 which gets this control and checks if a certain key is preset. The test looks like this:
I get the control without issue, but when calling the getSelectedKeys-method on it, it fails with a timeout-error.
Inspecting the console in the browser reveals that there is a type error in the code running in the client:
Have I written the test wrong or is this a bug?
If something is unclear with this issue, just let me know.
Thank you!