1

Cucumber 和 QAF bdd 有什么区别,QAF 有哪些 Cucumber 中没有的功能,以及 Cucumber 中有哪些功能,而 QAF Bdd 中没有。

4

1 回答 1

1

我们先来看看 BDD2 和 Gherkin 的语法:

Gherkin是黄瓜(以及 QAF)理解的语法。BDD2是Gherkin 语法的超集。这意味着 BDD2 支持所有 gherkin 关键字和结构,并有额外的规定。以下是 BDD2 语法中的附加条款:

  • 元数据支持
  • 提供外部数据文件作为示例
  • 参数支持

以下场景是在 BDD2 中编写的:

@smoke @TestcaseId:12345
Scenario:  A scenario is a collection of executable steps of different type

    Given step represents a precondition to an event
    When step represents the occurrence of the event
    Then step represents the outcome of the event

查看BDD2 的更多示例。

BDD2 看起来像 Gherkin,任何 Gherkin 编辑器都可以理解它。但这取决于跑步者理解和使用附加功能。您可以将 BDD2 与 QAF 或 Cucumber 一起使用。当使用 cucumber QAF-Cucumber将使 cucumber runner 获得附加语法功能的好处。


现在让我们看看 Cucumber 和 QAF 的特点。

两者都是开源框架。Cucumber 更受欢迎和知名度更高,而 QAF 被不同的企业广泛使用,但与 Cucumber 相比并没有那么受欢迎。

Cucumber 专用于使用 Gherkin 实现 BDD。

QAF 支持使用 TestNG 进行编码、关键字驱动和 BDD 实现。除了 Gherkin 之外,QAF 还支持 QAF BDD 和高级 QAF BDD2语法。

在 cucumber 4 之前,cucumber 的 java 实现不是线程安全的,但是随着 cucumber-4 的整个实现架构发生了变化,它开始支持线程安全的并行执行。

QAF(正式名称为 ISFW)从一开始就是线程安全的,并且支持场景级别的并行执行。

Cucumber is Gherkin runner 可以与 Junit、TestNG 或独立使用。仅支持 gherkin 语法。Cucumber 可以运行 BDD2 QAF-Cucumber

QAF 建立在 TestNG 之上,并具有 BDD 的原生 TestNG 实现。您可以使用QAF-Cucumber来使用 Cucumber runner

Cucumber doesn't have inbuilt implementation for testing of web,mobile, web-service. Either you need to write your own implementation or use third party framework that supports cucumber. using cucumber for different black box testing needs.

QAF has inbuilt Web, Mobile, WebServices support with different design concepts along with resource and test data management, integration with third party tools (like jira, ALM, QMetry, Rally etc).

Cucumber supports for different programing languages.

QAF is Java only.

Cucumber supports data-driven testing by use of Examples in gherkin syntax.

QAF supports data-driven testing by use of Examples in Gherkin or BDD2 syntax. It also supports External data providers and data-provider interceptor.

Cucumber has hooks for scenario lifecyle.

QAF has support for all TestNG listeners with additional step listener. In addition to that it has support for webdriver listener, webelement listener, result updator and data-provider interceptor.

Till cucumber 4, Step implementation was required to use regular expressions. With Cucumber 4 new way similar to QAF available to get rid of regular expression in step definition.

QAF uses simple and easy way to provide description of step.

Cucumber have predefined Parameter Type support as method arguments. It also supports custom types. For any custom type you need to implement and configure type registry. User need to use defined parameter types in step definition.

QAF natively supports all complex types including Map, List, and any custom classes. It also has transformation support to customize parameter transformation behavior. In step description user is free to use meaningful name for parameter placeholder regardless of method argument type.

Cucumber doesn't support step definition in BDD.

QAF supports new step definition in BDD as well

于 2019-11-23T00:28:51.157 回答