gauge-java icon indicating copy to clipboard operation
gauge-java copied to clipboard

Gauge.captureScreenshot() ignores user specified ClassInstanceManager

Open ZhyliaievD opened this issue 4 years ago • 2 comments

We run each scenario in its own Spring context, therefore we have unique ClassInitializer(based on Spring ApplicationContext) and unique instance of CustomScreenshot for each scenario. Current Gauge.captureScreenshot() implementation has single ClassInstanceManager instance across all scenarios

Expected behavior

I should be able to take screenshots via Gauge.captureScreenshot() when if I have unique CustomScreenshot per scenario

Actual behavior

Gauge.captureScreenshot() uses wrong CustomScreenshot instances due to incorrect ClassInitializer. Screenshots are taken for wrong scenario

Steps to reproduce

  1. Set unique ClassInitializer BeforeScenario using ClassInstanceManager.setClassInitializer()
  2. Run tests in parallel
  3. Check screenshots

ZhyliaievD avatar Oct 08 '20 12:10 ZhyliaievD

+1

Korop avatar Oct 12 '20 07:10 Korop

@ZhyliaievD Could you please provide a very basic sample project which I can use to replicate this issue? I'm afraid I do not have good knowledge about spring, so it would a bit difficult and time-consuming to replicate this.

Also, I see that you raised aPR for the very same issue and then closed it, were you able to fix the issue in the PR?

BugDiver avatar Oct 12 '20 12:10 BugDiver