Skip to main content

Run your Selenium TestCase's in chrome, firefox or saucelabs

Project description

simple-nose-selenium
*************

A simple Selenium WebDriver plugin for nose.

This plugin is a python3 only stripped down version of `nose-selenium <https://github.com/klrmn/nose-selenium>`_.

nosetests command line options
==============================

.. code-block:: bash

nosetestswithsimplenoseseleniumhelpUsage:nosetests[options]Options:...withsimplenoseseleniumEnablepluginSimpleNoseSeleniumbrowser=BROWSERRunthistypeofbrowser(default[FIREFOX],options:[FIREFOX,CHROME,SAUCELABS]ExampleCommands..codeblock::bash nosetests --with-simple-nose-selenium --browser=FIREFOX


To run your tests on Saucelabs you need to set the required environment variables first.

.. code-block:: bash

exportSAUCELABSUSERNAME=foo export SAUCELABS_ACCESSKEY=123key
exportSAUCELABSPLATFORM=windows export SAUCELABS_BROWSER_NAME=chrome
exportSAUCELABSBROWSERVERSION=4.1 nosetests --with-simple-nose-selenium --browser=SAUCELABS


Inheriting from SeleniumTestCase
--------------------------------

SeleniumTestCase creates the webdriver and stores it in self.wd in its setUp()
and closes it in tearDown().

.. code-block:: python

from nose_selenium import SeleniumTestCase


class MyTestCase(SeleniumTestCase):

def test_that_google_opens(self):
self.wd.get("http://google.com")
self.assertEqual(self.wd.title, "Google")

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page