Skip to content
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

reporting test scenario with multiple cases #1173

Open
adrian-herscu opened this issue Jan 24, 2023 · 7 comments
Open

reporting test scenario with multiple cases #1173

adrian-herscu opened this issue Jan 24, 2023 · 7 comments

Comments

@adrian-herscu
Copy link

Sometimes cases are rendered as a table and sometimes the scenario is repeated for each case.
Any suggestion(s) about how to control this behavior?

@l-1squared
Copy link
Collaborator

Does that actually happen at random? 😦 Because test cases should always render as table...

@adrian-herscu
Copy link
Author

adrian-herscu commented Jan 26, 2023

    @DataProvider(parallel = true)
    public static Object[][] cutoffTimesPerNetwork() {
        return new Object[][] {
            { "Star", LocalTime.of(16, 59, 59) },
            { "NYCE", LocalTime.of(14, 29, 59) },
            { "Pulse", LocalTime.of(23, 59, 59) },
           ...
        };
    }

    @Reference("882016")
    @Test(dataProvider = "cutoffTimesPerNetwork")
    // ISSUE see https://github.com/TNG/JGiven/issues/1173
    public void shouldAllowAfterNetworkCutoffTransaction(
        final String network,
        final LocalTime cutoffTime) {
        given()
         ...

Is rendered like this:
image

@adrian-herscu
Copy link
Author

Found that there was a @CasesAsTable annotation -- https://github.com/TNG/JGiven/blob/master/CHANGELOG.md

In my report JSON it appears like this:
image

@l-1squared
Copy link
Collaborator

Interesting. I will have a look at that once I got that java 11 upgrade going. Those broken PRs bother me a lot.

@l-1squared
Copy link
Collaborator

Hi @adrian-herscu , so I have found this neat little method


I would assume that it may be the culprit for setting that value erroneously. Could you support me by providing the actual test case that produces the udesired behavior (or an equivalent abstraction).
Please note that the CaseArgument analyzer wants the amount of words to be equal, the number of attachemnts to be comparable, the words to be the same and the steps to be equal.

@l-1squared
Copy link
Collaborator

Hi @adrian-herscu could you please provide additional informaition on the subject?
Otherwise I'll have to close this issue as there is nothing with which I can help.

@adrian-herscu
Copy link
Author

adrian-herscu commented Feb 21, 2023

In same project I have a test class which is reported as a table while others are reported as separated cases. Unfortunately, I have not enough time now to simplify them as you would expect :(
You may close this issue for now, and when, and if, it will become critical for me then I will get back to it.

This one produces a table:
https://github.com/QA-Automation-Starter/qa-automation/blob/main/qa-testing-example/src/test/java/dev/aherscu/qa/testing/example/scenarios/tutorial3/TestingWebWithJGiven.java

However, it derives from other class. Its steps are also deriving from other classes. So producing a clean example is not a one minute task.

The other test classes which report separate cases look similar but work over REST. They are part of my current work project, so even harder to cleanup :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants