ui5-community / wdi5

official UI5 end-to-end test framework for UI5 web-apps. wdi5 = Webdriver.IO + UI5 Test API
https://ui5-community.github.io/wdi5/
Apache License 2.0
100 stars 42 forks source link

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

Closed pp0001 closed 1 day ago

pp0001 commented 1 month ago

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):

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 commented 1 month ago

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 commented 1 month ago

@pp0001,

could you please test your issue again with wdi5 2.0.8?

pp0001 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

github-actions[bot] commented 2 weeks ago

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

github-actions[bot] commented 1 day ago

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