{ "info": { "author": "Satish Kumar Kadarkarai Mani", "author_email": "michael.satish@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Quality Assurance", "Topic :: Software Development :: Testing", "Topic :: Utilities" ], "description": "# pyhtmlreport\n\nOften open source Test Automation projects lack a good reporting solution, pyhtmlreport solves that by creating HTML reports and represents the output as steps with screenshots.\n\n### Requirements ###\n\n* Requires Python 3.7 or higher.\n* Access to Internet, materlizecss (https://materializecss.com/) is used to style the html report and accessed via cdn.\n\n### How to Install ###\n\n```\npip install pyhtmlreport\n```\n\n### Getting Started Guide ###\n\nOnce you have installed pyhtmlreport - how do you get started?\n* Import the Report class and create a Report instance.\n* Call the setup method.
\n **Parameters**\n * *Report Folder*: Root report folder to contain all test reports.\n * *Module Name*: Name of the application, a module within the application or a function.\n * *Release Name*: Application Release cycle.\n * *Maximum Screenshots*: By default, the number of screenshots for a Report instance is 1000. This parameter can be used to increase the number.\n * *Selenium Webdriver*: Screenshots are taken using the pillow library. If an instance of Selenium Webdriver is provided, the brower viewport is taken as screenshot using Selenium's save_screenshot method.\n* Start writing to the test report by using the write_step method. The first step should have the **Start** status, it signals the start of a test to the report instance.
\n **Parameters**\n * *Step*: Description (Expected or Actual Step Description).\n * *Status*: Start, Pass, Fail and Warn.\n * *Screenshot*: Optional flag to capture screenshot for a step.\n* Call the generate_report method at the end to generate the HTML report.\n\n```python\nfrom pyhtmlreport import Report\nfrom selenium.webdriver import Chrome\nfrom selenium.webdriver.common.keys import Keys\n\nreport = Report()\ndriver = Chrome()\n\nreport.setup(\n\treport_folder=r'D:\\Automation\\Reports',\n\tmodule_name='Google',\n\trelease_name='Release 1',\n\tselenium_driver=driver\n)\ndriver.get('https://www.google.com/')\n\ntry:\n # Start of Test\n report.write_step(\n \t'Testing Search functionality',\n \tstatus=report.status.Start,\n \ttest_number=1\n )\n search_box = driver.find_element_by_css_selector('input[aria-label=\"Search\"]')\n search_box.send_keys('pyhtmlreport is Awesome')\n search_box.send_keys(Keys.ENTER)\n\n # Test Steps\n results = driver.find_elements_by_css_selector('div[id=\"search\"] div[class=\"g\"]')\n assert len(results) > 1\n report.write_step(\n \t'Google Search returned more than 1 results',\n \tstatus=report.status.Pass,\n \tscreenshot=True\n )\nexcept AssertionError:\n report.write_step(\n 'Google Search did not return any result',\n\t status=report.status.Fail,\n\t screenshot=True\n )\nexcept Exception as e:\n report.write_step(\n f'Something went wrong during execution!
{e}',\n status=report.status.Warn,\n\tscreenshot=True\n )\nfinally:\n report.generate_report()\n driver.quit()\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/michaelsatish/pyhtmlreport", "keywords": "html report", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "pyhtmlreport", "package_url": "https://pypi.org/project/pyhtmlreport/", "platform": "", "project_url": "https://pypi.org/project/pyhtmlreport/", "project_urls": { "Homepage": "https://github.com/michaelsatish/pyhtmlreport" }, "release_url": "https://pypi.org/project/pyhtmlreport/1.1/", "requires_dist": null, "requires_python": "", "summary": "Implement html reporting in Test Automation", "version": "1.1" }, "last_serial": 4475521, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "f66fbe080ec8895fec481b05cf255d85", "sha256": "4eb75264b44127e83184dfe65a6151c7d050cf76008f2c7deadc48ca2cd643fe" }, "downloads": -1, "filename": "pyhtmlreport-1.0.tar.gz", "has_sig": false, "md5_digest": "f66fbe080ec8895fec481b05cf255d85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5680, "upload_time": "2018-11-09T01:30:36", "url": "https://files.pythonhosted.org/packages/b2/ef/94d5c84c00960ab3b31e645312c6285b58b49843f1c3edcac1b4d8769c61/pyhtmlreport-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "ccb48f4260054d107db015333570e591", "sha256": "8ef1a392f459fa1afdbea00706e87431d1bad3535a1e344202673f8b110345bf" }, "downloads": -1, "filename": "pyhtmlreport-1.1.tar.gz", "has_sig": false, "md5_digest": "ccb48f4260054d107db015333570e591", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11739, "upload_time": "2018-11-12T00:03:34", "url": "https://files.pythonhosted.org/packages/8a/9c/72585fd8a5c6e3d025c600b58db97f4b93d432fb8803555774bccdc19429/pyhtmlreport-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ccb48f4260054d107db015333570e591", "sha256": "8ef1a392f459fa1afdbea00706e87431d1bad3535a1e344202673f8b110345bf" }, "downloads": -1, "filename": "pyhtmlreport-1.1.tar.gz", "has_sig": false, "md5_digest": "ccb48f4260054d107db015333570e591", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11739, "upload_time": "2018-11-12T00:03:34", "url": "https://files.pythonhosted.org/packages/8a/9c/72585fd8a5c6e3d025c600b58db97f4b93d432fb8803555774bccdc19429/pyhtmlreport-1.1.tar.gz" } ] }