-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed313de
commit 2a6b075
Showing
1 changed file
with
16 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
import zipfile | ||
|
||
from selenium.webdriver.common.by import By | ||
from selenium.webdriver.support.wait import WebDriverWait | ||
|
||
extensions = os.path.abspath("../../../../../../test/extensions/") | ||
|
||
|
@@ -30,7 +31,9 @@ def test_install_uninstall_signed_addon_xpi(driver, pages): | |
assert id == "[email protected]" | ||
|
||
pages.load("blank.html") | ||
injected = driver.find_element(By.ID, "webextensions-selenium-example") | ||
injected = WebDriverWait(driver, timeout=2).until( | ||
lambda dr: dr.find_element(By.ID, "webextensions-selenium-example") | ||
) | ||
assert injected.text == "Content injected by webextensions-selenium-example" | ||
|
||
driver.uninstall_addon(id) | ||
|
@@ -45,7 +48,9 @@ def test_install_uninstall_signed_addon_zip(driver, pages): | |
assert id == "[email protected]" | ||
|
||
pages.load("blank.html") | ||
injected = driver.find_element(By.ID, "webextensions-selenium-example") | ||
injected = WebDriverWait(driver, timeout=2).until( | ||
lambda dr: dr.find_element(By.ID, "webextensions-selenium-example") | ||
) | ||
assert injected.text == "Content injected by webextensions-selenium-example" | ||
|
||
driver.uninstall_addon(id) | ||
|
@@ -60,7 +65,9 @@ def test_install_uninstall_unsigned_addon_zip(driver, pages): | |
assert id == "[email protected]" | ||
|
||
pages.load("blank.html") | ||
injected = driver.find_element(By.ID, "webextensions-selenium-example") | ||
injected = WebDriverWait(driver, timeout=2).until( | ||
lambda dr: dr.find_element(By.ID, "webextensions-selenium-example") | ||
) | ||
assert injected.text == "Content injected by webextensions-selenium-example" | ||
|
||
driver.uninstall_addon(id) | ||
|
@@ -79,7 +86,9 @@ def test_install_uninstall_signed_addon_dir(driver, pages): | |
assert id == "[email protected]" | ||
|
||
pages.load("blank.html") | ||
injected = driver.find_element(By.ID, "webextensions-selenium-example") | ||
injected = WebDriverWait(driver, timeout=2).until( | ||
lambda dr: dr.find_element(By.ID, "webextensions-selenium-example") | ||
) | ||
assert injected.text == "Content injected by webextensions-selenium-example" | ||
|
||
driver.uninstall_addon(id) | ||
|
@@ -97,7 +106,9 @@ def test_install_uninstall_unsigned_addon_dir(driver, pages): | |
assert id == "[email protected]" | ||
|
||
pages.load("blank.html") | ||
injected = driver.find_element(By.ID, "webextensions-selenium-example") | ||
injected = WebDriverWait(driver, timeout=2).until( | ||
lambda dr: dr.find_element(By.ID, "webextensions-selenium-example") | ||
) | ||
assert injected.text == "Content injected by webextensions-selenium-example" | ||
|
||
driver.uninstall_addon(id) | ||
|