reqnroll / Reqnroll

Open-source Cucumber-style BDD test automation framework for .NET.
https://reqnroll.net
BSD 3-Clause "New" or "Revised" License
312 stars 33 forks source link

Parallel execution using Mstest+reqnroll #116

Closed sampath-ganesan closed 2 months ago

sampath-ganesan commented 2 months ago

Reqnroll Version

1.0.1

Which test runner are you using?

MSTest

Test Runner Version Number

MsTest.TestAdapter 3.3.1

.NET Implementation

.NET 8.0

Test Execution Method

Visual Studio Test Explorer

Content of reqnroll.json configuration file

No response

Issue Description

I am trying to run scenarios in parallel execution using mstest while doing that i am facing few issues,

  1. The previous ScenarioStepContext was already disposed, The previous ScenarioContext was already disposed.
  2. while running in 2 threads scenario step details are mixed up with other threads
  3. step name is getting mixed up on the extend report, for some

Steps to Reproduce

  1. set up mstest project with reqnroll and add few basic scenarios and also use extend report
  2. set Parallelize via .runsettings
  3. use StepContext.StepInfo

Note: I also tried

private readonly ScenarioContext scenarioContext;

public SpecflowHooks(ScenarioContext scenarioContext) { this.scenarioContext = scenarioContext; }

And

ScenarioContext.Current.ScenarioInfo

Link to Repro Project

No response

ajeckmans commented 2 months ago

Only feature level parallelization is supported for mstest. See also https://docs.reqnroll.net/latest/execution/parallel-execution.html

sampath-ganesan commented 2 months ago

is there any plan to add this feature which is scenario level parallel execution?

ajeckmans commented 2 months ago

Nothing that is concrete though it is definitely something that is kept in mind.

sampath-ganesan commented 2 months ago

thanks for the info

gasparnagy commented 2 months ago

@sampath-ganesan please also see my comment at #114. I recommend creating an idea discussion item for this.

I close this as by design, we can track this at the discussion item.

sampath-ganesan commented 2 months ago

i am able to open multiple browser with ThreadLocal and again that ScenarioContext is not supporting that ThreadLocal so its getting disposed after first scenario completes on that thread

gasparnagy commented 2 months ago

@sampath-ganesan please make a separate issue for that