Skip to content

Commit 3404c20

Browse files
committed
[test]: fix RBE tests
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 1b64798 commit 3404c20

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed
1.18 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
((function(document) {
2+
var div = document.createElement('div');
3+
div.id = 'webextensions-selenium-example'
4+
div.textContent = "Content injected by webextensions-selenium-example";
5+
document.body.appendChild(div);
6+
})(document))
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"manifest_version": 3,
3+
"name": "webextensions-selenium-example",
4+
"description": "Inject a div with id webextensions-selenium-example to verify that WebExtensions work in Firefox/Selenium",
5+
"version": "0.1",
6+
"content_scripts": [
7+
{
8+
"matches": [
9+
"https://*/*",
10+
"http://*/*"
11+
],
12+
"js": [
13+
"inject.js"
14+
]
15+
}
16+
]
17+
}

java/test/org/openqa/selenium/chrome/ChromeOptionsFunctionalTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636

3737
class ChromeOptionsFunctionalTest extends JupiterTestBase {
3838

39-
private static final String EXT_PATH = "common/extensions/webextensions-selenium-example.crx";
39+
private static final String EXT_PATH = "common/extensions/webextensions-selenium-example-chromium.crx";
40+
private static final String EXT_DIR_PATH = "common/extensions/webextensions-selenium-example-chromium";
4041

4142
@AfterAll
4243
public static void resetBrowser() {
@@ -109,6 +110,7 @@ public void canAddExtensionFromStringEncodedInBase64() throws IOException {
109110

110111
private ChromeOptions createChromeOptionsForExtensions() {
111112
ChromeOptions options = (ChromeOptions) Browser.CHROME.getCapabilities();
113+
options.addArguments("load-extension=" + InProject.locate(EXT_DIR_PATH).toAbsolutePath());
112114
return options.setExperimentalOption(
113115
"prefs", ImmutableMap.of("extensions.ui.developer_mode", true));
114116
}

0 commit comments

Comments
 (0)