zoukankan      html  css  js  c++  java
  • Cucumber的依赖

    info.cukes cucumber-testng 1.2.5 info.cukes cucumber-jvm-deps 1.0.5 ` info.cukes cucumber-jvm 1.2.5 pom ` info.cukes cucumber-junit 1.2.5 test ` info.cukes cucumber-core 1.2.5 info.cukes cucumber-java 1.2.5 `
    1. 在插件里安装cucumber-java,gherkin,Create TestNG XML(装这个插件后,通过testng运行,就会生成一个.xml的文件)的插件
    2. 在src/test/resources/下建一个Feature.feature的文件夹
    3. 在src/test/下面建一个包,写2个类,一个是定义的,一个是实现的
    4. 运行这个类有2种方法,一种是用testng的方法,需要继承AbstractTestNGCucumberTests
      一种用Junit方法,@RunWith(Cucumber.class)
      取其中一个就好
      package cucumber.runner;
      import cucumber.api.CucumberOptions;
      import cucumber.api.junit.Cucumber;
      import cucumber.api.testng.AbstractTestNGCucumberTests;
      import org.junit.runner.RunWith;

    //@RunWith(Cucumber.class)
    @CucumberOptions(monochrome = true //意味着Cucumber测试的控制台输出更具可读性
    ,features = "src/test/resources/feature/" //.feature的路径
    ,plugin = {"pretty", "html:target/cucumber.html", // 生成html报告的路径
    "json:target/cucumber.json"}
    ,tags = {"@p3"} //执行哪个标签,~@p3是不执行哪个标签
    ,dryRun=true //检查所有步骤是否都有步骤(Step Definition)定义
    ,glue = {"cucumber.steps"}) //执行的steps的包名
    public class RunnerLogin extends AbstractTestNGCucumberTests {

    }

    人生因有期待而美好; 谁不是一边热爱生活,又一边不想活。 学最好的别人,做最好的自己。
  • 相关阅读:
    springboot集成mockito与powermock
    不一样的go语言-玩转语法之二
    不一样的go语言-玩转语法之一
    不一样的go语言-athens源码概览
    不一样的go语言-athens私仓安装
    不一样的go语言-构建系统与构件系统
    不一样的go语言-error
    不一样的go语言-gopher
    jssip中文开发文档(完整版)
    echarts属性的设置(完整大全)
  • 原文地址:https://www.cnblogs.com/peoty/p/14480015.html
Copyright © 2011-2022 走看看