-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add multiremote support (#272)
* feat: add command asControl for multi remote to each browser * feat: add support for multiremotedriver to call instances implicit * feat: add support for ui5ready, navTo, make all tests running again * feat: add missing browserinstance ref in browser js * feat: move multiremote config to new location * feat: add headless support for multiremote * fix: remove DRY, due to prior merge conflict * feat: #281 add missing browser instance references to cliend side js * feat: set browser as default parameter for ui5 inject * feat: change check for ui5 version on multiremote * fix: linting issues * chore: bump chromedriver to 103.0.0 * chore: set default screen size for testing cap to 1920x1280
- Loading branch information
1 parent
84e3624
commit fcb47cf
Showing
25 changed files
with
532 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
examples/ui5-js-app/e2e-test-config/wdio-multiremote.conf.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const { baseConfig } = require("./wdio.base.conf") | ||
const { join } = require("path") | ||
const merge = require("deepmerge") | ||
|
||
// avoid multiple chrome sessions | ||
delete baseConfig.capabilities | ||
|
||
const _config = { | ||
wdi5: { | ||
url: "#", | ||
screenshotPath: join("report", "screenshots") | ||
}, | ||
maxInstances: 1, | ||
capabilities: { | ||
one: { | ||
capabilities: { | ||
browserName: "chrome", | ||
acceptInsecureCerts: true, | ||
"goog:chromeOptions": { | ||
args: | ||
process.argv.indexOf("--headless") > -1 | ||
? ["window-size=1440,800", "--headless"] | ||
: process.argv.indexOf("--debug") > -1 | ||
? ["window-size=1920,1280", "--auto-open-devtools-for-tabs"] | ||
: ["window-size=1440,800"] | ||
} | ||
} | ||
}, | ||
two: { | ||
capabilities: { | ||
browserName: "chrome", | ||
acceptInsecureCerts: true, | ||
"goog:chromeOptions": { | ||
args: | ||
process.argv.indexOf("--headless") > -1 | ||
? ["window-size=1440,800", "--headless"] | ||
: process.argv.indexOf("--debug") > -1 | ||
? ["window-size=1920,1280", "--auto-open-devtools-for-tabs"] | ||
: ["window-size=1440,800"] | ||
} | ||
} | ||
} | ||
}, | ||
specs: ["webapp/test/e2e/multiremote.test.js"] | ||
} | ||
|
||
exports.config = merge(baseConfig, _config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const Main = require("./pageObjects/Main") | ||
describe("Multi Remote", () => { | ||
before(async () => { | ||
await Main.open() | ||
}) | ||
|
||
it("allows handling ui5 controls in different browsers", async () => { | ||
const button = await browser.two.asControl({ | ||
selector: { | ||
id: "openDialogButton", | ||
viewName: "test.Sample.view.Main" | ||
} | ||
}) | ||
const metadata = button.getControlInfo() | ||
|
||
expect(metadata.id).toEqual("container-Sample---Main--openDialogButton") | ||
expect(metadata.className).toEqual("sap.m.Button") | ||
expect(metadata.key).toEqual("openDialogButtontestSample.view.Main") | ||
|
||
await button.press() | ||
|
||
const dialogSelector = { | ||
selector: { | ||
id: "Dialog-title", | ||
searchOpenDialogs: true | ||
} | ||
} | ||
|
||
const text = await browser.two.asControl(dialogSelector).getText() | ||
expect(text).toEqual("Here we are!") | ||
expect(await browser.one.asControl(dialogSelector).getInitStatus()).toBeFalsy() | ||
}) | ||
it("should return an array of results of both browsers if called directly by browser", async () => { | ||
const button = await browser.asControl({ | ||
selector: { | ||
id: "openDialogButton", | ||
viewName: "test.Sample.view.Main" | ||
} | ||
}) | ||
const buttonOne = button[0] | ||
const buttonTwo = button[1] | ||
expect(buttonOne._browserInstance.sessionId).not.toEqual(buttonTwo._browserInstance.sessionId) | ||
|
||
expect(await buttonOne.getText()).toEqual("open Dialog") | ||
expect(await buttonTwo.getText()).toEqual("open Dialog") | ||
}) | ||
}) |
Oops, something went wrong.