diff options
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() |