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

Feature/multi remote support #272

Merged
merged 17 commits into from
Jun 24, 2022

Conversation

monavari-lebrecht
Copy link
Collaborator

add multiremote support, have a closer look at examples/ui5-js-app/webapp/test/e2e/multiremote.test.js and examples/ui5-js-app/wdio-multiremote.conf.js for information how to use it.

Basic usage is:
Change capabilities to

capabilities: {
        one: {
            capabilities: {
                browserName: "chrome",
                acceptInsecureCerts: true
            }
        },
        two: {
            capabilities: {
                browserName: "chrome",
                acceptInsecureCerts: true
            }
        }
    },

So you can access the browser instances either by calling them by their name to get the control instance like in single remote tests:

const button = await browser.two.asControl({
            selector: {
                id: "openDialogButton",
                viewName: "test.Sample.view.Main"
            }
        })

or access them in all instances at the same time:

const button = await browser.asControl({
            selector: {
                id: "openDialogButton",
                viewName: "test.Sample.view.Main"
            }
        })

to get an array of controls from each instance one:

        const buttonOne = button[0]
        const buttonTwo = button[1]

TODO: writing more tests for each command. At the moment only basic tests are integrated.

@@ -1,5 +1,5 @@
async function clientSide_getSelectorForElement(oOptions) {
return await browser.executeAsync((oOptions, done) => {
return await browserInstance.executeAsync((controlSelector, done) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, something misssing here, or just a mixup of changes?

controlSelector = await Promise.resolve(controlSelector) // to plug into fluent async api
return await browser.executeAsync((controlSelector, done) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no use of browserInstance in files client-side-js/ _navTo, getUI5Version, injectTools, injectUI5, testLibrary?

@dominikfeininger
Copy link
Collaborator

hi, when running on my machine I get a different output:

image

It passes but throws errors?

@vobu
Copy link
Contributor

vobu commented Jun 14, 2022

hey @monavari-lebrecht, can you please resolve the merge conflicts so we can get this cool feature in? thanks!

@vobu
Copy link
Contributor

vobu commented Jun 14, 2022

It passes but throws errors?

FTR and as investigated: the error message is intended as part of the test checking for a non-existent control

Copy link
Contributor

@vobu vobu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a minor hunch that there's a duplicate def in there (see respective comment) - otherwise good to go!

)
} else {
Logger.error("ERROR: navigating to another page")
}
})

// inspired by and after staring a long time hard at:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please check wether this is an (accidental) duplicate to line 62ff?

@vobu vobu merged commit fcb47cf into ui5-community:main Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants