{ "info": { "author": "Ivailo Karamanolev", "author_email": "ivailo@karamanolev.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Testing" ], "description": "====================\npersephone-client-py\n====================\nA Python client for the Persephone REST API\n-------------------------------------------\n\n1. Installation\n===============\n\nYou can install persephone-client-pi from pip::\n\n $ pip install persephone-client-py\n\n2. Usage\n========\n\nThere are two main classes - ``PersephoneClient`` and ``PersephoneBuildHelper``. The former can be\nused to access the full-range of the API, while the latter is more useful during a CI run in order\nto create a build, upload screenshots and finish the build.\n\n3. Using ``PersephoneBuildHelper`` to submit screenshots during a build\n=======================================================================\n\nThe example here uses the standard Jenkins environment variables. You can use anything else instead::\n\n # For example in your setUpClass method or wrapper script\n persephone = PersephoneBuildHelper(\n 'http://persephone.yourdomain.com',\n 'username',\n 'password',\n '1',\n os.getenv('ghprbActualCommit'),\n os.getenv('ghprbSourceBranch'),\n os.getenv('BUILD_NUMBER'),\n os.getenv('BUILD_URL'),\n os.getenv('ghprbPullId'),\n )\n persephone.create_build()\n # In your testcase, assuming self.driver is a Selenium driver instance\n persephone.upload_screenshot('Main Page.png', self.driver.screenshot_as_png())\n # After the build is finished - tearDownClass or end of wrapper script\n persephone.finish_build()\n\nIf you create the build and then want to use a separate instance of ``PersephoneBuildHelper`` to\nupload the screenshots (for example the build is managed by a wrapper script), you can access the\nbuild ID using ``persephone.build_id`` right after calling ``create_build`` and pass that to the\ntesting module. Inside, you can create a minimal ``PersephoneBuildHelper`` using only the endpoint,\nusername, password and build_id and use that to upload the screenshots.\n\n4. Using the built-in Jenkins and CircleCI helpers\n==================================================\n\nIf you're using Jenkins or CircleCI to build your project, then you can skip some of the work\ndescribed above. persephone-client-py comes with helper classes that can take most of the\ninformation from the environment variables those system provide. You still have to provide the\nendpoint, username, password and project ID. That can be done either via environment variables\n(``PERSEPHONE_ENDPOINT``, ``PERSEPHONE_USERNAME``, ``PERSEPHONE_PASSWORD``,\n``PERSEPHONE_PROJECT_ID``) or by passing them via kwargs to the respective constructor. If those\nenvironment variables are present, you can just construct the objects and start using the API::\n\n persephone = JenkinsBuildHelper()\n # or\n persephone = CircleCIBuildHelper()\n # and then\n persephone.create_build()\n persephone.upload_screenshot(...)\n\nThe Jenkins helper support standard builds as well as those triggered by the GitHub Pull Request\nBuilder plugin. CircleCI has native support for master/branch/PR builds.\n\n5. Using the command line interface\n===================================\n\nAfter you install persephone-client-py, you can use the ``persephone_cli`` command-line interface to\nmanage builds and upload screenshots. The configuration parameters (endpoint, username, etc.) can be\npassed via environment variables or command line options. You can list the options using\n``persephone_cli --help``. The environment variables are available with the ``PERSEPHONE_`` prefix.\nFor example, if the command-line option is ``--commit-hash`` the respective environment variable is\n``PERSEPHONE_COMMIT_HASH``. The environment variables, if present, can still be overridden using the\ncommand line options.\n\nCreating a build::\n\n $ persephone-cli --endpoint \"http://persephone.yourdomain.com/\" --username admin \\\n --password admin create_build\n 5\n\nThe above command outputs the new build ID. To upload a screenshot::\n\n $ persephone-cli --endpoint \"http://persephone.yourdomain.com/\" --username admin \\\n --password admin upload_screenshot --build-id 5 --image-path myimage.png \\\n --image-name \"Main Page.png\"", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/karamanolev/persephone-client-py", "keywords": "python visual-regression-testing", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "persephone-client-py", "package_url": "https://pypi.org/project/persephone-client-py/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/persephone-client-py/", "project_urls": { "Homepage": "http://github.com/karamanolev/persephone-client-py" }, "release_url": "https://pypi.org/project/persephone-client-py/0.0.2/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "A Python client for the Persephone REST API", "version": "0.0.2" }, "last_serial": 2762319, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b1931ebbe06530fa0b709754d7a400d9", "sha256": "20b5d21549b70c6b4c989b185a4f7a713fada7689b1860c6f89ad2e111252ca3" }, "downloads": -1, "filename": "persephone_client_py-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "b1931ebbe06530fa0b709754d7a400d9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8975, "upload_time": "2017-04-01T16:09:44", "url": "https://files.pythonhosted.org/packages/0f/55/2a90213116be0f6f2b050223c3b7412f96ede3e52c849de8072718995f60/persephone_client_py-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ed9f465bd97de48661e11bb1b3cf70c", "sha256": "d27cb067dd34d78293506a62910c5103c15104add149a9aca89ea3f33c39df20" }, "downloads": -1, "filename": "persephone-client-py-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6ed9f465bd97de48661e11bb1b3cf70c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5599, "upload_time": "2017-04-01T16:09:47", "url": "https://files.pythonhosted.org/packages/fc/08/1900a538c8404619a4a467f149acdd65218cc03a43437674111d9c07f74f/persephone-client-py-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "39ebf4bba671dc2138bcec25a9fd6f0d", "sha256": "cc389441261a14c269c5ea4377557d47f9d766e614c4337f74e8796c461d96b8" }, "downloads": -1, "filename": "persephone_client_py-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "39ebf4bba671dc2138bcec25a9fd6f0d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9816, "upload_time": "2017-04-08T11:47:35", "url": "https://files.pythonhosted.org/packages/65/0e/58809f2b70729cbb8c3d4dcf1b63e84a9b691c30025199a4fa9c2811e125/persephone_client_py-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7385707f44837c6d332092a0dcb9f419", "sha256": "75851b63a3231734a5eca33499f33944af2da249586daf442f8ff4d12b390c70" }, "downloads": -1, "filename": "persephone-client-py-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7385707f44837c6d332092a0dcb9f419", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6085, "upload_time": "2017-04-08T11:47:37", "url": "https://files.pythonhosted.org/packages/14/98/96cd28bf1e9681c50db2791c4289dd989220ee6c681fd223934ff2dd3078/persephone-client-py-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "39ebf4bba671dc2138bcec25a9fd6f0d", "sha256": "cc389441261a14c269c5ea4377557d47f9d766e614c4337f74e8796c461d96b8" }, "downloads": -1, "filename": "persephone_client_py-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "39ebf4bba671dc2138bcec25a9fd6f0d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9816, "upload_time": "2017-04-08T11:47:35", "url": "https://files.pythonhosted.org/packages/65/0e/58809f2b70729cbb8c3d4dcf1b63e84a9b691c30025199a4fa9c2811e125/persephone_client_py-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7385707f44837c6d332092a0dcb9f419", "sha256": "75851b63a3231734a5eca33499f33944af2da249586daf442f8ff4d12b390c70" }, "downloads": -1, "filename": "persephone-client-py-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7385707f44837c6d332092a0dcb9f419", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6085, "upload_time": "2017-04-08T11:47:37", "url": "https://files.pythonhosted.org/packages/14/98/96cd28bf1e9681c50db2791c4289dd989220ee6c681fd223934ff2dd3078/persephone-client-py-0.0.2.tar.gz" } ] }