zoukankan      html  css  js  c++  java
  • Cucumber:启动类配置

    Cucumber:启动类配置

    package com.steps;
    
    import cucumber.api.CucumberOptions;
    import cucumber.api.junit.Cucumber;
    import org.junit.runner.RunWith;
    
    /**
     * @author rechin
     * *
     * @RunWith(Cucumber.class) 这是一个运行器 ,指用Cucumber来运行测试
     * @CucumberOptions中的features,用于指定我们项目中要运行的feature的目录
     * @CucumberOptions中的format,用于指定我们项目中要运行时生成的报告,并指定之后可以在target目录中找到对应的测试报告
     * @CucumberOptions中的glue,用于指定项目运行时查找实现step定义文件的目录
     *
     * 在实际项目中,随着项目的进行,一个测试工程可能由多个feature文件组成,并且每个feature文件中可能也是由多个scenario组成。默认情况下,
     * 每次运行是运行所有feature中的所有scenario。这样可能导致正常情况下运行一次测试脚本,需要非常长的时间来等待测试结果。
     * 但是实际过程中,测试用例是有优先级等区分的。比如smokeTest、regressionTest等。或者有时候会有特别小部分的用例,比如等级是critical,
     * 这些用例需要长时间运行来监测系统是否没有白页或者页面404等现象。
     * 所以我们必须区分开所有的scenario,可以使我们在启动测试脚本时,可以根据我们需要来运行哪些模块的scenaro。这时我们可以使用Tags
     * 在Cucumber里Tag是直接在Feature、Scenari或Scenario Outline关键字前给feature或scenario添加任意数量的前缀为@的tags,多个tag用空格来分隔
     */
    
    @RunWith(Cucumber.class)
    @CucumberOptions(
            plugin={"json:target/cucumber/cucumber.json", "html:target/cucumber", "pretty"},
            features={"src/test/resources/com/features/"},
            tags = {"@login,@role"} ) //@~demo
    public class CucumberStart {
    }
  • 相关阅读:
    数据结构实践——败者树归并模拟
    systemctl介绍
    Andriod Atom x86模拟器启动报错。
    (白书训练计划)UVa 11572 Unique Snowflakes(窗体滑动法)
    OpenCV2.3.1在CentOS6.5下的安装
    本学期课程教学要解决这个问题要点备忘录
    firefox浏览器和IE
    [LeetCode] Validate Binary Search Tree
    android性能优化优秀文章
    如何在使用eclipse的情况下,清理android项目中的冗余class文件和资源文件以及冗余图片
  • 原文地址:https://www.cnblogs.com/rechin/p/9406774.html
Copyright © 2011-2022 走看看