Skip to content

Control visibility of test results sections by query param #399

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

Closed
TheCorp opened this issue Dec 3, 2020 · 6 comments · Fixed by #433
Closed

Control visibility of test results sections by query param #399

TheCorp opened this issue Dec 3, 2020 · 6 comments · Fixed by #433
Assignees
Labels
enhancement This issue/PR relates to a feature request. feature This issue/PR relates to a feature request.

Comments

@TheCorp
Copy link

TheCorp commented Dec 3, 2020

Just like we can control collapsed test categories via query param (https://github.com/pytest-dev/pytest-html#display-options) would it also make sense to control whether test results sections are hidden or not (checkbox checked or not effectively) by query param? Something like:

?checked=Passed,XFailed,Skipped

The reason I am asking this is that it seems like this is nearly impossible to control before the page loads. We'd have to inject some JS that calls the "filter_tableI()" method for each section we want to check/uncheck or modify the to have the "hidden" attribute before the page is generated.

I understand we can wholesale not render elements for any section using the output hooks (https://github.com/pytest-dev/pytest-html#modifying-the-results-table) but that would remove the ability for anyone to see the results if they were interested in seeing them. We have test output with hundreds of passed/skipped outputs usually and only a few failed ones. It would be nice if all of those were hidden by default but still viewable if the user wanted to view them.

PR that did the original feature: #168

@TheCorp TheCorp changed the title Control checked/unchecked test results sections by query param Control visibility of test results sections by query param Dec 3, 2020
@BeyondEvil
Copy link
Contributor

Feel free to contribute a PR with a proposed solution! @TheCorp 😊 👍

@TheCorp
Copy link
Author

TheCorp commented Dec 4, 2020

Awesome. I just wanted to make sure the idea itself didn't sound stupid 😄

@BeyondEvil
Copy link
Contributor

Definitely not! @TheCorp

@gnikonorov gnikonorov added enhancement This issue/PR relates to a feature request. feature This issue/PR relates to a feature request. labels Dec 12, 2020
@gnikonorov gnikonorov self-assigned this Dec 20, 2020
@gnikonorov
Copy link
Member

Hey @TheCorp I'm going to implement this. Let me know if you're already working on a solution. If not, I'll make a PR in the coming days

@TheCorp
Copy link
Author

TheCorp commented Dec 20, 2020

Oh wow @gnikonorov thank you! No I haven't had the chance to start on this yet so go for it. Really appreciate you taking this on.

@gnikonorov
Copy link
Member

Of course @TheCorp. I'll have something up today or tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue/PR relates to a feature request. feature This issue/PR relates to a feature request.
Projects
None yet
3 participants