From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 4ACA3E00DF1; Fri, 17 Jun 2016 08:49:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [46.232.183.161 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from swiss-egress-1.mailchannels.ch (nov-007-i607.relay.mailchannels.net [46.232.183.161]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 0F22FE00C72 for ; Fri, 17 Jun 2016 08:49:25 -0700 (PDT) X-Sender-Id: wwwh|x-authuser|elliot@townx.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 834DE1BC5B3; Fri, 17 Jun 2016 15:49:21 +0000 (UTC) Received: from uscentral428.accountservergroup.com (ip-10-123-105-117.us-west-2.compute.internal [10.123.105.117]) by relay.mailchannels.net (Postfix) with ESMTPA id F003A1BC341; Fri, 17 Jun 2016 15:49:20 +0000 (UTC) X-Sender-Id: wwwh|x-authuser|elliot@townx.org Received: from uscentral428.accountservergroup.com (uscentral428.accountservergroup.com [10.132.194.146]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.6.14); Fri, 17 Jun 2016 15:49:21 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: wwwh|x-authuser|elliot@townx.org X-MailChannels-Auth-Id: wwwh X-MC-Loop-Signature: 1466178561256:1549046442 X-MC-Ingress-Time: 1466178561255 Received: from [176.251.19.34] (port=53858 helo=localhost.localdomain) by uscentral428.accountservergroup.com with esmtpa (Exim 4.87) (envelope-from ) id 1bDw3S-0006X7-NZ; Fri, 17 Jun 2016 11:51:35 -0400 From: Elliot Smith To: toaster@yoctoproject.org Date: Fri, 17 Jun 2016 16:49:12 +0100 Message-Id: <1466178552-3642-2-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466178552-3642-1-git-send-email-elliot.smith@intel.com> References: <1466178552-3642-1-git-send-email-elliot.smith@intel.com> X-AuthUser: elliot@townx.org Subject: [PATCH 2/2][v2] toaster-tests: define capabilities for latest Firefox driver X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 15:49:30 -0000 For the latest Firefox versions, WebDriver requires a download of a separate binary and an additional capability to be defined on it. Modify our tests so that when "marionette" is set as the browser, this capability is defined on the Firefox driver. Also add a note to the README about the additional installation steps required. Signed-off-by: Elliot Smith --- bitbake/lib/toaster/tests/browser/README | 19 +++++++++++++++++-- bitbake/lib/toaster/tests/browser/selenium_helpers.py | 5 +++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/toaster/tests/browser/README b/bitbake/lib/toaster/tests/browser/README index f57154e..969f06c 100644 --- a/bitbake/lib/toaster/tests/browser/README +++ b/bitbake/lib/toaster/tests/browser/README @@ -24,15 +24,30 @@ To run tests against PhantomJS (headless): * On *nix systems, put phantomjs on PATH * Not tested on Windows -Firefox should work without requiring additional software to be installed. +To run tests against Firefox, you may need to install the Marionette driver, +depending on how new your version of Firefox is. One clue that you need to do +this is if you see an exception like: -The test case will instantiate a Selenium driver set by the + selenium.common.exceptions.WebDriverException: Message: The browser + appears to have exited before we could connect. If you specified + a log_file in the FirefoxBinary constructor, check it for details. + +See https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver +for installation instructions. Ensure that the Marionette executable (renamed +as wires on Linux or wires.exe on Windows) is on your PATH; and use "marionette" +as the browser string passed via TOASTER_TESTS_BROWSER (see below). + +(Note: The Toaster tests have been checked against Firefox 47 with the +Marionette driver.) + +The test cases will instantiate a Selenium driver set by the TOASTER_TESTS_BROWSER environment variable, or Chrome if this is not specified. Available drivers: * chrome (default) * firefox +* marionette (for newer Firefoxes) * ie * phantomjs diff --git a/bitbake/lib/toaster/tests/browser/selenium_helpers.py b/bitbake/lib/toaster/tests/browser/selenium_helpers.py index 54db2e8..000937f 100644 --- a/bitbake/lib/toaster/tests/browser/selenium_helpers.py +++ b/bitbake/lib/toaster/tests/browser/selenium_helpers.py @@ -34,6 +34,7 @@ import time from django.contrib.staticfiles.testing import StaticLiveServerTestCase from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.common.exceptions import NoSuchElementException, \ StaleElementReferenceException, TimeoutException @@ -49,6 +50,10 @@ def create_selenium_driver(browser='chrome'): ) elif browser == 'firefox': return webdriver.Firefox() + elif browser == 'marionette': + capabilities = DesiredCapabilities.FIREFOX + capabilities['marionette'] = True + return webdriver.Firefox(capabilities=capabilities) elif browser == 'ie': return webdriver.Ie() elif browser == 'phantomjs': -- 2.7.4