{ "info": { "author": "Abtin Gramian", "author_email": "abtin.gramian@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Selenium Unittest\n=================\n\nContents\n--------\n\n`Overview <#overview-1>`__\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n`Setup <#setup-1>`__\n~~~~~~~~~~~~~~~~~~~~\n\n`Installation <#installation-1>`__\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`WebDrivers <#webdrivers-1>`__\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`Running tests <#running-tests-1>`__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n`Usage `__\n^^^^^^^^^^^^^^^^^^^\n\n`Example `__\n^^^^^^^^^^^^^^^^^^^^^^^\n\n`Using the Chrome Developer Console <#using-the-chrome-developer-console-1>`__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n`Description <#description-1>`__\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`Useful commands <#useful-commands-1>`__\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`Element query examples <#element-query-examples-1>`__\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`More info <#more-info-1>`__\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n`Code organization <#code-organization-1>`__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n`TODO <#todo-1>`__\n~~~~~~~~~~~~~~~~~~\n\nOverview\n--------\n\nA Selenium Unit Test Framework for\n`Selenium `__ with the `Selenium Python\nclient `__.\n\nSelenium is an open-source **web application automation and testing\nframework**. Tests are written using WebDriver-compatible\nlanguage-specific client libraries.\n\nThe Selenium tests are written in *Python* and run through the\nlanguage's built-in *unittest* framework. A custom test runner and\nreporter handle boilerplate Selenium setup along with storage of results\nin a json file for post-processing.\n\n`Back to top <#contents>`__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSetup\n-----\n\nInstallation\n~~~~~~~~~~~~\n\n::\n\n pip install selenium_unittest\n\nWebDrivers\n~~~~~~~~~~\n\nDownload one or more WebDriver executables from\n`here `__ to a desired location.\n\n*Note: Make sure the executables allow read and execution permission*\n\n`Back to top <#contents>`__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nRunning tests\n-------------\n\nFor basic usage, execute the following command in a directory. By\ndefault test discovery will occur relative to the working directory and\nwill look for any filenames containing the string \"test\". The command\nbelow also assumes that the chromedriver executable is located in a\ndirectory named webdrivers inside the working directory.\n\n``python -m selenium_unittest.selenium_test_runner.py --browser_name \"Chrome\" --webdriver_path \"webdrivers/chromedriver\"``\n\nUsage\n~~~~~\n\n::\n\n usage: -c [-h] --browser_name {Chrome} [--browser_version BROWSER_VERSION]\n [--test_suites TEST_SUITES] [--test_types TEST_TYPES]\n [--pattern PATTERN] [--show_previous_results] [--base_url BASE_URL]\n\n Run a Selenium test\n\n optional arguments:\n -h, --help show this help message and exit\n --browser_name {Chrome}\n Browser to run tests on.\n --webdriver_path WEBDRIVER_PATH\n Path to webdriver executable.\n --webdriver_path_type {absolute,relative}\n Type of path to use when determining webdriver_path.\n --browser_version BROWSER_VERSION\n Selenium test browser version.\n --test_dir TEST_DIR Path to directory containing tests. (path type is\n based on value of --test_dir_path_type which defaults\n to relative)\n --test_dir_path_type {absolute,relative}\n Type of path to use when determining test_dir\n location.\n --results_dir RESULTS_DIR\n Path to directory to read/write results from/to.(path\n type is based on value of --results_dir_path_type\n which defaults to relative)\n --results_dir_path_type {absolute,relative}\n Type of path to use when determining results_dir\n location.\n --test_suites TEST_SUITES\n Comma-separated test directories.\n --test_types TEST_TYPES\n Comma-separated list of test types to run (Ex:\n \"Smoke\", \"Guide-Discovery\")\n --pattern PATTERN Regular expression to filter which file patterns to\n regard as tests.\n --show_previous_results\n Whether to combine the results of previous test runs\n for display at the end.\n --base_url BASE_URL Base url to use for tests.\n\nExample\n~~~~~~~\n\nAn example test is provided in the test directory.\n\nTo run it clone the repo and execute the following command from the main\ndirectory:\n``python -m selenium_unittest.selenium_test_runner.py --browser_name \"Chrome\" --test_dir \"test\" --webdriver_path \"test/webdrivers/chromedriver\"``\n\n`Back to top <#contents>`__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nUsing the Chrome Developer Console\n----------------------------------\n\nDescription\n~~~~~~~~~~~\n\nAllows direct interaction and inspection of the web app in real-time via\nthe web browser's console. This is helpful when debugging or writing\ntests because it allows you to see a list of DOM elements on each page\nof the web app along with their properties. For example while writing a\ntest you will need to click buttons, interact with forms, verify\nproperties, etc. In order to write such a test, you will need to\nreference elements by id, name, or some other identifiers. The fastest\nway to figure out how to reference an element is by navigating to the\npage of the web app where the test will start from using the browser,\nright clicking on elements and selecting \"Inspect Element\" from the\ncontext menu, then trying to reference the element through the Chrome\nDeveloper Console using the commands below.\n\nUseful commands\n~~~~~~~~~~~~~~~\n\n``$()`` Returns the first element that matches the CSS selector\nspecified within the parantheses. It is a shortcut for\ndocument.querySelector() ``$$()`` Returns an array of all the elements\nthat match the CSS selector specified within the parantheses. This is an\nalias for document.querySelectorAll() ``$x()`` Returns an array of\nelements that match the XPath specified within the parantheses.\n\nElement query examples\n~~~~~~~~~~~~~~~~~~~~~~\n\n``$x(\"//span[text()='Guidebook']\")`` Returns an array of span tag\nelements containing the text \"Guidebook\".\n``$(\"p.usm_name span\").textContent`` Returns the text content of the\nfirst span tag element which is a child of a \"p\" element with class\n\"usm\\_name\".\n\nMore info\n~~~~~~~~~\n\nAdditional info regarding the Chrome Developer Console is available\n`here `__.\n\n`Back to top <#contents>`__\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCode organization\n-----------------\n\n.. code:: js\n\n selenium_unittest\n \u251c\u2500\u2500 selenium_test_base.py // base selenium test class\n \u251c\u2500\u2500 selenium_test_manager.py // handles common server/driver setup/teardown\n \u251c\u2500\u2500 selenium_test_runner.py // receives command line arguments, then discovers and runs selenium tests\n\n`Back to top <#contents>`__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTODO\n----\n\n- add support for WebDrivers beside ChromeDriver\n- implement teardown\\_suite()\n- currently if show\\_previous\\_results is specified to the test runner,\n if the same suite or case is run there is no differentiation in the\n output or screenshot directory (add timestamp)\n- add sample json format of result file in README\n\n`Back to top <#contents>`__\n~~~~~~~~~~~~~~~~~~~~~~~~~~~", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/agramian/selenium-unittest/tarball/v0.2.3", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/agramian/selenium-unittest", "keywords": "selenium,unittest,unit,test,testing", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "selenium_unittest", "package_url": "https://pypi.org/project/selenium_unittest/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/selenium_unittest/", "project_urls": { "Download": "https://github.com/agramian/selenium-unittest/tarball/v0.2.3", "Homepage": "https://github.com/agramian/selenium-unittest" }, "release_url": "https://pypi.org/project/selenium_unittest/0.2.3/", "requires_dist": null, "requires_python": null, "summary": "Selenium Unit Test Framework", "version": "0.2.3" }, "last_serial": 1789229, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8ca5e75afadd3047199d727a613bcd5a", "sha256": "ea56811f4541a0a85ce8f075c9ab3cbebce4d5f337f4693284343c93ebf0fa97" }, "downloads": -1, "filename": "selenium_unittest-0.1.tar.gz", "has_sig": false, "md5_digest": "8ca5e75afadd3047199d727a613bcd5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3881, "upload_time": "2015-09-28T22:21:45", "url": "https://files.pythonhosted.org/packages/ca/8d/86d7f35712988d7468f25d641c1a894cd323a4ee261e4499e2865f94df77/selenium_unittest-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "cd133ff7d0f104728b0ee06ea1523d3b", "sha256": "a29fbf7226323fd875010fe08d7d5c2258dc05848f301525baeab87fef3f94e3" }, "downloads": -1, "filename": "selenium_unittest-0.1.1.tar.gz", "has_sig": false, "md5_digest": "cd133ff7d0f104728b0ee06ea1523d3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7491, "upload_time": "2015-09-29T00:29:24", "url": "https://files.pythonhosted.org/packages/ee/3b/259b2c8809e47a59882c0b6133cf8771809b7ae2e1ede6a81c16d840c174/selenium_unittest-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "1a75483cf6ab4571635bb274146f5fa1", "sha256": "3e0043ca0a2304f4a7b0cb1758901789e328eb1d598c82421b3a97f7e45244fe" }, "downloads": -1, "filename": "selenium_unittest-0.1.2.tar.gz", "has_sig": false, "md5_digest": "1a75483cf6ab4571635bb274146f5fa1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7745, "upload_time": "2015-09-29T01:19:13", "url": "https://files.pythonhosted.org/packages/76/83/75f6f6a5b7d947377713863ebf0880642c51adcf518601944d96c85feb6d/selenium_unittest-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "557fed2506f0fd3080bb3dc12d3cee89", "sha256": "5e279cd5e3254f5e60c8c755410be555ed7442ce28f875a6d5c7fe03c63c7946" }, "downloads": -1, "filename": "selenium_unittest-0.1.3.tar.gz", "has_sig": false, "md5_digest": "557fed2506f0fd3080bb3dc12d3cee89", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9232, "upload_time": "2015-09-29T20:40:58", "url": "https://files.pythonhosted.org/packages/7e/07/f3153c35b85fb34cbcfafc903a2dbdf5c771d42ebb65acade20f591442c4/selenium_unittest-0.1.3.tar.gz" } ], "0.1.4": [], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a2198f821c6c68322c31bf9d0fc9051b", "sha256": "0ba9c058acb7c6ee2a78a3344e3ba923e123ee1aff135dd32e58e001619d6a85" }, "downloads": -1, "filename": "selenium_unittest-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a2198f821c6c68322c31bf9d0fc9051b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9323, "upload_time": "2015-09-29T23:03:13", "url": "https://files.pythonhosted.org/packages/81/20/479e129aab5bf373aaa7968743b94b3f406a244b91937f36048c1e7b4fe4/selenium_unittest-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "6c0a0e549331b8dc3744642b190a822c", "sha256": "223ca6a152a56ceb8064519847d55c5eba679fc3fa31e4cab13708d9722b1424" }, "downloads": -1, "filename": "selenium_unittest-0.2.1.tar.gz", "has_sig": false, "md5_digest": "6c0a0e549331b8dc3744642b190a822c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9345, "upload_time": "2015-09-29T23:22:47", "url": "https://files.pythonhosted.org/packages/d2/8a/814e532de4b1b2c0fd2aa9079641cff029b2e5b0d0b6354d99d51bc57abc/selenium_unittest-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "5d1717f0ae6e44253183f6d3282ee0aa", "sha256": "8377a3bd0184c702a9142139ecb1dc67ce661dafb6f278cb7ab77a7e547db9c5" }, "downloads": -1, "filename": "selenium_unittest-0.2.2.tar.gz", "has_sig": false, "md5_digest": "5d1717f0ae6e44253183f6d3282ee0aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9717, "upload_time": "2015-09-30T00:56:23", "url": "https://files.pythonhosted.org/packages/88/5f/a350293e37de25c14f3cfd4bf0edc4778c8107ac28baafc34ad8c50a1c60/selenium_unittest-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "ea1f3a4f5ef6c7de5f197fbe588dce10", "sha256": "88ce997739465614d98d2507083255a7b3bc30875289286d5c0b2c475f1a0a12" }, "downloads": -1, "filename": "selenium_unittest-0.2.3.tar.gz", "has_sig": false, "md5_digest": "ea1f3a4f5ef6c7de5f197fbe588dce10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10103, "upload_time": "2015-10-27T22:33:11", "url": "https://files.pythonhosted.org/packages/7f/50/bb0c09163d488a68c2a3b8b1e3f16178a553e0c1013d63c27d57e6395dd9/selenium_unittest-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ea1f3a4f5ef6c7de5f197fbe588dce10", "sha256": "88ce997739465614d98d2507083255a7b3bc30875289286d5c0b2c475f1a0a12" }, "downloads": -1, "filename": "selenium_unittest-0.2.3.tar.gz", "has_sig": false, "md5_digest": "ea1f3a4f5ef6c7de5f197fbe588dce10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10103, "upload_time": "2015-10-27T22:33:11", "url": "https://files.pythonhosted.org/packages/7f/50/bb0c09163d488a68c2a3b8b1e3f16178a553e0c1013d63c27d57e6395dd9/selenium_unittest-0.2.3.tar.gz" } ] }