<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 20 July 2016 at 16:55, Michael Wood <span dir="ltr"><<a href="mailto:michael.g.wood@intel.com" target="_blank">michael.g.wood@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 17/06/16 18:52, Michael Wood wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Elliot Smith <<a href="mailto:elliot.smith@intel.com" target="_blank">elliot.smith@intel.com</a>><br>
<br>
For the latest Firefox versions, WebDriver requires a download of a<br>
separate binary and an additional capability to be defined on it.<br>
<br>
Modify our tests so that when "marionette" is set as the browser,<br>
this capability is defined on the Firefox driver. Also add a note to the<br>
README about the additional installation steps required.<br></blockquote></div></div></blockquote><div><br></div><div>Note that I resubmitted a rebased version of these patches, as changes on toaster-next mean that this version won't apply.</div><div><br></div><div>Elliot</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Signed-off-by: Elliot Smith <<a href="mailto:elliot.smith@intel.com" target="_blank">elliot.smith@intel.com</a>><br>
Signed-off-by: Michael Wood <<a href="mailto:michael.g.wood@intel.com" target="_blank">michael.g.wood@intel.com</a>><br>
---<br>
lib/toaster/tests/browser/README | 19 +++++++++++++++++--<br>
lib/toaster/tests/browser/selenium_helpers.py | 5 +++++<br>
2 files changed, 22 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/lib/toaster/tests/browser/README b/lib/toaster/tests/browser/README<br>
index f57154e..969f06c 100644<br>
--- a/lib/toaster/tests/browser/README<br>
+++ b/lib/toaster/tests/browser/README<br>
@@ -24,15 +24,30 @@ To run tests against PhantomJS (headless):<br>
* On *nix systems, put phantomjs on PATH<br>
* Not tested on Windows<br>
-Firefox should work without requiring additional software to be installed.<br>
+To run tests against Firefox, you may need to install the Marionette driver,<br>
+depending on how new your version of Firefox is. One clue that you need to do<br>
+this is if you see an exception like:<br>
-The test case will instantiate a Selenium driver set by the<br>
+ selenium.common.exceptions.WebDriverException: Message: The browser<br>
+ appears to have exited before we could connect. If you specified<br>
+ a log_file in the FirefoxBinary constructor, check it for details.<br>
+<br>
+See <a href="https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver" rel="noreferrer" target="_blank">https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver</a><br>
+for installation instructions. Ensure that the Marionette executable (renamed<br>
+as wires on Linux or wires.exe on Windows) is on your PATH; and use "marionette"<br>
+as the browser string passed via TOASTER_TESTS_BROWSER (see below).<br>
+<br>
+(Note: The Toaster tests have been checked against Firefox 47 with the<br>
+Marionette driver.)<br>
+<br>
+The test cases will instantiate a Selenium driver set by the<br>
TOASTER_TESTS_BROWSER environment variable, or Chrome if this is not specified.<br>
Available drivers:<br>
* chrome (default)<br>
* firefox<br>
+* marionette (for newer Firefoxes)<br>
* ie<br>
* phantomjs<br>
diff --git a/lib/toaster/tests/browser/selenium_helpers.py b/lib/toaster/tests/browser/selenium_helpers.py<br>
index 54db2e8..000937f 100644<br>
--- a/lib/toaster/tests/browser/selenium_helpers.py<br>
+++ b/lib/toaster/tests/browser/selenium_helpers.py<br>
@@ -34,6 +34,7 @@ import time<br>
from django.contrib.staticfiles.testing import StaticLiveServerTestCase<br>
from selenium import webdriver<br>
from selenium.webdriver.support.ui import WebDriverWait<br>
+from selenium.webdriver.common.desired_capabilities import DesiredCapabilities<br>
from selenium.common.exceptions import NoSuchElementException, \<br>
StaleElementReferenceException, TimeoutException<br>
@@ -49,6 +50,10 @@ def create_selenium_driver(browser='chrome'):<br>
)<br>
elif browser == 'firefox':<br>
return webdriver.Firefox()<br>
+ elif browser == 'marionette':<br>
+ capabilities = DesiredCapabilities.FIREFOX<br>
+ capabilities['marionette'] = True<br>
+ return webdriver.Firefox(capabilities=capabilities)<br>
elif browser == 'ie':<br>
return webdriver.Ie()<br>
elif browser == 'phantomjs':<br>
</blockquote>
<br></div></div>
Ping on these two patches.<br>
<br>
Thanks,<br>
<br>
Michael<div class="HOEnZb"><div class="h5"><br>
---------------------------------------------------------------------<br>
Intel Corporation (UK) Limited<br>
Registered No. 1134945 (England)<br>
Registered Office: Pipers Way, Swindon SN3 1RJ<br>
VAT No: 860 2173 47<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Elliot Smith<br>Software Engineer<br>Intel Open Source Technology Centre</div></div></div>
</div></div>