Metadata-Version: 2.1
Name: edw.seleniumtesting
Version: 1.1
Summary: Selenium testing metapackage
Home-page: https://pypi.python.org/pypi/edw.seleniumtesting
Author: David Bătrânu
Author-email: david.batranu@eaudeweb.ro
License: GPL version 2
Keywords: Python Plone
Platform: UNKNOWN
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.5
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Requires-Dist: setuptools
Requires-Dist: selenium (>=3.0.2)

===================
edw.seleniumtesting
===================

Selenium based automated testing.


Installation
------------
This package requires **Python 3.5**!
::

    $ pip install edw.seleniumtesting
    $ seleniumtesting -h



Usage
-----

By itself this product doesn't do anything. You must provide test suites to be run in the form of pkg_resource plugins.
The ``edw.seleniumtesting.sample`` suite is registered in such a way to provide an example.

In your own package, after writing the suite (refer to ``edw.seleniumtesting.sample``) you must the following to the
``setup.py`` of your package (the sample suite is registered in the same way): ::

    entry_points={
        'edw.seleniumtesting': [
            'my.package.test1 = my.package.test1:suite',
            'my.package.test2 = my.package.test2:suite',
            'my.package.test3 = my.package.test3:suite',
            [...]
        ]
    }

and ``pip install my.package``. Modifying the list of tests defined in the ``entry_points`` will require a
re-installation of your package (re-run pip/setuptools/buildout).


To run the ``my.package.test1``, ``my.package.test2`` and ``my.package.test3`` tests in Firefox,
specifying the path to ``geckodriver`` at the default ``1024x768`` resolution: ::

    $ seleniumtesting -v -B firefox -P /usr/bin/geckodriver https://localhost my.package.test1 my.package.test2 my.package.test3


To run all tests in phantomjs in glorious 4K resolution: ::

    $ seleniumtesting -v -B phantomjs -P /usr/bin/phantomjs -sw 3840 -sh 2160 https://localhost

Failed tests and tests that encounter an error will save a screenshot in the current working directory.


Browser arguments
-----------------

Supported for Chrome and Firefox. Can be provided using ``-A``. For example, to run Chrome with the ``--headless`` option: ::

    $ seleniumtesting -v -B chrome -P /usr/lib/chromium-browser/chromedriver -A='--headless' https://localhost


Extra arguments
---------------

Some test suites might make use of extra arguments (e.g. to provide user account credentials).
These can be given using the ``-ea`` or ``--extra-arg`` parameter. For example: ::

  seleniumtesting http://localhost ns.some.test -ea labels login "Login Button" -ea users testuser testuserpwd

The arguments will be passed to ``suite`` as extra_args. Make sure to instantiate your ``BrowserTestCase`` subclass with ``extra_args`` as well. You will then be able to read the args in the test from ``self.extra_args``.

For the example provided above, ``self.extra_args`` will look like this: ::

  {
      'labels': { 'login':    'Login Button' },
      'users':  { 'testuser': 'testuserpwd'  }
  }


Contribute
----------

- Issue Tracker: https://github.com/eaudeweb/edw.seleniumtesting/issues
- Source Code: https://github.com/eaudeweb/edw.seleniumtesting
- Documentation: https://github.com/eaudeweb/edw.seleniumtesting/wiki


License
-------

The project is licensed under the GPLv3.


Contributors
============

- David Bătrânu, b'david.batranu@eaudeweb.ro'


Changelog
=========


1.1 (2018-04-25)
----------------

- Support for browser options (e.g. --headless)
  [david-batranu]


1.0 (2017-02-17)
----------------

- Initial release.
  [david-batranu]


