当前位置:网站首页>Third party tools and framework integration
Third party tools and framework integration
2022-06-29 18:57:00 【It's Joe Joe】
Introduction to agile development testing concept
BDD: Behavior driven development , Also known as acceptance test driven development (ATDD). Based on users Story Agile testing or instantiation requirements .
CI: Continuous integration framework
be based on BDD Test tools
python Many of the tools in can implement BDD, There are two main tools Behave and Lettuce.
Behave
pip install behave
To write feature Document principles :GWT(Given-When-Then)
- Given: Set the preconditions for the execution of a scenario
- When: Contains the operations to be performed by a scenario
- Then: Contains the results of a scenario execution
notes : A scene can have multiple when and then.
step Definition
feature File scene outline step It needs to be defined separately .
step The definition file is saved in feature Subdirectory of the path where the file is located steps Next .
for example :
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
Environment configuration
function feature Before , You need to create an environment configuration file , To configure Behave Common configuration , as well as step Between or step Define shared code between files .
Usually in feature Create a new environment configuration file in the file directory environment.py, add to before_all() and after_all() Method , These two methods are respectively in feature Run before and after execution .
from selenium import webdriver
def before_all(context):
context.driver = webdriver.Chrome()
def after_all(context):
context.driver.quit()
perform behave
Get into bbd Under the document , And then execute “behave” command .
Behave Show results at three levels . Namely feature、scenario and step The number of passes and failures at each level .
Continuous integration Jenkins
Jekins yes Java Write continuous integration (CI) service , Come of Hudson project .
The service support includes git、SVN And other version control tools .
Jekins In addition to building software functions 、 It can also be used to build an automated test environment .
install Jenkins
Jenkins Installation package download address :https://www.jenkins.io/download/
Click on next Can be installed .
边栏推荐
猜你喜欢

centos 7.5安装mysql 8.0.27----yum

龙canvas动画

网站加了CDN后,字体图标报错Access-Control-Allow-Origin

程序员值得收藏的几款代码截图美化工具播

数据仓库模型分层ODS、DWD、DWM实战

Notes on spintronics - zhangshufeng

JS text particle dynamic background

对强缓存和协商缓存的理解
![Error [warning] neural network information was performed on socket 'RGB', depth frame is aligned to socket](/img/8a/ebad75daa581e22d50dddde49e1fac.jpg)
Error [warning] neural network information was performed on socket 'RGB', depth frame is aligned to socket

CentOS 7.5 install MySQL 8.0.27---yum
随机推荐
踩坑记:JSON.parse和JSON.stringify
报错[warning] Neural network inference was performed on socket ‘RGB’, depth frame is aligned to socket
Data warehouse model layered ODS, DWD, DWM practice
Failed to allocate graph: myriad device is not opened
selenium的跨浏览器测试
JS converts seconds to "2h30min50s" format
山东大学项目实训(八)设计轮播图进入页面
Several code screenshots beautification tools worth collecting by programmers
PHP implementation of sorting two-dimensional arrays by specified key names
garbage collector
Source code installation mavros
Shandong University project training (VII) add navigation bar to select city
The table ‘table_ Name 'is full exception troubleshooting and solution
What is a multi paradigm programming language and what does "multi paradigm" mean?
Shandong University project training (VI) Click event display line chart
Amazing pandaverse:meta "borderless, to activate fashion attributes in the new journey of 2.0
Selenium的各类API方法
熊猫跑酷js小游戏代码
MySQL 企業級開發規範
Sd6.25 summary of intensive training