Closed nilskasseckert closed 3 years ago
Hi Nils, in case you have a growing list please check issue 61
Hi @dominikfeininger ,
thanks for the fast answer. Where should I add this interaction root? In the selector this seems not to be working.
I wrote following code:
const oSelector = {
forceSelect: true,
interaction: "root",
selector: {
interaction: "root",
controlType: "sap.m.List"
}
masterList: {
forceSelect: true,
selector: {
viewName: "your.view",
id: "masterList",
interaction: "root"
}
}
Unfortunately same result
the selector above definitely works for the default ui5 sap.m.List w/ growing
enabled.
In order to search in open dialogs you might need to
searchOpenDialogs: true
in the selector. i don't recall explicitly testing wdi5
for that locator strategy. so:
wdi5
itselfbtw: we're using the exact same selectors as OPA5 and UIveri5 - if it works there/here it works here/there.
Good morning,
This is exactly our problem. We have a UI5 app with OPA5 tests and we want to migrate it to WDI5. In OPA5 everything is working. WDI5 crashes with the above error.
I debugged this. The mentioned error comes here: https://github.com/js-soft/wdi5/blob/1651f78d76b7b7e5b8c0fe55295006b151079cf8/wdio-ui5-service/src/lib/WDI5.js#L574
But the result from the done success handler here https://github.com/js-soft/wdi5/blob/1651f78d76b7b7e5b8c0fe55295006b151079cf8/wdio-ui5-service/src/lib/WDI5.js#L563 looks good:
["success",{},"ylpmylib--dlgSelect-list",["getBackgroundDesign","setBackgroundDesign","getInset","setInset",
"getHeaderText","setHeaderText","getHeaderDesign","setHeaderDesign","getFooterText","setFooterText","getMode","setMode",
"getWidth","setWidth","getIncludeItemInSelection","setIncludeItemInSelection","getShowUnread","setShowUnread","getNoDataText",
"setNoDataText","getShowNoData","setShowNoData","getEnableBusyIndicator","setEnableBusyIndicator","getModeAnimationOn",
"setModeAnimationOn","getShowSeparators","setShowSeparators","getSwipeDirection","setSwipeDirection","getGrowing","setGrowing",
"getGrowingThreshold","setGrowingThreshold","getGrowingTriggerText","setGrowingTriggerText","getGrowingScrollToLoad",
.....]]"
This OPA5 code works:
this.waitFor({
id: "ylpmylib--dlgSelect-dialog",
controlType: "sap.m.Dialog",
actions: [oDialog => {
//List Found
}],
errorMessage: "List not found"
});
ok, so there are different issues here:
judging by your code above, you're querying for a sap.m.Dialog
, not a sap.m.List
this.waitFor({
id: "ylpmylib--dlgSelect-dialog",
controlType: "sap.m.Dialog",
actions: [oDialog => {
//List Found
}],
errorMessage: "List not found"
});
in the initial issue report, you were talking about a sap.m.List
:
const oSelector = {
forceSelect: true,
selector: {
controlType: "sap.m.List"
}
};
const oList = browser.asControl(oSelector);
so please provide the entire code/use case here - my guess is that it's a combination of things.
Oh Sorry I mixed it up this morning.
But the issue is the same.
WDI5 Code:
const oSelector = {
forceSelect: true,
selector: {
controlType: "sap.m.Dialog",
id: "ylpmylib--dlgSelect-dialog"
}
};
const oDialog = browser.asControl(oSelector);
OPA5 Code:
this.waitFor({
id: "ylpmylib--dlgSelect-dialog",
controlType: "sap.m.Dialog",
actions: [oDialog => {
//Dialog Found
}],
errorMessage: "Dialog not found"
});
Same with the list.
I can see at the screen the dialog and the list.
I have found the issue but currently thinking how to fix.
The array returned is incorrect. This is an array in array in a array https://github.com/js-soft/wdi5/blob/1651f78d76b7b7e5b8c0fe55295006b151079cf8/wdio-ui5-service/src/lib/WDI5.js#L574
If I change the line to:
this._webdriverRepresentation = $(`#${result[2][2][2]}`);
All is working fine. But this can not be the fix. The done handler seems to be corrupted.
An possible fix would be:
while (Array.isArray(result[0])) {
result = result[0];
}
// save the webdriver representation by control id
if (result[2]) {
// only if the result is valid
this._webdriverRepresentation = $(`#${result[2]}`);
}
@vobu What do you think? Should I create an PR? Seems a problem with Fiori 1.60
Hi @nilskasseckert, haven't seen this response structure yet. Thanks for investigating. Currently all self test of WDI5 are green. Can you please provide your testcase. We will implement a fix shortly.
Hi @dominikfeininger, we want to test here a simple Fiori App. When you open the app an simple dialog from an external library is loaded and displayed.
I played a little bit around and it seems that a lot of selectors have problems with 1.60. Did you start your test with Fiori Version 1.60.31?
An possible fix would be:
while (Array.isArray(result[0])) { result = result[0]; } // save the webdriver representation by control id if (result[2]) { // only if the result is valid this._webdriverRepresentation = $(`#${result[2]}`); }
@vobu What do you think? Should I create an PR? Seems a problem with Fiori 1.60
well, most certainly! PRs mega-welcome! might take a look at https://github.com/js-soft/wdi5/blob/1651f78d76b7b7e5b8c0fe55295006b151079cf8/wdio-ui5-service/src/lib/wdioUi5-index.js#L84 where some version checking is done
Good morning,
sorry for the late response. I am on it right now but there is a lot to do. The multiversion tests were run only for the basic.tests.
All other tests were not run in multi version. With version 1.60 everything crashes except the basic tests.
Of course, if you don't run the tests, then it looks like everything is working.
I will try to fix as much as possible, but can't promise it.
Regards, Nils
right on! sorry to hear that older UI5 version cause so many troubles w/ the UI5 Testing API and thus wdi5 :( Let us know if you need a helping hand once you got the first batch coded 👍
Hi @vobu,
Thank you for the offer. I have started. Here is the link to it: https://github.com/nilskasseckert/wdi5
Now if you run "npm run test:multiversion", it will only run the navigation hash test. I have fixed some bugs there but the ones that are still there now I have no idea right now.
Can you please have a look?
Thanks!
Regards, Nils
Good morning,
I found the error. In 1.60 it is mandatory that you access the lists always with "interaction: true". Otherwise it is not working.
Regards, Nils
Good morning,
I found the error. In 1.60 it is mandatory that you access the lists always with "interaction: true". Otherwise it is not working.
🙌
Hi @vobu,
Thank you for the offer. I have started. Here is the link to it: https://github.com/nilskasseckert/wdi5
Now if you run "npm run test:multiversion", it will only run the navigation hash test. I have fixed some bugs there but the ones that are still there now I have no idea right now.
Can you please have a look?
yes, we'll try and have a look. could you please do a PR with your current implementation effort? then we'll work from there on.
Hi @vobu ,
PR is opened: https://github.com/js-soft/wdi5/pull/77
Lets discuss there. Currently some other tests failing and the error is strange.
I think we can close this issue or and work in the PR?
Regards, Nils
yep, closing this. thanks for your efforts so far!!!
Hello,
we have a very very simple use case. We want to identify a list that is displayed in a dialog. For this we have the following very simple code:
When we execute this then we get following error:
Looks like a bug in WDI5. The library was presented at the UI5 Con. Is this production ready or rather beta stage?
Regards, Nils