Skip to content

Commit aa53154

Browse files
committed
[py] fix firefox addon tests
1 parent 195671c commit aa53154

4 files changed

Lines changed: 18 additions & 14 deletions

File tree

py/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ py_test_suite(
339339
tags = [
340340
"no-sandbox",
341341
],
342+
data = [
343+
"//third_party/firebug:favourite_colour-1.1-an+fx.xpi",
344+
],
342345
deps = [
343346
":init-tree",
344347
":selenium",
@@ -359,6 +362,7 @@ py_test_suite(
359362
],
360363
data = [
361364
"//java/src/org/openqa/selenium/grid:selenium_server_deploy.jar",
365+
"//third_party/firebug:favourite_colour-1.1-an+fx.xpi",
362366
],
363367
tags = [
364368
"no-sandbox",

py/test/selenium/webdriver/firefox/conftest.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,7 @@
2121

2222

2323
@pytest.fixture
24-
def capabilities():
25-
capabilities = {'marionette': False}
26-
return capabilities
27-
28-
29-
@pytest.fixture
30-
def driver(capabilities):
31-
driver = Firefox(capabilities=capabilities)
24+
def driver():
25+
driver = Firefox()
3226
yield driver
3327
driver.quit()

py/test/selenium/webdriver/firefox/ff_installs_addons_tests.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,22 @@
1616
# under the License.
1717

1818
import os
19-
from pathlib import Path
2019

2120
from selenium.common.exceptions import WebDriverException
2221

2322

24-
def test_install_addon(driver, pages):
25-
extension = os.path.join(Path(__file__).absolute().parents[5], 'third_party/firebug/favourite_colour-1.1-an+fx.xpi')
23+
def test_install_addon(driver):
24+
extension = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
25+
'../../../../third_party/firebug/favourite_colour-1.1-an+fx.xpi')
26+
2627
id = driver.install_addon(extension)
2728
assert id == '[email protected]'
2829

2930

30-
def test_uninstall_addon(driver, pages):
31-
extension = os.path.join(Path(__file__).absolute().parents[5], 'third_party/firebug/favourite_colour-1.1-an+fx.xpi')
31+
def test_uninstall_addon(driver):
32+
extension = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
33+
'../../../../third_party/firebug/favourite_colour-1.1-an+fx.xpi')
34+
3235
id = driver.install_addon(extension)
3336
try:
3437
driver.uninstall_addon(id)

third_party/firebug/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ exports_files(
66
"firebug-1.5.0-fx.xpi",
77
"mooltipass-1.1.87.xpi",
88
],
9-
visibility = ["//java/test/org/openqa/selenium/firefox:__pkg__"],
9+
visibility = [
10+
"//java/test/org/openqa/selenium/firefox:__pkg__",
11+
"//py:__pkg__"
12+
],
1013
)

0 commit comments

Comments
 (0)