cucumber+feature+springBoot实现UI自动化测试
整合目标
本文对Cucumber、feature、spring boot 它们的基本使用和概念就不做解释了,本文主要将它们在项目中进行整合使用,因此在通过spring boot框架开发项目的时候,又能通过 cucumber编写测试用例对项目测试。
1.前提要求
整合之前需要你自己在本地搭建起spring boot项目环境,网上关于spring boot项目搭建很多资料,不明白自行单独解决
2.cucumber和springBoot整合目录
3. idea安装cucumber插件
4.pom.xml导入Cucumber相关jar包
去博客设置页面,选择一款你喜欢的代码片高亮样式,下面展示同样高亮的 代码片
.
// 请在springBoot项目主目录中的pom.xml(前提通过maven构建项目)中导入cucumber相关的jar包
<!-- 依赖cucumber-->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java8</artifactId>
<version>3.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-spring</artifactId>
<version>3.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>