1

The duplicate post reference helped me solve the issue, but now I see the setup being counted as a test scenario in 1.3.0. Moving to 1.3.1 has fixed that issue as well, but the @setup reference only shows on the first scenario, and no further entries, along with no background reference, but the background shows in subsequent tests. Is this expected? @setup vs background reference in final report

mike
  • 383
  • 1
  • 12

1 Answers1

0

Yes. The Background does not apply to the @setup as explained in the design.

And the @setup body will appear only once. It could possibly be duplicated in the report, but right now that's how it is implemented. This should normally not be a concern because the point of the @setup is to move some setup logic out of the actual business flow you are testing.

Code contributions are welcome to improve how it works.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • So should the background step appear in the steps list of the first scenario item rather than just the subsequent ones, since I believe it is being executed as a part of the first run itself? – mike Mar 30 '23 at 18:21
  • @mike opened an issue: https://github.com/karatelabs/karate/issues/2290 – Peter Thomas Mar 31 '23 at 04:46