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
hiding "technical" tests in report #471
Comments
One way would be to just use standard mechanism of JUnit for this. |
Hmmm... I do not use JUnit :( |
What I basically meant was that you can execute test code outside of JGiven. That way it will also not appear in the report. In TestNG this could be done with a method annoted with @BeforeTest. |
Yes I know that the @Before/@after methods are not reported.
|
@adrian-herscu wouldn't it be possible to just define these technical tests as a JGiven test step and then make use of the |
For simple cases that is the correct approach.
These are 3 different interfaces to juggle between including actions and verifications. |
I am thinking about changing the current JGiven reporting mechanism to recognize @hidden annotation on test methods to and just ignore these for reporting purposes. |
@adrian-herscu might not be the worst idea. In a sense. Having |
Hi, |
I started to look into ScenarioExecutor but found it too complex to override its behavior... |
I will take a look into it this week and hopefully come up with a suggestion for you |
Hi @adrian-herscu, However, I just tried to run a test within a JGiven Scenario that doesn't make use of the |
Hmmm... Issue is that all our actions and verifications are coded as JGiven
steps :(
...or, maybe that I am missing your intention "doesn't make use of the given,
when, then methods" ?
בתאריך יום ב׳, 13 ביולי 2020 ב-18:25 מאת Kristof <
notifications@github.com>:
… Hi,
I finally had got to look into the code. It seems you are right. In hide
tests via an annotation, one would have to add changes in ScenarioExecutor
, ScenarioModelBuilder and others.
However, I just tried to run a test within a JGiven Scenario that doesn't
make use of the given, when, then methods. I found that this test did not
appear in the JGiven report, while still being executed.
This actually sounds like the solution you desire, doesn't it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#471 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAW3SQOKHLDC7LSOZXUV5RLR3MRP7ANCNFSM4OARRTVQ>
.
|
That is very unfortunate... |
So, I have checked whether tests are not reported if you mark all their test steps as hidden. They do. |
Sometimes there are tests which exist only to initiate some state but they are not the focus.
For example, logging-in is required by all scenarios in an application and there also might be a dedicated LoginTest class, however the login itself is just some technicality for most scenario methods and we would like to keep it hidden in the test report.
Sometimes this can be solved with @before... stuff, but sometimes it requires too much tricks and doing it in a separate test method upon which others depend is much simpler.
Can it be done with current library? Any direction about where I need to look in order to implement such thing myself?
The text was updated successfully, but these errors were encountered: