Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Modern UI HTML Report to --html Option #2459

Merged
merged 2 commits into from
Nov 12, 2023

Conversation

andrewbaldwin44
Copy link
Collaborator

@andrewbaldwin44 andrewbaldwin44 commented Nov 10, 2023

When using the --html option together with the --modern-ui the modern report template will now be used

  • Ensured the report is outputed correctly when using the --headless option with both the old and new report
  • Ensured the report continues to work properly form the Web UI (old and new)

Fixes #2458

@cyberw
Copy link
Collaborator

cyberw commented Nov 10, 2023

Nice! Is it possible to make it respect dark/bright mode? Bright mode scares me :)

In future PRs, you can add "fixes #issue-number" to the PR (or a commit message) to link (and auto-close) the issue.

@andrewbaldwin44
Copy link
Collaborator Author

Good suggestion 👍 I added a flag --theme which will allow for controlling the default theme. The flag can be used inside and outside of headless mode, whichever theme is set will be the first theme that you see in the UI (the toggle will still be enabled should you wish to change it)

@cyberw
Copy link
Collaborator

cyberw commented Nov 11, 2023

Nice! But could you maybe use a choices parameter type instead of a string? https://docs.python.org/3/library/argparse.html#choices

@andrewbaldwin44
Copy link
Collaborator Author

👍
image

@andrewbaldwin44
Copy link
Collaborator Author

andrewbaldwin44 commented Nov 11, 2023

I also added one more commit which will detect if a users browser prefers dark or light theme and will use this as the default for the report in headless mode, this way it is not necessary to set/be aware of the --theme variable in order not to be blinded (we were already doing this for the UI but not yet for the HTML report)

@cyberw
Copy link
Collaborator

cyberw commented Nov 11, 2023

I also added one more commit which will detect if a users browser prefers dark or light theme and will use this as the default for the report in headless mode, this way it is not necessary to set/be aware of the --theme variable in order not to be blinded (we were already doing this for the UI but not yet for the HTML report)

Perhaps we dont even need to add the option then? We already have too many options so the help text is kinda unreadable :)

@andrewbaldwin44
Copy link
Collaborator Author

Yeah and now that I think of it, perhaps it even makes more sense this way, as the HTML file is something that could be passed around to multiple people and different people might have different preferences on the theme

@cyberw cyberw merged commit 2804faf into locustio:master Nov 12, 2023
14 checks passed
@cyberw
Copy link
Collaborator

cyberw commented Nov 12, 2023

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Modern UI HTML Report to --html Option
2 participants