[Question] Add annotations to skipped tests
See original GitHub issueA bit of background on https://github.com/microsoft/playwright/issues/9348#issuecomment-1293387867
tldr: I’d need to add annotations to skipped/fixme tests (test.skip(...)
/ test.fixme(...)
) but cannot figure out how. I’m using a fixture that basically (automatically) adds:
...
test.info().annotations.push({ type: "key", description: key });
...
…but fixtures are not run for skipped tests? (right?). How would I go about this? at what point of the test lifecycle could I inject this info so that it is available to a downstream reporter?
Why do I need this? because otherwise I lack this key annotation when importing results into a (popular) test management framework, producing either errors or suboptimal reporting.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Adding own annotation to dynamic skip test in TestNG
You can check your own annotation in a setup method ( @BeforeMethod ) and throw a SkipException to skip this test.
Read more >7. Incomplete and Skipped Tests — PHPUnit 9.5 Manual
A test can have multiple @requires annotations, in which case all requirements need to be met for the test to run.
Read more >Skip Exception Test in TestNG - Selenium Easy
We can use Skip exception in testng to skip a test. ... In TestNG, @Test(enabled=false) annotation is used to skip a test case...
Read more >JUnit Ignore Test Cases: JUnit 4 @Ignore Vs JUnit 5 @Disabled
The JUnit 4 @Ignore annotation could be applied for a test method, to skip its execution. In this case, you need to use...
Read more >TestNG Test Case Priority And Sequence - Tools QA
Let's see the following code meant to skip the test CloseAccount. import org.openqa.selenium.WebDriver; import org.testng.annotations.Test; import org.openqa ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Somehow related, some time ago I’ve made this junit-processor that can be useful for some situations (e.g., removing tests marked as skipped for example); it’s a post-processing utility.
Looks like there’s a good discussion and no action point for the playwright team; closing!
Please feel free to re-file if you think we still can be helpful!