{ "info": { "author": "Jim Fulton", "author_email": "jim@zope.com", "bugtrack_url": null, "classifiers": [], "description": "WSGI+Webdriver for testing Javascript (and optionally WSGI) UIs\n***************************************************************\n\nThis package provides some helpers for testing Javascript (and\noptionally WSGI) applications using Python, Selenium Webdriver,\nManuel, and WSGI.\n\nThe package provides the following functions:\n\n``setUp(test, app)``\n a doctest ``setUp`` function that:\n\n - Sets up a webdriver, available as a ``browser`` variable.\n\n By default, a Chrome browser driver is used. You can override this\n in two ways:\n\n 1. Define a driver in a ``SELENIUM_DRIVER`` environment variable,\n or\n\n 2. In your test script, call the function ``get_factory_argument``\n to parse arguments for a ``-b`` option, typically before\n calling whatever logic normally parses arguments.\n\n The value of this option is a driver definition.\n\n The function definition:\n\n ``get_factory_argument(argv=sys.argv, option='-b')``\n Parse arguments for a browser definition.\n\n A driver definition can be one of the driver names, ``chrome``\n ``firefox``, ``ie``, ``opera``, or ``phantomjs``. It can also be\n a remote driver specification. A remote driver specification is\n of the form::\n\n browserName,version,platform,command_executor\n\n For example:\n\n internet explorer,10,Windows 8\n\n Items on the right can be omitted. In the example above, we've\n left off the command executor. If the command executor isn't\n provided as part of the option, it must be provided via the\n ``SELENIUM_REMOTE_COMMAND_EXECUTOR`` environment variable.\n\n Note that to use firefox as a remote browser without specifying\n anything else, you'll need to supply a trailing comma to prevent\n it from being treated as a name.\n\n - Sets up a server to serve a WSGI application.\n\n - Sets up 2 flavors of Javascript doctest examples:\n\n ``js>`` examples\n for evaluating Javascript expressions in the browser.\n\n IMPORTANT NOTE\n This should only be used with expressions. Using with\n multiple statements is likely to produce errors or strange\n results. This works by simply taking the source provides,\n jamming a ``return`` on the front of it and calling the\n Webdriver ``execute_script`` method.\n\n ``js!`` examples\n for executing Javascript code in the browser without returning\n anything. This works find with blocks of code. The source\n given is passed to the Webdriver ``execute_script`` method.\n\n IMPORTANT NOTE\n Functions defined in the source using ``function`` statements\n aren't in the Javascript global scope. To define global\n functions, use something like::\n\n global_name = function () {...}\n\n You can also execute Javascript code from Python examples using\n the Webdriver (``browser``) ``execute_script`` method. When\n invoking Javascript this way, be aware of the following oddities:\n\n - Functions defined via ``function`` statements can be used within\n the block of code, but aren't global. To define a global\n function, assign an anonymous function to a global variable.\n\n - No value is returned unless the block of code includes a return\n statement.\n\n - Includes the ``wait`` function ``from zope.testing.wait`` that\n waits for a condition.\n\n The function takes an additional argument (after the test argument),\n named ``app`` that provides a WSGI application object.\n\n``start_server(app, port=0, daemon=True)``\n A function that can be used to run the test server without running tests.\n\n Arguments:\n\n ``app``\n A WSGI application object\n\n ``port``\n The port to listen on. If 0, the default, then the port is\n allocated dynamically and returned.\n\n ``daemon``\n The daemon mode. This can be ``True``, ``False``, or ``None``.\n\n If ``None``, then the server is run in the foreground and blocks\n the caller.\n\n If ``True`` or ``False``, the server is run in a thread, whose\n daemon mode is set to the value of this parameter.\n\n\n``html(css=(), scripts=(), title=\"test\", body=\"\")``\n Return an HTML page with CSS links, script tags, and the given\n title and body tags.\n\n This is handy when you want a mostly empty HTML page that loads\n Javascript to be tested.\n\n ``css``\n An iterable of CSS URLs.\n\n ``scripts``\n An iterable of script definitions.\n\n Each definition is one of:\n\n - script URL\n\n - script tag (starting wth '<')\n\n - script Javascript source (containing at least one newline\n character)\n\n ``title``\n The contents of the page title\n\n ``body``\n The body of the document.\n\n``manuels(optionflags=0, checker=None)``\n Return a ``manuel`` parser for Python, Javascript and capture.\n\n``TestSuite(*tests, **options)``\n A function that takes one or more doctest/manuel file names\n and Test flags, such as ``setUp``, ``tearDown``, ``optionflags``,\n and ``checker``, and returns a doctest test suite.\n\n You can pass an ``app`` keyword argument, rather than passing\n ``setUp`` and ``tearDown``.\n\nSee the example test included with the package.\n\nChanges\n*******\n\n0.1.0 (2013-08-31)\n==================\n\nInitial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "zc.wsgidriver", "package_url": "https://pypi.org/project/zc.wsgidriver/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zc.wsgidriver/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/zc.wsgidriver/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "WSGI+Webdriver for testing Javascript (and optionally WSGI) UIs", "version": "0.1.0" }, "last_serial": 853810, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5b9d432000fecd586e227ce9c6353867", "sha256": "85c47dafab29a128ecc41792cdf8f888ab8f0899b56accf76dbe390bb63034da" }, "downloads": -1, "filename": "zc.wsgidriver-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5b9d432000fecd586e227ce9c6353867", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7542, "upload_time": "2013-08-31T16:41:15", "url": "https://files.pythonhosted.org/packages/93/0a/17fe0da0027a522f0b281ebc8469a50e55ca7f894082acf0002ebaa3eb57/zc.wsgidriver-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5b9d432000fecd586e227ce9c6353867", "sha256": "85c47dafab29a128ecc41792cdf8f888ab8f0899b56accf76dbe390bb63034da" }, "downloads": -1, "filename": "zc.wsgidriver-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5b9d432000fecd586e227ce9c6353867", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7542, "upload_time": "2013-08-31T16:41:15", "url": "https://files.pythonhosted.org/packages/93/0a/17fe0da0027a522f0b281ebc8469a50e55ca7f894082acf0002ebaa3eb57/zc.wsgidriver-0.1.0.tar.gz" } ] }