Closed fIannazzo closed 2 years ago
you're most likely missing interaction: "root"
in the selector.
it's a UI5 core/OPA5 thingie for retrieving controls that we documented at https://ui5-community.github.io/wdi5/#/recipes?id=using-interaction-on-a-selector
As @vobu already written: The interaction: "root"
selector is missing. I also had a look at your test and saw that you use the lateInjection of wdi5
even though you are directly starting the tests in an UI5 Application. I updated your script a little bit and this works fine:
describe("My Login application", () => {
it("before", async () => {
const selector = {
forceSelect: true,
selector: {
id: "container-todo---app--todoList",
interaction: "root"
},
};
const oList = await browser.asControl(selector);
expect((await oList.getItems()).length).toEqual(2)
});
});
Describe the bug I have added the wdi5 framework to the openui5 sample app to play around with the framework. I'm trying to select the List Item by using an selector on id field
const selector = { forceSelect: true, selector: { id: "container-todo---app--todoList", }, };
const oList = await browser.asControl(selector); console.log("List ID " + (await oList.getId()));
To Reproduce Steps to reproduce the behaviour:
Clone https://github.com/fIannazzo/openui5-sample-app and run
node_modules/.bin/wdio run wdio.conf.js
in Debug console.Expected behavior I would expect oList.getId() to be something like "container-todo---app--todoList" but ID is "container-todo---app--todoList-trigger". Seems the selector for id does not work correctly.
Logs/Console Output
Screenshots
Expected the green as id, but getting the red one with trigger at the end.
Runtime Env (please complete the following information):
wdi5/wdio-ui5-service
-version: 0.9.12UI5
version: 1.106.0wdio
-version (output ofwdio --version
): 7.24node
-version (output ofnode --version
): 18.8.0Additional context Add any other context about the problem here, e.g. any options the target browser is started with like
--headless
or if the tests run in a CI environment