Commit 06898bbf authored by Jérome Perrin's avatar Jérome Perrin

The hack to upload files no longer works with recent firefox.

Don' request netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead") if netscape.security.PrivilegeManager is undefined.
File upload tests will fail, and it seems the only way is to swith to WebDriver.
parent 4da6b8fd
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts37194719.51</string> </value>
<value> <string>ts51698417.06</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -72,8 +72,12 @@ Selenium.prototype.assertPortalStatusMessage = function(text) {\n
};\n
\n
Selenium.prototype.doType = function(locator, newText) {\n
if (typeof(netscape) != "undefined") {\n
// on firefox, we enable privilege to upload file in javascript.\n
if (typeof(netscape) != "undefined" && typeof(netscape.security.PrivilegeManager) != "undefined" ) {\n
// On old firefox versions, we enable privilege to upload file in javascript.\n
// The user needs to have signed.applets.codebase_principal_support set to true in about:config\n
// This is done in prefs.js generated by product/ERP5Type/tests/runFunctionalTest.py\n
// This approach no longer work in newer firefox versions https://developer.mozilla.org/en-US/docs/Bypassing_Security_Restrictions_and_Signing_Code\n
// Without this, tests dealing with file upload will fail\n
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");\n
}\n
var element = this.page().findElement(locator);\n
......@@ -113,7 +117,7 @@ Selenium.prototype.assertElementPositionRangeTop = function(locator, range){\n
</item>
<item>
<key> <string>size</string> </key>
<value> <int>2949</int> </value>
<value> <int>3435</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
57
\ No newline at end of file
58
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment