diff --git a/src/Selenium2Library/resources/firefoxprofile/prefs.js b/src/Selenium2Library/resources/firefoxprofile/prefs.js index 3cd67d9d2..44dfbd55b 100644 --- a/src/Selenium2Library/resources/firefoxprofile/prefs.js +++ b/src/Selenium2Library/resources/firefoxprofile/prefs.js @@ -18,7 +18,6 @@ user_pref("browser.migration.version", 1); user_pref("browser.places.importBookmarksHTML", false); user_pref("browser.places.smartBookmarksVersion", 2); user_pref("browser.preferences.advanced.selectedTabIndex", 3); -user_pref("browser.privatebrowsing.autostart", true); user_pref("browser.safebrowsing.enabled", false); user_pref("browser.safebrowsing.malware.enabled", false); user_pref("browser.search.update", false); diff --git a/test/acceptance/keywords/cookies.robot b/test/acceptance/keywords/cookies.robot new file mode 100644 index 000000000..c205528e5 --- /dev/null +++ b/test/acceptance/keywords/cookies.robot @@ -0,0 +1,43 @@ +*** Setting *** +Suite Setup Go To Page "cookies.html" +Suite Teardown Delete All Cookies +Test Setup Add Cookies +Resource ../resource.txt + +*** Test Cases *** +Get Cookies + ${cookies}= Get Cookies + Should Match Regexp ${cookies} ^(test=seleniumlibrary; another=value)|(another=value; test=seleniumlibrary)$ + +Get Cookie Value Set By Selenium + ${value}= Get Cookie Value another + Should Be Equal ${value} value + +Get Cookie Value Set By App + Click Link Add cookie + ${cookie}= Get Cookie Value spam + Should Be Equal ${cookie} eggs + +App Sees Cookie Set By Selenium + Add Cookie setbyselenium true + Click Link Check cookie + Element Text Should Be output Cookie found with value 'true'! + +Delete Cookie + Delete Cookie test + ${cookies} = Get Cookies + Should Be Equal ${cookies} another=value + +Non-existent Cookie + Run Keyword And Expect Error ValueError: Cookie with name missing not found. Get Cookie Value missing + +Get Cookies When There Are None + Delete All Cookies + ${cookies}= Get Cookies + Should Be Equal ${cookies} ${EMPTY} + +*** Keyword *** +Add Cookies + Delete All Cookies + Add Cookie test seleniumlibrary + Add Cookie another value diff --git a/test/acceptance/keywords/cookies.txt b/test/acceptance/keywords/cookies.txt deleted file mode 100644 index 9468b7f93..000000000 --- a/test/acceptance/keywords/cookies.txt +++ /dev/null @@ -1,28 +0,0 @@ -*Setting* -Resource ../resource.txt -Suite Setup Run Keywords Add Cookies Go To Page "index.html" -Suite Teardown Delete All Cookies - - -*Test Cases* - -Get Cookies - ${cookies} = Get Cookies - Should Be Equal ${cookies} test=seleniumlibrary; another=value - -Get Cookie Value - ${value} = Get Cookie Value another - Should Be Equal ${value} value - -Delete Cookie - Delete Cookie test - ${cookies} = Get Cookies - Should Be Equal ${cookies} another=value - -*Keyword* - -Add Cookies - Delete All Cookies - Add Cookie test seleniumlibrary - Add Cookie another value - diff --git a/test/resources/html/cookies.html b/test/resources/html/cookies.html new file mode 100644 index 000000000..b7637e29a --- /dev/null +++ b/test/resources/html/cookies.html @@ -0,0 +1,38 @@ + + + (root)/index.html + + + + Add cookie
+ Check cookie
+
Click Check cookie to check
+ + diff --git a/test/resources/testserver/testserver.py b/test/resources/testserver/testserver.py index f476946d9..3d33a24ca 100644 --- a/test/resources/testserver/testserver.py +++ b/test/resources/testserver/testserver.py @@ -65,8 +65,6 @@ def send_head(self): fs = os.fstat(f.fileno()) self.send_header("Content-Length", str(fs[6])) self.send_header("Last-Modified", self.date_time_string(fs.st_mtime)) - self.send_header("Set-Cookie", "test=seleniumlibrary;") - self.send_header("Set-Cookie", "another=value;") self.end_headers() return f