Appium Python behave 自动化测试框架搭建(2) - behave 知识准备

来源:互联网 发布:大数据培训机构 编辑:程序博客网 时间:2024/06/06 09:29
  1. behave 知识准备
    BDD
    Behavior-driven development (or BDD) is an agile software development technique that encourages collaboration between developers, QA and non-technical or business participants in a software project.

behave uses tests written in a natural language style, backed up by Python code.
BDD是一个敏捷软件开发技术旨在鼓励开发人员,QA和非技术和商业合作者共同的努力
behave 用自然语言风格编写测试代码,基于Python语言

Gherkin
http://pythonhosted.org/behave/gherkin.html
example:
新建一个features/文件夹,创建一个文件example.feature
Scenario: Replaced items should be returned to stock
Given that a customer buys a blue garment
and I have two blue garments in stock
but I have no red garments in stock
and three black garments in stock.
When he returns the garment for a replacement in black,
then I should have three blue garments in stock
and no red garments in stock,
and two black garments in stock.

0 0