Betterment / alchemist

A Flutter tool that makes golden testing easy.
MIT License
268 stars 36 forks source link

Call setUp Method between GoldenTestScenario #102

Closed jamontes79 closed 1 year ago

jamontes79 commented 1 year ago

Is there a way to call the setUp method between GoldenTestScenario inside the same GoldenTestGroup?

Example:

 group('Golden Tests', () {
     setUp(() {
           ... some stuff
     });

   goldenTest(
      'name',
      fileName: 'fileanme',
      pumpBeforeTest:  precacheImages,
      builder: () {
        return GoldenTestGroup(
          children: [
            GoldenTestScenario(
              name: 'Secenario 1',
              child: Container(),
            ),       
          GoldenTestScenario(
              name: 'Secenario 2,
              child: Container(),
            ),
          ],
        );
      },
    );
});

I would like to have the following calls:

Thanks in advance and thanks for the library :)