{ "info": { "author": "Davide Moro", "author_email": "davide.moro@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing" ], "description": "=============\nplay_selenium\n=============\n\n\n.. image:: https://travis-ci.org/davidemoro/play_selenium.svg?branch=master\n :target: https://travis-ci.org/davidemoro/play_selenium\n :alt: See Build Status on Travis CI\n\n.. image:: https://readthedocs.org/projects/play_selenium/badge/?version=latest\n :target: http://play_selenium.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://codecov.io/gh/davidemoro/play_selenium/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/davidemoro/play_selenium\n\npytest-play plugin driving browsers using Selenium/Splinter under the hood.\nSelenium grid compatible and implicit auto wait actions for more robust scenarios with less pain.\n\nMore info and examples on:\n\n* pytest-play_, documentation\n* cookiecutter-qa_, see ``pytest-play`` in action with a working example if you want to start hacking\n\nBrowser based commands\n----------------------\n\nBrowser based commands here.\n``play_selenium`` supports by default browser interactions. For example it can be used for running selenium splinter_ scenarios driving your browser for your UI test or system tests.\n\n``play_selenium`` is also your friend when page object approach (considered best practice) is not possible. For example:\n\n* limited time, and/or\n* lack of programming skills\n\nInstead if you are interested in a page object pattern have a look at pypom_form_ or pypom_.\n\n``play_selenium`` supports automatic waiting that should help to keep your tests more reliable with implicit waits before\nmoving on. By default it waits for node availability and visibility but it supports also some wait commands and\nwait until a given Javascript expression is ok. So it is at the same time user friendly and flexible.\n\n \nConditional commands (Javascript)\n=================================\n\nBased on a browser level expression (Javascript)::\n\n - type: clickElement\n provider: selenium\n locator:\n type: css\n value: body\n condition: \"'$foo' === 'bar'\"\n\n\nSupported locators\n==================\n\nSupported selector types:\n\n* css\n* xpath\n* tag\n* name\n* text\n* id\n* value\n\nOpen a page\n===========\n\nWith parametrization::\n\n - type: get\n provider: selenium\n url: \"$base_url\"\n\nor with a regular url::\n\n - type: get\n provider: selenium\n url: https://google.com\n\n\nPause\n=====\n\nThis command invokes a javascript expression that will\npause the execution flow of your commands::\n\n - type: pause\n provider: selenium\n waitTime: 1500\n\nIf you need a pause/sleep for non UI tests you can use the\n``sleep`` command provided by the play_python_ plugin.\n\nClick an element\n================\n::\n\n - type: clickElement\n provider: selenium\n locator:\n type: css\n value: body\n\nFill in a text\n==============\n::\n\n - type: setElementText\n provider: selenium\n locator:\n type: css\n value: input.title\n text: text value\n\nInteract with select input elements\n===================================\n\nSelect by label::\n\n - type: select\n provider: selenium\n locator:\n type: css\n value: select.city\n text: Turin\n\nor select by value::\n\n - type: select\n provider: selenium\n locator:\n type: css\n value: select.city\n value: '1'\n\nEval a Javascript expression\n============================\n\n::\n\n - type: eval\n provider: selenium\n script: alert('Hello world!')\n\nCreate a variable starting from a Javascript expression\n=======================================================\n\nThe value of the Javascript expression will be stored in\n``play.variables`` under the name ``count``::\n\n - type: storeEval\n provider: selenium\n variable: count\n script: document.getElementById('count')[0].textContent\n\nAssert if a Javascript expression matches\n=========================================\n\nIf the result of the expression does not match an ``AssertionError``\nwill be raised and the test will fail::\n\n - type: verifyEval\n provider: selenium\n value: '3'\n script: document.getElementById('count')[0].textContent\n\nVerify that the text of one element contains a string\n=====================================================\n\nIf the element text does not contain the provided text an\n``AssertionError`` will be raised and the test will fail::\n\n - type: verifyText\n provider: selenium\n locator:\n type: css\n value: \".my-item\"\n text: a text\n\nSend keys to an element\n=======================\n\nAll ``selenium.webdriver.common.keys.Keys`` are supported::\n\n - type: sendKeysToElement\n provider: selenium\n locator:\n type: css\n value: \".confirm\"\n text: ENTER\n\n\nSupported keys::\n\n KEYS = [\n 'ADD', 'ALT', 'ARROW_DOWN', 'ARROW_LEFT', 'ARROW_RIGHT',\n 'ARROW_UP', 'BACKSPACE', 'BACK_SPACE', 'CANCEL', 'CLEAR',\n 'COMMAND', 'CONTROL', 'DECIMAL', 'DELETE', 'DIVIDE',\n 'DOWN', 'END', 'ENTER', 'EQUALS', 'ESCAPE', 'F1', 'F10',\n 'F11', 'F12', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8',\n 'F9', 'HELP', 'HOME', 'INSERT', 'LEFT', 'LEFT_ALT',\n 'LEFT_CONTROL', 'LEFT_SHIFT', 'META', 'MULTIPLY',\n 'NULL', 'NUMPAD0', 'NUMPAD1', 'NUMPAD2', 'NUMPAD3',\n 'NUMPAD4', 'NUMPAD5', 'NUMPAD6', 'NUMPAD7', 'NUMPAD8',\n 'NUMPAD9', 'PAGE_DOWN', 'PAGE_UP', 'PAUSE', 'RETURN',\n 'RIGHT', 'SEMICOLON', 'SEPARATOR', 'SHIFT', 'SPACE',\n 'SUBTRACT', 'TAB', 'UP',\n ]\n\nWait until a Javascript expression matches\n==========================================\n\nWait until the given expression matches or raise a \n``selenium.common.exceptions.TimeoutException`` if takes too time.\n\nAt this time of writing there is a global timeout (20s) but in future releases\nyou will be able to override it on command basis::\n\n - type: waitUntilCondition\n provider: selenium\n script: document.body.getAttribute('class') === 'ready'\n\nWait for element present in DOM\n===============================\n\nPresent::\n\n - type: waitForElementPresent\n provider: selenium\n locator:\n type: css\n value: body\n\nor not present::\n\n - type: waitForElementPresent\n provider: selenium\n locator:\n type: css\n value: body\n negated: true\n\nWait for element visible\n========================\n\nVisible::\n\n - type: waitForElementVisible\n provider: selenium\n locator:\n type: css\n value: body\n\nor not visible::\n\n - type: waitForElementVisible\n provider: selenium\n locator:\n type: css\n value: body\n negated: true\n\nAssert element is present in DOM\n================================\n\nAn ``AssertionError`` will be raised if assertion fails.\n\nPresent::\n\n - type: assertElementPresent\n provider: selenium\n locator:\n type: css\n value: div.elem\n\nor not present::\n\n - type: assertElementPresent\n provider: selenium\n locator:\n type: css\n value: div.elem\n negated: true\n\nAssert element is visible\n=========================\n\nAn ``AssertionError`` will be raised if assertion fails.\n\nPresent::\n\n - type: assertElementVisible\n provider: selenium\n locator:\n type: css\n value: div.elem\n\nor not present::\n\n - type: assertElementVisible\n provider: selenium\n locator:\n type: css\n value: div.elem\n negated: true\n\n\nTwitter\n-------\n\n``play_selenium`` tweets happens here:\n\n* `@davidemoro`_\n \n\n.. _`pytest-play`: https://github.com/davidemoro/pytest-play\n.. _`pypom_form`: http://pypom-form.readthedocs.io/en/latest/\n.. _`splinter`: https://splinter.readthedocs.io/en/latest/\n.. _`pypom`: http://pypom.readthedocs.io/en/latest/\n.. _`@davidemoro`: https://twitter.com/davidemoro\n.. _`cookiecutter-qa`: https://github.com/davidemoro/cookiecutter-qa\n.. _`play_python`: https://github.com/davidemoro/play_python\n\nChangelog\n=========\n\n0.0.3 (2019-06-26)\n------------------\n\n- according to new ``pytest-play`` versions (>= 2.0) the ``self.engine.parametrize`` should\n be used instead of accessing ``self.engine.parametrizer``\n\n\n0.0.2 (2019-02-18)\n------------------\n\n- Remove pytest version constraint (added compatibility with pytest>=4)\n\n\n0.0.1 (2019-01-25)\n------------------\n\n- Supports new pytest-play >= 2.0 YAML based syntax (json no more supported)", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/davidemoro/play_selenium", "keywords": "", "license": "Apache Software License 2.0", "maintainer": "Davide Moro", "maintainer_email": "davide.moro@gmail.com", "name": "play-selenium", "package_url": "https://pypi.org/project/play-selenium/", "platform": "", "project_url": "https://pypi.org/project/play-selenium/", "project_urls": { "Homepage": "https://github.com/davidemoro/play_selenium" }, "release_url": "https://pypi.org/project/play-selenium/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "pytest plugin that let you drive a browser with Selenium", "version": "0.0.3" }, "last_serial": 5451279, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "383201b7d6cc5b6f8babd3733da99043", "sha256": "8d80e28da303dbfba0324d940e0eed53eb525bc3a441a77d29a0cd692c1deb95" }, "downloads": -1, "filename": "play_selenium-0.0.1.tar.gz", "has_sig": false, "md5_digest": "383201b7d6cc5b6f8babd3733da99043", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12892, "upload_time": "2019-01-25T22:27:55", "url": "https://files.pythonhosted.org/packages/13/68/b93dd3786be15875b4e5e692630674c0675ddf009caa06e5d30bed55f144/play_selenium-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "3d2d4ebd38a528234385d3c8799ce2a1", "sha256": "2d03bafa57cd329bc3739f361b57e895751a088710e10ad6aef50cf2c9956cfd" }, "downloads": -1, "filename": "play_selenium-0.0.2.tar.gz", "has_sig": false, "md5_digest": "3d2d4ebd38a528234385d3c8799ce2a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12979, "upload_time": "2019-02-18T14:33:18", "url": "https://files.pythonhosted.org/packages/9c/87/5b92cbade3c7f4b136d018db0057657ce156c2379e31970aac34ebccc746/play_selenium-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "394c3e015ad259b9c315a4beba47f6cb", "sha256": "658070c64cd93fc4f46f77dc275dc662e86c9f583b1840fce63de84bcafc8d41" }, "downloads": -1, "filename": "play_selenium-0.0.3.tar.gz", "has_sig": false, "md5_digest": "394c3e015ad259b9c315a4beba47f6cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10824, "upload_time": "2019-06-26T12:05:03", "url": "https://files.pythonhosted.org/packages/90/bd/0467231a36f682e96e35f61ca664a9f629fd6afec4f4c8684195314698d0/play_selenium-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "394c3e015ad259b9c315a4beba47f6cb", "sha256": "658070c64cd93fc4f46f77dc275dc662e86c9f583b1840fce63de84bcafc8d41" }, "downloads": -1, "filename": "play_selenium-0.0.3.tar.gz", "has_sig": false, "md5_digest": "394c3e015ad259b9c315a4beba47f6cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10824, "upload_time": "2019-06-26T12:05:03", "url": "https://files.pythonhosted.org/packages/90/bd/0467231a36f682e96e35f61ca664a9f629fd6afec4f4c8684195314698d0/play_selenium-0.0.3.tar.gz" } ] }