-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[Feature]: Add a parameter in the test.step()
method to hide code in report
#34052
Comments
@pavelfeldman What if allow passing await test.step('launch browser', () => {
// ...
}, { location: null }); |
Totally agree with @Sedatyf. |
I'm working on this |
Hello @vitalets , I am working with @EliW7 on this issue. What is your motivation for using |
Hi @asherdrake ! My motivation is to keep step API more concise. Re-using existing option instead of introducing a new one. Strictly speaking,
But I agree on your point too. It may be confusing, as Just for visual comparison: // re-using `location`
await test.step('launch browser', () => {
// ...
}, { location: null });
// using new option e.g. `snippet`
await test.step('launch browser', () => {
// ...
}, { snippet: false }); |
Maybe it's better to not change
|
@vitalets
May be using a wording as |
@vitalets Additionally, it seems that the function that creates the code snippets and adds them to a test step is quite disconnected from the implementation of test.step(). I am finding it difficult to come up with a way to toggle code snippets via a parameter from test.step()'s implementation, that does not disable code snippets for tests unrelated to test.step() or does not require changes across multiple files. When you describe a checkbox in the UI to toggle snippets, is it one checkbox for all snippets in the report, or a checkbox for each individual snippet? |
I'd personally vote for a global checkbox, that toggles snippets visibility for the whole report. |
🚀 Feature Request
I just discovered the
test.step
feature. It's really nice and helps me having a nice and tidy report. Unfortunately, every test.step() even the one in Typescript decorator are showing code snippets.This results in a weird and messy report at the end.
I'm suggesting to add a parameter whether to decide if we want it or not in the HTML report. Or disable the code snippets for
test.step
by defaultExample
This example show the wrong behavior. The right example would be just a dropdown with the step name in it

Motivation
I think
test.step
is a great feature for keeping an HTML report tidy, without using any BDD/Cucumber methods in the project. But with the code displayed, it looks a bit complicated and unreadable, which defeats the whole purpose of the feature.The text was updated successfully, but these errors were encountered: