Improve the SeleniumBase Dashboard functionality #754
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve the SeleniumBase Dashboard functionality
rich==9.5.1
The
--dashboard
option for pytest generates a SeleniumBase Dashboard located atdashboard.html
, which updates automatically as tests run and produce results. Example:Additionally, you can host your own SeleniumBase Dashboard Server on a port of your choice. Here's an example of that using Python 3's
http.server
:Now you can navigate to
http://localhost:1948/dashboard.html
in order to view the dashboard as a web app. This requires two different terminal windows: one for running the server, and another for running the tests, which should be run from the same directory.Here's a full example of what the SeleniumBase Dashboard may look like:
Using
--html=report.html
gives you a fancy report of the name specified after your test suite completes.When combining pytest html reports with SeleniumBase Dashboard usage, the pie chart from the Dashboard will get added to the html report. Additionally, if you set the html report URL to be the same as the Dashboard URL when also using the dashboard, (example:
--dashboard --html=dashboard.html
), then the Dashboard will become an advanced html report when all the tests complete.If viewing pytest html reports in Jenkins, you may need to configure Jenkins settings for the html to render correctly. This is due to Jenkins CSP changes.
You can also use
--junit-xml=report.xml
to get an xml report instead. Jenkins can use this file to display better reporting for your tests.