Skip to content

Commit

Permalink
[py] fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed May 14, 2023
1 parent ed313de commit 2a6b075
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions py/test/selenium/webdriver/firefox/ff_installs_addons_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/")

Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 2a6b075

Please sign in to comment.