使用Cucimber-jvm 1.2.5,我仍然会收到“ cucumber.runtime.CucumberException:不是Map或List类型:class java.lang.String”“

时间:2019-01-28 23:17:47

标签: java cucumber rest-assured

我仍然收到带有Cucimber-jvm 1.2.5的“ cucumber.runtime.CucumberException:不是Map或List类型:class java.lang.String”。

这是POM.XML,它显示了黄瓜,放心的,微微容器的依赖性。我已经尝试过1.2.3,1.2.4,1.2.5版本,并且仍然相同。问题是我一直在从一个错误转移到另一个错误,但是如果我使用绿皮胡瓜-jvm,问题就会消失。但是由于某些原因,库又无法进入我的特征文件。

    <dependency>
          <groupId>io.rest-assured</groupId>
          <artifactId>rest-assured</artifactId>
          <version>3.0.0</version>
          <scope>test</scope>`enter code here`
        </dependency>

        <dependency>
          <groupId>io.rest-assured</groupId>
          <artifactId>json-path</artifactId>
          <version>3.0.0</version>
        </dependency>

        <dependency>
          <groupId>io.rest-assured</groupId>
          <artifactId>xml-path</artifactId>
          <version>3.0.0</version>
        </dependency>

        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit-dep</artifactId>
          <version>4.11</version>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>info.cukes</groupId>
          <artifactId>cucumber-java8</artifactId>
          <version>1.2.5</version>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>info.cukes</groupId>
          <artifactId>cucumber-junit</artifactId>
          <version>1.2.3</version>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>info.cukes</groupId>
          <artifactId>cucumber-picocontainer</artifactId>
          <version>1.2.4</version>
          <scope>test</scope>
        </dependency>

这是使用其抱怨的数据表的Step lambda方法之一:

Given("^The Header is set to the following$", (DataTable headerDataTable) -> {

            Map<String, String> headerData = headerDataTable.asMap(String.class, String.class);

            Set<String> keys = headerData.keySet();

            for (String key : keys) {

                buildHeaders.addToHeaderMap(key, headerData.get(key));

            }

        });

这里是例外:

@ scenario_404   场景:发布具有错误凭据的帖子,并验证响应代码404#SocialPost.feature:5     给定标题设置为以下#SocialPostSteps.java:44     然后,路径设置为紧随其后,帐户ID为“ 123”,文本为“ Social PostSteps.java:58”。       banana.runtime.CucumberException:不是Map或List类型:类java.lang.String         在黄瓜。运行时。表.TableConverter.convert(TableConverter.java:75)         在黄瓜。运行时.StepDefinitionMatch.tableArgument(StepDefinitionMatch.java:95)         在黄瓜。运行时.StepDefinitionMatch.transformedArgs(StepDefinitionMatch.java:74)         在黄瓜。运行时.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)         在Cucumber.runtime.Runtime.runStep(Runtime.java:299)         在黄瓜。运行时模型.StepContainer.runStep(StepContainer.java:44)         在cumul.runtime.model.StepContainer.runSteps(StepContainer.java:39)         在cumul.runtime.model.CucumberScenario.run(CucumberScenario.java:44)         在Cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)         在Cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)         在Cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)         在org.junit.runners.ParentRunner $ 3.run(ParentRunner.java:238)         在org.junit.runners.ParentRunner $ 1.schedule(ParentRunner.java:63)         在org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)         在org.junit.runners.ParentRunner.access $ 000(ParentRunner.java:53)         在org.junit.runners.ParentRunner上$ 2.evaluate(ParentRunner.java:229)         在org.junit.runners.ParentRunner.run(ParentRunner.java:309)         在Cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)         在Cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)         在Cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)         在org.junit.runners.ParentRunner $ 3.run(ParentRunner.java:238)         在org.junit.runners.ParentRunner $ 1.schedule(ParentRunner.java:63)         在org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)         在org.junit.runners.ParentRunner.access $ 000(ParentRunner.java:53)         在org.junit.runners.ParentRunner上$ 2.evaluate(ParentRunner.java:229)         在org.junit.runners.ParentRunner.run(ParentRunner.java:309)         在Cucumber.api.junit.Cucumber.run(Cucumber.java:98)         在org.junit.runners.Suite.runChild(Suite.java:127)         在org.junit.runners.Suite.runChild(Suite.java:26)         在org.junit.runners.ParentRunner $ 3.run(ParentRunner.java:238)         在org.junit.runners.ParentRunner $ 1.schedule(ParentRunner.java:63)         在org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)         在org.junit.runners.ParentRunner.access $ 000(ParentRunner.java:53)         在org.junit.runners.ParentRunner上$ 2.evaluate(ParentRunner.java:229)         在org.junit.runners.ParentRunner.run(ParentRunner.java:309)         在org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:55)         在org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137)         在org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:107)         在org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:83)         在org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75)         在org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:158)         在org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)         在org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)         在org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)         在org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)

0 个答案:

没有答案