-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Conditional annotations beyond test method/class #4326
Comments
What would be the benefit of doing this rather can using a regular @BeforeAll
fun `do something once`() {
if (someCondition()) {
// some setup
}
}
@BeforeEach
fun `do something every time`() {
if (someCondition()) {
// something to do
}
}
private fun someCondition() = true |
If you would like us to be able to process this issue, please provide the requested information. If the information is not provided within the next 3 weeks, we will be unable to proceed and this issue will be closed. |
It's all about the readability and convention (I like to have single-responsible methods in my test framework). In fact, EnabledIf etc could also be done with an if statement.... |
Team decision: We don't think this would be a good fit with the Jupiter programming model. In light of that, we're closing this issue. However, should there be considerable interest from the community we're happy to reconsider. |
I use JUnit as a runner for tests written in playwright.
For debugging purposes I want to do something only when some condition is met, for example some property is true.
Naturally I went with:
but this is not working - as expected after reading the javadoc.
Is it possible to add such a functionality?
Or maybe there is a different way to handle that?
The text was updated successfully, but these errors were encountered: