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 click/select date in "sap.ui.unified.Calendar" #611

Open
pp0001 opened this issue May 10, 2024 · 6 comments
Open

Cannot click/select date in "sap.ui.unified.Calendar" #611

pp0001 opened this issue May 10, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@pp0001
Copy link

pp0001 commented May 10, 2024

Describe the bug

I tried to select a date range in "sap.ui.unified.Calendar"
But through following code cannot click/select the date correctly.

await browser.asControl({
    	selector: {
            id: "application-BusinessUser-recordAuditTime-component---workarea--calendar--Month1",
            interaction: {
                    idSuffix: "20240508"
            }
    }}).press();

Screenshots
if applicable, add screenshots to help explain your problem.
image

Runtime Env (please complete the following information):

  • wdi5/wdio-ui5-service-version: ^2.0.6
  • UI5 version: 1.114.0
  • node-version (output of node --version): v20.11.0
  • Browser + Version: chrome 124.0.6367.92

Additional 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

@Siolto
Copy link
Collaborator

Siolto commented May 10, 2024

Hi @pp0001,

thanks for reporting this issue! This is a bug. To give you more context:

The identification with the idSuffix is working fine. We have a problem with our press function as the idSuffix ist not passed here correctly.

@Siolto Siolto added the bug Something isn't working label May 10, 2024
@Siolto
Copy link
Collaborator

Siolto commented May 13, 2024

@pp0001,

could you please test your issue again with wdi5 2.0.8?

@pp0001
Copy link
Author

pp0001 commented May 14, 2024

Hi @Siolto ,

I tried to modify the version in the package.json, like "wdio-ui5-service": "^2.0.8"

Then repeat the following step, but the date cannot be selected.

        await browser.asControl({
            selector: {
                id: "application-BusinessUser-recordAuditTime-component---workarea--calendar--Month1",
                interaction: {
                        idSuffix: "20240508"
                }
        }}).press()

@Siolto
Copy link
Collaborator

Siolto commented May 14, 2024

I have added a test for the fix and it is working fine on our site.

Can you please check that you really have the newest version installed?

@pp0001
Copy link
Author

pp0001 commented May 15, 2024

Hello,

Thanks for you reply.
I tried to re-install the dependencies, and currently the version of "wdio-ui5-service" is "2.0.8".
image

And the UI5 version is "1.114.0".
And from the local file I found that the code of "press" function.
image

async press() {
        // support fluent async api
        let className;
        let controlSelector;
        let logging;
        if (util.types.isProxy(this._domId)) {
            const _controlInfo = await Promise.resolve(this._metadata);
            className = _controlInfo.className;
            controlSelector = await Promise.resolve(this._controlSelector);
            logging = await Promise.resolve(this._logging);
        }
        else {
            className = this.getControlInfo().className;
            controlSelector = this._controlSelector;
            logging = this._logging;
        }
        // when the interaction locator is existing we want to use the RecordReplay press (interactWithControl)
        if (controlSelector.selector.interaction) {
            if (logging) {
                Logger.info(`using OPA5 Press action to interact with this ${className}...`);
            }
            const oOptions = {
                selector: controlSelector.selector,
                interactionType: "PRESS"
            };
            try {
                await this._interactWithControl(oOptions);
            }
            catch (error) {
                if (logging) {
                    Logger.error(`cannot issue OPA5-press() on control, because ${error.message}`);
                }
            }
        }
        else {
            // interact via wdio
            try {
                await (await this._getWebElement()).click();
            }
            catch (error) {
                if (logging) {
                    Logger.error(`cannot call press(), because ${error.message}`);
                }
            }
        }
        return this;
    }

But the press date is still not working.

        await browser.asControl({
            forceSelect: true,
            selector: {
                id: "application-BusinessUser-recordAuditTime-component---workarea--calendar--Month1",
                interaction: {
                        idSuffix: "20240509"
                }
        }}).press()

And following is my dependencies:

    "dependencies": {
        "@wdio/sauce-service": "^8",
        "deepmerge": "^4.3.1",
        "rimraf": "^5.0"
    },
    "devDependencies": {
        "@wdio/allure-reporter": "^8.27.2",
        "@ui5/cli": "^3",
        "@wdio/cli": "^8.32.4",
        "@wdio/cucumber-framework": "^8.32.4",
        "@wdio/dot-reporter": "^8.27.0",
        "@wdio/junit-reporter": "^8.27.0",
        "@wdio/local-runner": "^8.32.4",
        "@wdio/mocha-framework": "^8.27.0",
        "@wdio/spec-reporter": "^8.32.4",
        "ts-node": "^10.9.2",
        "typescript": "^5.3.3",
        "wdio-timeline-reporter": "^5.1.4",
        "wdio-ui5-service": "latest",
        "wdio-vscode-service": "^6.0.3",
        "dayjs": "^1.11.10"
    }

Are there any other suggestions? Thanks in advance.

Thanks,
Pamela

@pp0001
Copy link
Author

pp0001 commented May 20, 2024

Hello @Siolto ,

Currently the version of "wdio-ui5-service" is "2.0.8" installed in my local environment. I think this is the latest version.
And then when I execute the following code, the date can be focused, but not selected.
The UI5 version is "1.114.0".
And I'm using this framework "@wdio/cucumber-framework": "^8.32.4" to execute test.

Are there any other things I need to update?

        const sMonth1 = await browser.asControl({
            forceSelect: true,
            selector: {
                id: "application-BusinessUser-recordAuditTime-component---workarea--calendar--Month1",
                interaction: {
                        idSuffix: "20240509"
                }
        }})
        
        await sMonth1.press()

Thanks,
Pamela

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants