Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Often 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.
pip install pyhtmlreport
Once you have installed pyhtmlreport - how do you get started?
from pyhtmlreport import Report
from selenium.webdriver import Chrome
from selenium.webdriver.common.keys import Keys
report = Report()
driver = Chrome()
report.setup(
report_folder=r'D:\Automation\Reports',
module_name='Google',
release_name='Release 1',
selenium_driver=driver
)
driver.get('https://www.google.com/')
try:
# Start of Test
report.write_step(
'Testing Search functionality',
status=report.status.Start,
test_number=1
)
search_box = driver.find_element_by_css_selector('input[aria-label="Search"]')
search_box.send_keys('pyhtmlreport is Awesome')
search_box.send_keys(Keys.ENTER)
# Test Steps
results = driver.find_elements_by_css_selector('div[id="search"] div[class="g"]')
assert len(results) > 1
report.write_step(
'Google Search returned more than 1 results',
status=report.status.Pass,
screenshot=True
)
except AssertionError:
report.write_step(
'Google Search did not return any result',
status=report.status.Fail,
screenshot=True
)
except Exception as e:
report.write_step(
f'Something went wrong during execution!</br>{e}',
status=report.status.Warn,
screenshot=True
)
finally:
report.generate_report()
driver.quit()
FAQs
Implement html reporting in Test Automation
We found that pyhtmlreport demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.