Cucumber 错误org.picocontainer.PicoCompositionException:不允许重复密钥。复制品
我试图使用pico容器实现功能级并行执行。 当我在下面的上下文类中使用共享驱动程序时,我得到org.picocontainer.PicoCompositionException:不允许重复密钥。重复Cucumber 错误org.picocontainer.PicoCompositionException:不允许重复密钥。复制品,cucumber,testng,cucumber-jvm,parallel-testing,picocontainer,Cucumber,Testng,Cucumber Jvm,Parallel Testing,Picocontainer,我试图使用pico容器实现功能级并行执行。 当我在下面的上下文类中使用共享驱动程序时,我得到org.picocontainer.PicoCompositionException:不允许重复密钥。重复 你能给你的问题添加完整的堆栈跟踪(并删除任何注释掉的代码)吗? public class Context{ private ThreadLocal<WebDriver> drivers = new ThreadLocal<>(); public vo
你能给你的问题添加完整的堆栈跟踪(并删除任何注释掉的代码)吗?
public class Context{
private ThreadLocal<WebDriver> drivers = new ThreadLocal<>();
public void setDriver(WebDriver wd) {
drivers.set(wd);
}
public WebDriver getDriver() {
return drivers.get();
}
import java.net.MalformedURLException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import cucumber.api.CucumberOptions;
import cucumber.api.testng.CucumberFeatureWrapper;
import cucumber.api.testng.TestNGCucumberRunner;
import net.thumbtack.cucumber.picocontainer.example.step.SharedDriver;
import cucumber.api.testng.*;
@CucumberOptions (glue = {"net.thumbtack.cucumber.picocontainer.example.step"},
features = "src/main/resources/"
,tags = {"@Scenario2,@Scenario3"})
public class TestRunner {
public TestRunner() throws MalformedURLException {
super();
// TODO Auto-generated constructor stub
}
private TestNGCucumberRunner testNGCucumberRunner;
@BeforeClass(alwaysRun = true)
public void setUpClass() throws Exception {
testNGCucumberRunner = new TestNGCucumberRunner(this.getClass());
System.setProperty("ExecEnv","Docker");
}
// @Test(dataProvider = "features")
// public void feature(PickleEventWrapper eventwrapper,CucumberFeatureWrapper cucumberFeature) throws Throwable {
@Test(groups="cucumber", description="Runs CucumberFeature",dataProvider = "features")
public void feature(CucumberFeatureWrapper cucumberFeature){
testNGCucumberRunner.runCucumber(cucumberFeature.getCucumberFeature());
// testNGCucumberRunner.runScenario(eventwrapper.getPickleEvent());
}
@DataProvider(parallel=true)
public Object[][] features() {
return testNGCucumberRunner.provideFeatures();
// return testNGCucumberRunner.provideScenarios();
}
@AfterClass(alwaysRun = true)
public void tearDownClass() throws Exception {
testNGCucumberRunner.finish();
}
}