当前位置:网站首页>第三方工具与框架集成
第三方工具与框架集成
2022-06-29 18:29:00 【是乔乔啊】
敏捷开发测试概念介绍
BDD:行为驱动开发,也称验收测试驱动开发(ATDD)。基于用户Story 敏捷测试或实例化需求。
CI:持续集成框架
基于BDD的测试工具
python中很多工具可以实现BDD,有两个主要的工具是Behave和Lettuce。
Behave
pip install behave
编写feature文件原则:GWT(Given-When-Then)
- Given:设置一个场景执行的前提条件
- When:包含一个场景所要执行的操作
- Then:包含一个场景执行后的结果
注:一个场景可以有多个when和then。
step定义
feature文件场景大纲中的step需要分别进行定义。
step定义文件保存在feature文件所在路径的子目录steps下。
例如:
from behave import *
@given('I am on home page')
def step_i_am_on_home_page(context):
context.driver.get("http://demo.magentocommerce.com
/")
@when('I search for {text}')
def step_i_search_for(context, text):
search_field = context.driver.find_element_by_name(
"q")
search_field.clear()
# enter search keyword and submit
search_field.send_keys(text)
search_field.submit()
@then('I should see list of matching products in search
results')
def step_i_should_see_list(context):
products = context.driver.\
find_elements_by_xpath("//h2[@class='product-nam
e']/a")
# check count of products shown in results
assert len(products) > 0
环境配置
运行feature之前,需要创建一个环境配置文件,配置Behave常用配置,以及step之间或step定义文件之间的共享代码。
通常在feature文件目录中新建一个环境配置文件environment.py,添加before_all()和after_all()方法,这两个方法分别在feature执行前和结束后运行。
from selenium import webdriver
def before_all(context):
context.driver = webdriver.Chrome()
def after_all(context):
context.driver.quit()
执行behave
进入bbd文件下,然后执行“behave”命令。
Behave显示三个级别的结果。分别是feature、scenario和step各级别通过和失败的数量。
持续集成Jenkins
Jekins是Java编写的持续集成(CI)服务,起源于Hudson项目。
该服务支持包括git、SVN等各种版本控制工具。
Jekins除了构建软件功能外、还可以用于搭建自动化测试环境。
安装Jenkins
Jenkins安装包下载地址:https://www.jenkins.io/download/
点击next安装即可。
边栏推荐
- Redis bloom filter and cuckoo filter
- Cannot retrieve repository metadata processing records
- 程序员资源推荐指南
- Redis(一)--Redis入门(1)--Redis介绍、安装与启动、常用配置
- 如何使用物联网低代码平台进行服务管理?
- Anaconda安装并配置jupyter notebook远程
- My first experience of remote office | community essay solicitation
- Detailed analysis on the use of MySQL stored procedure loop
- C Primer Plus Chapter 12_ Storage categories, links, and memory management_ Codes and exercises
- Know that Chuangyu has helped the energy industry in asset management and was selected into the 2021 IOT demonstration project of the Ministry of industry and information technology
猜你喜欢

2. 在STM32CubeMX建立的Keil5工程中添加自定义的相关文件
Detailed analysis on the use of MySQL stored procedure loop

Error building sqlsession problem

How to use an oak camera as a webcam?

Anaconda installs and configures jupyter notebook remote

idea怎么使用?

Request header field XXXX is not allowed by access control allow headers in preflight response

Shandong University project training (VIII) design rotation map entry page

Servlet student management system (Mengxin hands-on version)

Adobe Premiere Basics - general operations for editing material files (offline files, replacing materials, material labels and grouping, material enabling, convenient adjustment of opacity, project pa
随机推荐
Notes on spintronics - zhangshufeng
2. how to install MySQL database in Galaxy Kirin offline mode
Redis(一)--Redis入门(1)--Redis介绍、安装与启动、常用配置
对强缓存和协商缓存的理解
Machine learning 7-Support vector machine
面霸篇:MySQL六十六问,两万字+五十图详解!
WBF: new method of NMS post filter frame for detection task?
Usage of BeanUtils property replication
How do I add SmartArt to slides in PowerPoint?
js将秒转换成“2h30min50s”的格式
Dragon canvas animation
Markdown knowledge comes gently
数据分析--时间序列预测
Data warehouse model layered ODS, DWD, DWM practice
Cannot retrieve repository metadata 处理记录
535. encryption and decryption of tinyurl / Jianzhi offer II 103 Minimum number of coins
Know that Chuangyu has helped the energy industry in asset management and was selected into the 2021 IOT demonstration project of the Ministry of industry and information technology
The table ‘table_name‘ is full 异常排查及解决方案
报错[warning] Neural network inference was performed on socket ‘RGB’, depth frame is aligned to socket
源码安装MAVROS