import os
import unittest

from selenium import webdriver

DIR = os.path.dirname(__file__)

os.environ['PATH'] = os.environ['PATH'] + ":" + DIR


# local testing, remove before CI
PROXY='127.0.0.1:8080'
webdriver.DesiredCapabilities.FIREFOX['proxy'] = {
    "httpProxy":PROXY,
    "ftpProxy":PROXY,
    "sslProxy":PROXY,
    "noProxy":[],
    "proxyType":"MANUAL"
}


class DuckDuckGoTestCase(unittest.TestCase):

    def setUp(self):
        profile = webdriver.FirefoxProfile()
        profile.add_extension(extension=os.path.join(DIR, "..", "addon"))
        self.browser = webdriver.Firefox(firefox_profile=profile)

    def testDuckLoads(self):
        self.browser.get("https://duckduckgo.com")
        self.assertIn("duckduckgo", self.browser.title.lower())

    def testDuckSafe(self):
        self.browser.get("https://duckduckgo.com")
        (self.browser
         .find_element_by_id("search_form_input_homepage")
         .send_keys("porn" + webdriver.common.keys.Keys.RETURN))
        # click to disable temporarily, then wait, then see if available
        self.browser.implicitly_wait(10)
        self.browser.find_element_by_class_name("js-safe-search-temp").click()
        # assert that browser.find_element_by_class_name("js-safe-search-temp") still exists, else throws exception
        self.browser.find_element_by_class_name("js-safe-search-temp")

    def tearDown(self):
        self.browser.close()


if __name__ == "__main__":
    unittest.main()

@@ -163,16 +163,30 @@
  remove 
+/ comment out 
 before C
@@ -214,54 +214,12 @@
 80'%0A
-webdriver.DesiredCapabilities.FIREFOX%5B'proxy'%5D
+POBJ
  = %7B
@@ -335,262 +335,140 @@
 %22%0A%7D%0A
-%0A%0Aclass DuckDuckGoTestCase(unittest.TestCase):%0A%0A    def setUp(self):%0A        profile = webdriver.FirefoxProfile()%0A        profile.add_extension(extension=os.path.join(DIR, %22..%22, %22addon%22))%0A        self.browser = webdriver.Firefox(firefox_profile=profile)%0A
+webdriver.DesiredCapabilities.CHROME%5B'proxy'%5D = POBJ%0Awebdriver.DesiredCapabilities.FIREFOX%5B'proxy'%5D = POBJ%0A%0Aclass DuckMixin(object):
 %0A   
@@ -1219,60 +1219,674 @@
 %22)%0A%0A
-    def tearDown(self):%0A        self.browser.close()
+%0Aclass DuckDuckGoTestCaseFirefox(unittest.TestCase, DuckMixin):%0A    def setUp(self):%0A        profile = webdriver.FirefoxProfile()%0A        profile.add_extension(extension=os.path.join(DIR, %22..%22, %22addon%22))%0A        self.browser = webdriver.Firefox(firefox_profile=profile)%0A%0A    def tearDown(self):%0A        self.browser.close()%0A%0Aclass DuckDuckGoTestCaseChromium(unittest.TestCase, DuckMixin):%0A    def setUp(self):%0A        profile = webdriver.chrome.options.Options()%0A        profile.add_extension(extension=os.path.join(DIR, %22..%22, %22safe.zip%22))%0A        self.browser = webdriver.Chrome(chrome_options=profile)%0A%0A    def tearDown(self):%0A        self.browser.close()%0A        
 %0A%0A%0Ai

lacked Chromium ddg test