Beispiel #1
0
 def testDeleteCookie(self):
     if self.driver.capabilities["browserName"] == "phantomjs" and self.driver.capabilities["version"].startswith(
         "2.1"
     ):
         pytest.xfail("phantomjs driver 2.1 broke adding cookies")
     self.driver.add_cookie(utils.convert_cookie_to_json(self.COOKIE_A))
     self.driver.delete_cookie("foo")
     self.assertFalse(self.driver.get_cookies())
Beispiel #2
0
 def testDeleteCookie(self):
     if self.driver.capabilities[
             'browserName'] == 'phantomjs' and self.driver.capabilities[
                 'version'].startswith('2.1'):
         pytest.xfail("phantomjs driver 2.1 broke adding cookies")
     self.driver.add_cookie(utils.convert_cookie_to_json(self.COOKIE_A))
     self.driver.delete_cookie("foo")
     self.assertFalse(self.driver.get_cookies())
Beispiel #3
0
 def testAnonymousProfileIsFresh(self):
     driver = webdriver.connect('firefox')
     driver.get("http://localhost:8000/simpleTest.html")
     timestamp = time.mktime(datetime.datetime.now().timetuple()) + 100
     cookie = {"name": "foo",
              "value": "bar",
               "expires": str(int(timestamp)) + "000",
              "domain": "localhost",
              "path": "/"}
     driver.add_cookie(utils.convert_cookie_to_json(cookie))
     self.assertEquals(cookie, driver.get_cookies()[0])
     driver.quit()
     driver = webdriver.connect('firefox')
     self.assertEquals([], driver.get_cookies())
     driver.quit()
 def testAnonymousProfileIsFresh(self):
     driver = webdriver.connect('firefox')
     driver.get("http://localhost:8000/simpleTest.html")
     timestamp = time.mktime(datetime.datetime.now().timetuple()) + 100
     cookie = {
         "name": "foo",
         "value": "bar",
         "expires": str(int(timestamp)) + "000",
         "domain": "localhost",
         "path": "/"
     }
     driver.add_cookie(utils.convert_cookie_to_json(cookie))
     self.assertEquals(cookie, driver.get_cookies()[0])
     driver.quit()
     driver = webdriver.connect('firefox')
     self.assertEquals([], driver.get_cookies())
     driver.quit()
Beispiel #5
0
 def testDeleteCookie(self):
     self.driver.add_cookie(utils.convert_cookie_to_json(self.COOKIE_A))
     self.driver.delete_cookie("foo")
     self.assertFalse(self.driver.get_cookies())
Beispiel #6
0
 def testDeleteAllCookie(self):
     if self.driver.capabilities['browserName'] == 'phantomjs' and self.driver.capabilities['version'].startswith('2.1'):
         pytest.xfail("phantomjs driver 2.1 broke adding cookies")
     self.driver.add_cookie(utils.convert_cookie_to_json(self.COOKIE_A))
     self.driver.delete_all_cookies()
     self.assertFalse(self.driver.get_cookies())