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

Cannot select appointments of Planning Calendar #257

Closed
malkoto1 opened this issue May 12, 2022 · 16 comments
Closed

Cannot select appointments of Planning Calendar #257

malkoto1 opened this issue May 12, 2022 · 16 comments
Assignees

Comments

@malkoto1
Copy link

Hi there I have and application to test that uses the planning calendar control.

I am stuck on getting all the appointments of a given row.

  it("should show aggreates of planning calendar", async () => {
    // I wait for a button to be clickable (which means that my app has loaded
    const showBtn = await CL.getShowButton();
    await browser.waitUntil(() => showBtn.$().isClickable());
    // I get the planning calendar
    const pc = await CL.getPlanningCalendar();
    // I get aggregated rows
    const rows = await pc.getAggregation("rows");
    for (const row of rows) {
        console.log(await row.getAggregation("appointments"));
        //console.log(row.getControlInfo());
    }
  });

What I receive for each row is the following (when I run the above test):

[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[364:11816:0513/000615.543:ERROR:device_event_log_impl.cc(214)] [00:06:15.543] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[364:11816:0513/000615.545:ERROR:device_event_log_impl.cc(214)] [00:06:15.544] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[364:11816:0513/000615.546:ERROR:device_event_log_impl.cc(214)] [00:06:15.545] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[364:11816:0513/000615.547:ERROR:device_event_log_impl.cc(214)] [00:06:15.546] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] undefined has no sReplFunctionNames
[0-0] [wdi5] call of getControl() failed because of: Error: No DOM element found using the control selector {"id":"__row0-__xmlview0--schedulePlanningCalendar-1"}
[0-0] [wdi5] __row0-__xmlview0--schedulePlanningCalendar-1 has no sReplFunctionNames
[0-0] [wdi5] call of getControl() failed because of: Error: No DOM element found using the control selector {"id":"__row0-__xmlview0--schedulePlanningCalendar-2"}
[0-0] [wdi5] __row0-__xmlview0--schedulePlanningCalendar-2 has no sReplFunctionNames
[0-0] [wdi5] call of getControl() failed because of: Error: No DOM element found using the control selector {"id":"__row0-__xmlview0--schedulePlanningCalendar-3"}
[0-0] [wdi5] __row0-__xmlview0--schedulePlanningCalendar-3 has no sReplFunctionNames
[0-0] [wdi5] call of getControl() failed because of: Error: No DOM element found using the control selector {"id":"__row0-__xmlview0--schedulePlanningCalendar-4"}
[0-0] [wdi5] __row0-__xmlview0--schedulePlanningCalendar-4 has no sReplFunctionNames
[0-0] [wdi5] call of getControl() failed because of: Error: No DOM element found using the control selector {"id":"__row0-__xmlview0--schedulePlanningCalendar-5"}
[0-0] [wdi5] __row0-__xmlview0--schedulePlanningCalendar-5 has no sReplFunctionNames
[0-0] [wdi5] call of getControl() failed because of: Error: No DOM element found using the control selector {"id":"__row0-__xmlview0--schedulePlanningCalendar-6"}
[0-0] [wdi5] __row0-__xmlview0--schedulePlanningCalendar-6 has no sReplFunctionNames
[0-0] [wdi5] call of getControl() failed because of: Error: No DOM element found using the control selector {"id":"__row0-__xmlview0--schedulePlanningCalendar-7"}
[0-0] [wdi5] __row0-__xmlview0--schedulePlanningCalendar-7 has no sReplFunctionNames
[0-0] [wdi5] call of getControl() failed because of: Error: No DOM element found using the control selector {"id":"__row0-__xmlview0--schedulePlanningCalendar-0"}
[0-0] [wdi5] __row0-__xmlview0--schedulePlanningCalendar-0 has no sReplFunctionNames
[0-0] [wdi5] call of _getAggregation() failed because of: TypeError: Cannot read properties of undefined (reading 'getAggregation')
[0-0] []
[0-0] [wdi5] call of _getAggregation() failed because of: TypeError: Cannot read properties of undefined (reading 'getAggregation')
[0-0] []
[0-0] [wdi5] call of _getAggregation() failed because of: TypeError: Cannot read properties of undefined (reading 'getAggregation')
[0-0] []
[0-0] [wdi5] call of _getAggregation() failed because of: TypeError: Cannot read properties of undefined (reading 'getAggregation')
[0-0] []
[0-0] [wdi5] call of _getAggregation() failed because of: TypeError: Cannot read properties of undefined (reading 'getAggregation')
[0-0] []
[0-0] [wdi5] call of _getAggregation() failed because of: TypeError: Cannot read properties of undefined (reading 'getAggregation')
[0-0] []
[0-0] [wdi5] call of _getAggregation() failed because of: TypeError: Cannot read properties of undefined (reading 'getAggregation')
[0-0] []
[0-0] [wdi5] call of _getAggregation() failed because of: TypeError: Cannot read properties of undefined (reading 'getAggregation')
[0-0] []

And if I try to run the commented line instead (to get the Control Info) I get the following output for every element

{
[0-0]   '$': [
[0-0]     'newSession',
[0-0]     'deleteSession',
[0-0]     'status',
[0-0]     'getTimeouts',
[0-0]     'setTimeouts',
[0-0]     'getUrl',
[0-0]     'navigateTo',
[0-0]     'back',
[0-0]     'forward',
[0-0]     'refresh',
[0-0]     'getTitle',
[0-0]     'getWindowHandle',
[0-0]     'closeWindow',
[0-0]     'switchToWindow',
[0-0]     'createWindow',
[0-0]     'getWindowHandles',
[0-0]     'printPage',
[0-0]     'switchToFrame',
[0-0]     'switchToParentFrame',
[0-0]     'getWindowRect',
[0-0]     'setWindowRect',
[0-0]     'maximizeWindow',
[0-0]     'minimizeWindow',
[0-0]     'fullscreenWindow',
[0-0]     'findElement',
[0-0]     'findElementFromShadowRoot',
[0-0]     'findElements',
[0-0]     'findElementsFromShadowRoot',
[0-0]     'findElementFromElement',
[0-0]     'findElementsFromElement',
[0-0]     'getElementShadowRoot',
[0-0]     'getActiveElement',
[0-0]     'isElementSelected',
[0-0]     'isElementDisplayed',
[0-0]     'getElementAttribute',
[0-0]     'getElementProperty',
[0-0]     'getElementCSSValue',
[0-0]     'getElementText',
[0-0]     'getElementTagName',
[0-0]     'getElementRect',
[0-0]     'isElementEnabled',
[0-0]     'elementClick',
[0-0]     'elementClear',
[0-0]     'elementSendKeys',
[0-0]     'getElementValue',
[0-0]     'getPageSource',
[0-0]     'executeScript',
[0-0]     'executeAsyncScript',
[0-0]     'getAllCookies',
[0-0]     'addCookie',
[0-0]     'deleteAllCookies',
[0-0]     'getNamedCookie',
[0-0]     'deleteCookie',
[0-0]     'performActions',
[0-0]     'releaseActions',
[0-0]     'dismissAlert',
[0-0]     'acceptAlert',
[0-0]     'getAlertText',
[0-0]     'sendAlertText',
[0-0]     'takeScreenshot',
[0-0]     'takeElementScreenshot',
[0-0]     'getElementComputedRole',
[0-0]     'getElementComputedLabel',
[0-0]     'setPermissions',
[0-0]     'generateTestReport',
[0-0]     'createMockSensor',
[0-0]     'getMockSensor',
[0-0]     'updateMockSensor',
[0-0]     'deleteMockSensor',
[0-0]     'setTimeZone',
[0-0]     'addVirtualAuthenticator',
[0-0]     'removeVirtualAuthenticator',
[0-0]     'addCredential',
[0-0]     'getCredentials',
[0-0]     'removeAllCredentials',
[0-0]     'removeCredential',
[0-0]     'setUserVerified',
[0-0]     'isAlertOpen',
[0-0]     'isAutoReporting',
[0-0]     'setAutoReporting',
[0-0]     'isLoading',
[0-0]     'takeHeapSnapshot',
[0-0]     'getNetworkConnection',
[0-0]     'setNetworkConnection',
[0-0]     'getNetworkConditions',
[0-0]     'setNetworkConditions',
[0-0]     'deleteNetworkConditions',
[0-0]     'sendCommand',
[0-0]     'sendCommandAndGetResult',
[0-0]     'file',
[0-0]     'launchChromeApp',
[0-0]     'elementHover',
[0-0]     'touchPinch',
[0-0]     'freeze',
[0-0]     'resume',
[0-0]     'getCastSinks',
[0-0]     'selectCastSink',
[0-0]     'startCastTabMirroring',
[0-0]     'getCastIssueMessage',
[0-0]     'stopCasting',
[0-0]     ... 97 more items
[0-0]   ],
[0-0]   id: undefined,
[0-0]   methods: undefined,
[0-0]   className: undefined,
[0-0]   key: '__row0-__xmlview0--schedulePlanningCalendar-6'
[0-0] }

The planning calendar seems to be located correctly, but the aggregations are not. Is there something that I am missing? Or am I doing something wrong? Or this is how it works: We can only get the keys of the aggregations and then we need to locate them separately with "asControl() and a selector?

@dominikfeininger
Copy link
Collaborator

Hi @malkoto1, No DOM element found using the control selector comes from the UI5 RecordReplay API. So the DOM element actually wasn't found. I guess it's the PlanningCalendar itself.

Anyways undefined has no sReplFunctionNames is from WDI5 and should not happen this way.

@vobu
Copy link
Contributor

vobu commented May 16, 2022

Anyways undefined has no sReplFunctionNames is from WDI5 and should not happen this way.

that being said, what wdi5/wdio-ui5-service version are you using?
it is always helpful to provide the tech env details we ask for in the pre-configured issue template.

@malkoto1
Copy link
Author

Hi all, thanks for the comments.

@dominikfeininger - the planning calendar is found and has all its methods. (the getControlInfo() method returns all the information and all the functions that are applicable to the control).

@vobu - It was template for a bug and I am not sure that I have a bug with me

    wdi5: {
        screenshotPath: require("path").join("screenshots"), // [optional] {string}, default: ""
        screenshotsDisabled: false, // [optional] {boolean}, default: false; if set to true, screenshots won't be taken and not written to file system
        logLevel: "error", // [optional] error | verbose | silent, default: "error"
        url: "index.html", // [mandatory] {string} name of your bootstrap html file. If your server autoredirects to a 'domain:port/'-like root url, use empty string ''
        skipInjectUI5OnStart: false, // [optional] {boolean}, default: false; true when UI5 is not on the start page, you need to later call <wdioUI5service>.injectUI5() manually
        waitForUI5Timeout: 15000 // [optional] {number}, default: 15000; maximum waiting time in milliseconds while checking for UI5 availability
    },

The devDependencies:

  "devDependencies": {
    "@ui5/cli": "^2.14.1",
    "@wdio/cli": "^7.19.6",
    "@wdio/local-runner": "^7.19.5",
    "@wdio/mocha-framework": "^7.19.5",
    "@wdio/spec-reporter": "^7.19.5",
    "chromedriver": "^100.0.0",
    "eslint": "^8.3.0",
    "local-web-server": "^3.0.7",
    "prettier": "^2.5.0",
    "rimraf": "^3.0.2",
    "wdio-chromedriver-service": "^7.3.2",
    "wdio-ui5-service": "^0.9.0-rc4.2"
  }

@malkoto1
Copy link
Author

Hi there, an update from my investigation:

As you can see, the rows of the calendar are named in the following way: __row0-__xmlview0--schedulePlanningCalendar-1, __row0-__xmlview0--schedulePlanningCalendar-2... as the error: ```
[0-0] [wdi5] call of getControl() failed because of: Error: No DOM element found using the control selector {"id":"__row0-__xmlview0--schedulePlanningCalendar-1"}
[0-0] [wdi5] __row0-__xmlview0--schedulePlanningCalendar-1 has no sReplFunctionNames

Their type is sap.m.PlanningCalendarRow

I found that I can retrieve the rows with the following ids: __row0-__xmlview0--schedulePlanningCalendar-1-CLI, __row0-__xmlview0--schedulePlanningCalendar-2-CLI
and their type in that way is sap.m.internal.PlanningCalendarRowListItem

It seems to me that the locator cannot find elements by ID as expected. It is not that smart. The DOM tree looks as follows:

image

There is no element in it with the ID of the aggregated element.

The question is "Am I still missing something or just the wdio5 itself lacks skills?"

@dominikfeininger
Copy link
Collaborator

How does your selector looks like?

It might be that you found a bug in UI5. The Id of the Row is not generated as its supposed to be. We already know of a similar issue with sap.m.ComboBox see #191

Would be happy to do a deep investigation myself. Can you please provide a full minimal example? Or contribute an example in the WDI5 example app. Thx

@dominikfeininger dominikfeininger self-assigned this May 18, 2022
@malkoto1
Copy link
Author

Hi there,

Plsease see attached a sample project.
Example_tests.zip

@dominikfeininger
Copy link
Collaborator

dominikfeininger commented May 24, 2022

Hi, sry for the delay. Had a glance into your example. Thanks for providing the code.

Unfortunately it is like expected. See the screenshot. It is a UI5 "Bug". The getAggregation("rows") call returns the three rows with id: "__row0-container-testCalendarApp---idAppControl--PC1-1" (console). But the actual DomId is: __row0-container-testCalendarApp---idAppControl--PC1-1-CLInote the postfix-CLI`. So wdio is not able to retrieve the DOM part of the control.

This should be fixed on UI5 side. Until then I will provide a working solution like we did with the sap.m.Combobox. Please give me some days. To speed things up you are very welcome to integrate your PlanningCalendar test into the wdi5 example on a new page/ route. Since the most effort is to provide the test/ testcase and the required example in the sample app.
See How to contribute: https://js-soft.github.io/wdi5/#/contributing

Screenshot 2022-05-24 at 09 32 31

@dominikfeininger
Copy link
Collaborator

Hi @malkoto1,

unfortunately my first intention did't fix it right away. PR is not ready yet. The PlanningCalendar and it's aggregations seem to work in a tricky and non straight forward way.

ps. I am going to be on vacation the next two weeks and won't continue to work on this PR. Feel free to investigate and improve it yourself.

@malkoto1
Copy link
Author

Hi Dominik,

I am a bit overwhelmed with tasks but hope that very soon will upload the test to the example.

Meanwhile, while we do things on WDI5 side, shouldn't we create an issue on UI5 side for that?

Regards,
Rado

@malkoto1
Copy link
Author

Hi Dominik,

Did you manage to try another round for a workaround on that? Moreover, should we contact UI5 guys and try to push them to change something on their side?

@vobu
Copy link
Contributor

vobu commented Jul 5, 2022

(not Dominik, but still 😆 ) Dominik is on vacation and afterwards on parental leave. I know that he plans on working on this issue after he's back from vacation, during his parental leave - no guarantees time-wise though, as 👶 has precedence ;)

@malkoto1
Copy link
Author

malkoto1 commented Jul 6, 2022

Thanks a lot for the update!

Of course that the baby is with priority :D

@github-actions
Copy link

github-actions bot commented Aug 6, 2022

hey 👋 - silence for 30 days 🤐 ... anybody? 😀

@github-actions github-actions bot added the stale label Aug 6, 2022
@github-actions
Copy link

closed 📴 because silencio 🤫 since an additional 14 days after staleness 📠

@malkoto1
Copy link
Author

malkoto1 commented Aug 22, 2022

Guys,

This needs to be reopened as we are waiting for a fix here.

(Dominik is on paternity, isn't there anyone else that can take a look?)

@malkoto1
Copy link
Author

Hello all,

is there any movement on this item?

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

No branches or pull requests

3 participants