diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 16:55:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 16:55:34 +0000 |
commit | 75417f5e3d32645859d94cec82255dc130ec4a2e (patch) | |
tree | 5fd46925c6b4a881c9208772ed8e5cc0588bc164 /tests/selenium/breakage_test.py | |
parent | Initial commit. (diff) | |
download | privacybadger-75417f5e3d32645859d94cec82255dc130ec4a2e.tar.xz privacybadger-75417f5e3d32645859d94cec82255dc130ec4a2e.zip |
Adding upstream version 2020.10.7.upstream/2020.10.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/selenium/breakage_test.py')
-rw-r--r-- | tests/selenium/breakage_test.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/selenium/breakage_test.py b/tests/selenium/breakage_test.py new file mode 100644 index 0000000..2970610 --- /dev/null +++ b/tests/selenium/breakage_test.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*- + +import unittest +import pbtest +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC + + +class BreakageTest(pbtest.PBSeleniumTest): + """Make sure the extension doesn't break common sites and use cases. + e.g. we should be able to load a website, search on Google. + TODO: Add tests to simulate most common web use cases: + e.g. play Youtube videos, login to popular services, tweet some text, + add Reddit comments etc.""" + + def test_should_load_eff_org(self): + self.load_url("https://www.eff.org") + WebDriverWait(self.driver, 10).until( + EC.title_contains("Electronic Frontier Foundation")) + + def test_should_search_google(self): + self.load_url("https://www.google.com/") + qry_el = self.driver.find_element_by_name("q") + qry_el.send_keys("EFF") # search term + qry_el.submit() + WebDriverWait(self.driver, 10).until(EC.title_contains("EFF")) + +if __name__ == "__main__": + unittest.main() |