forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating Firefox AddOns for Testing (SeleniumHQ#13999)
* Updating Firefox AddOns for Testing * Running format script. --------- Co-authored-by: Titus Fortner <[email protected]>
- Loading branch information
1 parent
a884490
commit bc6b650
Showing
15 changed files
with
78 additions
and
45 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
12 changes: 12 additions & 0 deletions
12
common/extensions/webextensions-selenium-example-signed/META-INF/cose.manifest
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,12 @@ | ||
Manifest-Version: 1.0 | ||
|
||
Name: inject.js | ||
Digest-Algorithms: SHA1 SHA256 | ||
SHA1-Digest: b2nrco3zOUBDJuyARPlsNEU8O9A= | ||
SHA256-Digest: lU8GPe0dnC/AH4PaP0/akwta9vNay0n7fsgkBOieLsg= | ||
|
||
Name: manifest.json | ||
Digest-Algorithms: SHA1 SHA256 | ||
SHA1-Digest: EjY6pS7xUwQxN7ijQqys3bdEHHc= | ||
SHA256-Digest: eLH2wKnhmjOvDJk/13OJMeh+X4sdlSpbOIfyhp44Zaw= | ||
|
Binary file added
BIN
+3.05 KB
common/extensions/webextensions-selenium-example-signed/META-INF/cose.sig
Binary file not shown.
20 changes: 15 additions & 5 deletions
20
common/extensions/webextensions-selenium-example-signed/META-INF/manifest.mf
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 |
---|---|---|
@@ -1,12 +1,22 @@ | ||
Manifest-Version: 1.0 | ||
|
||
Name: inject.js | ||
Digest-Algorithms: MD5 SHA1 | ||
MD5-Digest: smWyx4xRjcjf16hcPSMqDQ== | ||
Digest-Algorithms: SHA1 SHA256 | ||
SHA1-Digest: b2nrco3zOUBDJuyARPlsNEU8O9A= | ||
SHA256-Digest: lU8GPe0dnC/AH4PaP0/akwta9vNay0n7fsgkBOieLsg= | ||
|
||
Name: manifest.json | ||
Digest-Algorithms: MD5 SHA1 | ||
MD5-Digest: Lg0KzlWjz7XiEJL7d7ZaPA== | ||
SHA1-Digest: /3TAazkDdAqLGI4xVOib3AN20/0= | ||
Digest-Algorithms: SHA1 SHA256 | ||
SHA1-Digest: EjY6pS7xUwQxN7ijQqys3bdEHHc= | ||
SHA256-Digest: eLH2wKnhmjOvDJk/13OJMeh+X4sdlSpbOIfyhp44Zaw= | ||
|
||
Name: META-INF/cose.manifest | ||
Digest-Algorithms: SHA1 SHA256 | ||
SHA1-Digest: BltD3hfKib5zAF8/AQ2KUfFQE8E= | ||
SHA256-Digest: Jk/XoCcZp3zF0IZZ4clToX4K7o75eLH3+GbPfVrEC2w= | ||
|
||
Name: META-INF/cose.sig | ||
Digest-Algorithms: SHA1 SHA256 | ||
SHA1-Digest: ekekKataezcCjFQ6h2NqnkU9XIY= | ||
SHA256-Digest: OFybAfaBj2GL8JcBp64tchoyn/9zoBWGyTqTiIoAbdQ= | ||
|
Binary file modified
BIN
+170 Bytes
(100%)
common/extensions/webextensions-selenium-example-signed/META-INF/mozilla.rsa
Binary file not shown.
4 changes: 2 additions & 2 deletions
4
common/extensions/webextensions-selenium-example-signed/META-INF/mozilla.sf
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Signature-Version: 1.0 | ||
MD5-Digest-Manifest: IiKA2aoQtb4HEsrI/xxG+w== | ||
SHA1-Digest-Manifest: XSiAa+3KAgzt9ns8AcBj/raqgn0= | ||
SHA1-Digest-Manifest: jLWIpkk5tC4qYx/SVv8FJjbuMf0= | ||
SHA256-Digest-Manifest: 0VRdWHWSGB1rGMGPEA5BsjCKjeHE6P5ElaLQd3KndEs= | ||
|
25 changes: 15 additions & 10 deletions
25
common/extensions/webextensions-selenium-example-signed/manifest.json
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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
{ | ||
"manifest_version": 2, | ||
"manifest_version": 3, | ||
"name": "webextensions-selenium-example", | ||
"description": "Inject a div with id webextensions-selenium-example to verify that WebExtensions work in Firefox/Selenium" , | ||
"description": "Inject a div with id webextensions-selenium-example to verify that WebExtensions work in Firefox/Selenium", | ||
"version": "0.1", | ||
"content_scripts": [ | ||
{ | ||
"matches": ["https://*/*","http://*/*"], | ||
"js": ["inject.js"] | ||
"matches": [ | ||
"https://*/*", | ||
"http://*/*" | ||
], | ||
"js": [ | ||
"inject.js" | ||
] | ||
} | ||
], | ||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
} | ||
} | ||
} | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "webextensions-selenium-example-v3@example.com" | ||
} | ||
} | ||
} |
Binary file modified
BIN
-280 Bytes
(73%)
common/extensions/webextensions-selenium-example-unsigned.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 14 additions & 9 deletions
23
common/extensions/webextensions-selenium-example/manifest.json
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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
{ | ||
"manifest_version": 2, | ||
"manifest_version": 3, | ||
"name": "webextensions-selenium-example", | ||
"description": "Inject a div with id webextensions-selenium-example to verify that WebExtensions work in Firefox/Selenium" , | ||
"description": "Inject a div with id webextensions-selenium-example to verify that WebExtensions work in Firefox/Selenium", | ||
"version": "0.1", | ||
"content_scripts": [ | ||
{ | ||
"matches": ["https://*/*","http://*/*"], | ||
"js": ["inject.js"] | ||
"matches": [ | ||
"https://*/*", | ||
"http://*/*" | ||
], | ||
"js": [ | ||
"inject.js" | ||
] | ||
} | ||
], | ||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
} | ||
} | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "webextensions-selenium-example-v3@example.com" | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -52,7 +52,7 @@ void canAddRemoveXpiExtensions() { | |
Path extension = InProject.locate(EXT_XPI); | ||
|
||
String id = ((HasExtensions) driver).installExtension(extension); | ||
assertThat(id).isEqualTo("[email protected]"); | ||
assertThat(id).isEqualTo("webextensions-selenium-example-v3@example.com"); | ||
|
||
driver.get(pages.blankPage); | ||
WebElement injected = driver.findElement(By.id("webextensions-selenium-example")); | ||
|
@@ -69,7 +69,7 @@ void canAddRemoveZipUnSignedExtensions() { | |
Path extension = InProject.locate(EXT_UNSIGNED_ZIP); | ||
|
||
String id = ((HasExtensions) driver).installExtension(extension, true); | ||
assertThat(id).isEqualTo("[email protected]"); | ||
assertThat(id).isEqualTo("webextensions-selenium-example-v3@example.com"); | ||
|
||
driver.get(pages.blankPage); | ||
WebElement injected = driver.findElement(By.id("webextensions-selenium-example")); | ||
|
@@ -86,7 +86,7 @@ void canAddRemoveZipSignedExtensions() { | |
Path extension = InProject.locate(EXT_SIGNED_ZIP); | ||
|
||
String id = ((HasExtensions) driver).installExtension(extension); | ||
assertThat(id).isEqualTo("[email protected]"); | ||
assertThat(id).isEqualTo("webextensions-selenium-example-v3@example.com"); | ||
|
||
driver.get(pages.blankPage); | ||
WebElement injected = driver.findElement(By.id("webextensions-selenium-example")); | ||
|
@@ -103,7 +103,7 @@ void canAddRemoveUnsignedExtensionsDirectory() { | |
Path extension = InProject.locate(EXT_UNSIGNED_DIR); | ||
|
||
String id = ((HasExtensions) driver).installExtension(extension, true); | ||
assertThat(id).isEqualTo("[email protected]"); | ||
assertThat(id).isEqualTo("webextensions-selenium-example-v3@example.com"); | ||
|
||
driver.get(pages.blankPage); | ||
WebElement injected = driver.findElement(By.id("webextensions-selenium-example")); | ||
|
@@ -120,7 +120,7 @@ void canAddRemoveSignedExtensionsDirectory() { | |
Path extension = InProject.locate(EXT_SIGNED_DIR); | ||
|
||
String id = ((HasExtensions) driver).installExtension(extension); | ||
assertThat(id).isEqualTo("[email protected]"); | ||
assertThat(id).isEqualTo("webextensions-selenium-example-v3@example.com"); | ||
|
||
driver.get(pages.blankPage); | ||
WebElement injected = driver.findElement(By.id("webextensions-selenium-example")); | ||
|
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 |
---|---|---|
|
@@ -40,7 +40,7 @@ class RemoteFirefoxDriverTest extends JupiterTestBase { | |
public void shouldAllowRemoteWebDriverBuilderToUseHasExtensions() { | ||
Path extension = InProject.locate("common/extensions/webextensions-selenium-example.xpi"); | ||
String id = ((HasExtensions) driver).installExtension(extension); | ||
assertThat(id).isEqualTo("[email protected]"); | ||
assertThat(id).isEqualTo("webextensions-selenium-example-v3@example.com"); | ||
|
||
try { | ||
((HasExtensions) driver).uninstallExtension(id); | ||
|
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 |
---|---|---|
|
@@ -28,7 +28,7 @@ def test_install_uninstall_signed_addon_xpi(driver, pages): | |
extension = os.path.join(extensions, "webextensions-selenium-example.xpi") | ||
|
||
id = driver.install_addon(extension) | ||
assert id == "[email protected]" | ||
assert id == "webextensions-selenium-example-v3@example.com" | ||
|
||
pages.load("blank.html") | ||
injected = WebDriverWait(driver, timeout=2).until( | ||
|
@@ -45,7 +45,7 @@ def test_install_uninstall_signed_addon_zip(driver, pages): | |
extension = os.path.join(extensions, "webextensions-selenium-example.zip") | ||
|
||
id = driver.install_addon(extension) | ||
assert id == "[email protected]" | ||
assert id == "webextensions-selenium-example-v3@example.com" | ||
|
||
pages.load("blank.html") | ||
injected = WebDriverWait(driver, timeout=2).until( | ||
|
@@ -62,7 +62,7 @@ def test_install_uninstall_unsigned_addon_zip(driver, pages): | |
extension = os.path.join(extensions, "webextensions-selenium-example-unsigned.zip") | ||
|
||
id = driver.install_addon(extension, temporary=True) | ||
assert id == "[email protected]" | ||
assert id == "webextensions-selenium-example-v3@example.com" | ||
|
||
pages.load("blank.html") | ||
injected = WebDriverWait(driver, timeout=2).until( | ||
|
@@ -83,7 +83,7 @@ def test_install_uninstall_signed_addon_dir(driver, pages): | |
zip_ref.extractall(target) | ||
|
||
id = driver.install_addon(target) | ||
assert id == "[email protected]" | ||
assert id == "webextensions-selenium-example-v3@example.com" | ||
|
||
pages.load("blank.html") | ||
injected = WebDriverWait(driver, timeout=2).until( | ||
|
@@ -103,7 +103,7 @@ def test_install_uninstall_unsigned_addon_dir(driver, pages): | |
zip_ref.extractall(target) | ||
|
||
id = driver.install_addon(target, temporary=True) | ||
assert id == "[email protected]" | ||
assert id == "webextensions-selenium-example-v3@example.com" | ||
|
||
pages.load("blank.html") | ||
injected = WebDriverWait(driver, timeout=2).until( | ||
|
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 |
---|---|---|
|
@@ -66,7 +66,7 @@ module Firefox | |
ext = File.expand_path("#{extensions}/webextensions-selenium-example.xpi", __dir__) | ||
id = driver.install_addon(ext) | ||
|
||
expect(id).to eq '[email protected]' | ||
expect(id).to eq 'webextensions-selenium-example-v3@example.com' | ||
driver.navigate.to url_for('blank.html') | ||
|
||
injected = driver.find_element(id: 'webextensions-selenium-example') | ||
|
@@ -81,7 +81,7 @@ module Firefox | |
ext = File.expand_path("#{extensions}/webextensions-selenium-example.zip", __dir__) | ||
id = driver.install_addon(ext) | ||
|
||
expect(id).to eq '[email protected]' | ||
expect(id).to eq 'webextensions-selenium-example-v3@example.com' | ||
driver.navigate.to url_for('blank.html') | ||
|
||
injected = driver.find_element(id: 'webextensions-selenium-example') | ||
|
@@ -96,7 +96,7 @@ module Firefox | |
ext = File.expand_path("#{extensions}/webextensions-selenium-example-unsigned.zip", __dir__) | ||
id = driver.install_addon(ext, true) | ||
|
||
expect(id).to eq '[email protected]' | ||
expect(id).to eq 'webextensions-selenium-example-v3@example.com' | ||
driver.navigate.to url_for('blank.html') | ||
|
||
injected = driver.find_element(id: 'webextensions-selenium-example') | ||
|
@@ -107,12 +107,14 @@ module Firefox | |
expect(driver.find_elements(id: 'webextensions-selenium-example')).to be_empty | ||
end | ||
|
||
it 'install and uninstall signed directory', except: {platform: :windows, | ||
reason: 'signature must be different for windows'} do | ||
it 'install and uninstall signed directory', except: {browser: :firefox, | ||
platform: :windows, | ||
reason: 'signature must be different for windows, | ||
skipping everywhere until Firefox 127 is released'} do | ||
ext = File.expand_path("#{extensions}/webextensions-selenium-example-signed/", __dir__) | ||
id = driver.install_addon(ext) | ||
|
||
expect(id).to eq '[email protected]' | ||
expect(id).to eq 'webextensions-selenium-example-v3@example.com' | ||
driver.navigate.to url_for('blank.html') | ||
|
||
injected = driver.find_element(id: 'webextensions-selenium-example') | ||
|
@@ -127,7 +129,7 @@ module Firefox | |
ext = File.expand_path("#{extensions}/webextensions-selenium-example/", __dir__) | ||
id = driver.install_addon(ext, true) | ||
|
||
expect(id).to eq '[email protected]' | ||
expect(id).to eq 'webextensions-selenium-example-v3@example.com' | ||
driver.navigate.to url_for('blank.html') | ||
|
||
injected = driver.find_element(id: 'webextensions-selenium-example') | ||
|