Skip to content

Commit

Permalink
[py] Add Firefox specific tests to the firefox test target
Browse files Browse the repository at this point in the history
  • Loading branch information
AutomatedTester committed Nov 13, 2020
1 parent 186b587 commit 2d9832c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
1 change: 1 addition & 0 deletions py/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ py_test_suite(
srcs = glob([
"test/selenium/webdriver/common/**/*.py",
"test/selenium/webdriver/marionette/**/*.py",
"test/selenium/webdriver/firefox/**/*.py",
"test/selenium/webdriver/support/**/*.py",
]),
args = [
Expand Down
26 changes: 0 additions & 26 deletions py/test/selenium/webdriver/firefox/ff_profile_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,6 @@ def test_that_boolean_prefs_are_written_in_the_correct_format():
assert profile.default_preferences["sample.bool.preference"] is True


def test_that_we_delete_the_profile(capabilities):
driver = Firefox(capabilities=capabilities)
path = driver.firefox_profile.path
driver.quit()
assert not os.path.exists(path)


def test_profiles_do_not_share_preferences():
profile1 = FirefoxProfile()
profile1.accept_untrusted_certs = False
Expand All @@ -119,25 +112,6 @@ def test_profiles_do_not_share_preferences():
assert profile2.default_preferences["webdriver_accept_untrusted_certs"] is True


def test_add_extension_web_extension_with_id(capabilities, webserver):
current_directory = os.path.dirname(os.path.realpath(__file__))
root_directory = os.path.join(current_directory, '..', '..', '..', '..', '..')
# TODO: This file should probably live in a common directory.
extension_path = os.path.join(root_directory, 'javascript', 'node', 'selenium-webdriver',
'lib', 'test', 'data', 'firefox', 'webextension.xpi')

profile = FirefoxProfile()
profile.add_extension(extension_path)

driver = Firefox(capabilities=capabilities, firefox_profile=profile)
profile_path = driver.firefox_profile.path
extension_path_in_profile = os.path.join(profile_path, 'extensions', 'webextensions-selenium-example@example.com')
assert os.path.exists(extension_path_in_profile)
driver.get(webserver.where_is('simpleTest.html'))
driver.find_element(By.ID, 'webextensions-selenium-example')
driver.quit()


def test_add_extension_web_extension_without_id(capabilities, webserver):
current_directory = os.path.dirname(os.path.realpath(__file__))
root_directory = os.path.join(current_directory, '..', '..', '..', '..', '..')
Expand Down

0 comments on commit 2d9832c

Please sign in to comment.