Skip to content

Verifying multiple files in one test #754

@LennysLounge

Description

@LennysLounge

I have some integration tests that generate between one and fives csv files and i want to use approval tests to verify that these files were created correctly.

How can i verify multiple files per test without having to run the test multiple times to get the results of each file?

Right now, if i know multiple files will fail the test, i run the test and the first file will fail. Then i fix it and run the test again when then second file will fail. Then i fix that and continue until all files pass. It would be really nice if i could run the test once and get all errors at once.

Using assertJ i can do that with soft assertions like this:

    @Test
    public void softAssertions(){
        SoftAssertions softly = new SoftAssertions();
        softly.assertThat(true).isFalse();
        softly.assertThat(false).isTrue();
        softly.assertAll();
    }

which gives this error message:

org.assertj.core.api.SoftAssertionError: 
The following 2 assertions failed:
1) 
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>
2) 
Expecting value to be true but was false expected:<[tru]e> but was:<[fals]e>

Is there a way but i don't know about it?
Is this planned at all?

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions