Skip to content

Commit

Permalink
Add a test for adding the WebExtension.
Browse files Browse the repository at this point in the history
  • Loading branch information
sangaline authored and davehunt committed Oct 4, 2018
1 parent cdb2f75 commit 0db4c0c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions py/test/selenium/webdriver/firefox/ff_profile_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,20 @@ def test_autodetect_proxy_is_set_in_profile():

profile.set_proxy(proxy)
assert profile.default_preferences["network.proxy.type"] == ProxyType.AUTODETECT['ff_value']


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

profile = FirefoxProfile()
profile.add_extension(full_extension_filename)

driver = Firefox(fcapabilities=capabilities, firefox_profile=profile)
driver.get(webserver.where_is('simpleTest.html'))
driver.find_element_by_id('webextensions-selenium-example')

0 comments on commit 0db4c0c

Please sign in to comment.