Cucumber 和 QAF BDD2 有什么区别

What is the difference between Cucumber and QAF BDD2

Cucumber 和 QAF bdd 有什么区别,QAF 有哪些功能在 Cucumber 中不可用,哪些功能在 Cucumber 中可用而在 QAF Bdd 中不可用。

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

Gherkin is syntax that cucumber (and QAF as well) understands. BDD2 是 Gherkin 语法的 超集 。这意味着 BDD2 支持所有 gherkin 关键字和结构,并有额外的规定。以下是 BDD2 语法中的附加条款:

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

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

查看更多examples of BDD2

BDD2 看起来像 Gherkin,任何 Gherkin 编辑器都可以理解。但这取决于 运行 人了解和使用其他功能。您可以将 BDD2 与 QAF 或 Cucumber 一起使用。当使用 cucumber QAF-Cucumber 时,cucumber 运行ner 将获得附加语法功能的好处。


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

Both are open source frameworks. Cucumber is more popular and well known while QAF is widely used by different enterprises but not as much popular as compared to cucumber.

Cucumber 专用于使用 Gherkin 实现 BDD。

其中 QAF 支持使用 TestNG 的编码、关键字驱动和 BDD 实现。除了 Gherkin,QAF 还支持 QAF BDD 和 advance QAF BDD2 syntax

Till cucumber 4, java implementation of cucumber was not thread-safe but with cucumber-4 entire architecture of implementation get changed and it started supporting parallel execution with thread safety.

QAF formally known as ISFW was thread safe from beginning and supports scenario level parallel execution.

Cucumber 是 Gherkin 运行ner 可以与 Junit、TestNG 一起使用或独立使用。仅支持小黄瓜语法。黄瓜罐头运行 BDD2QAF-Cucumber

QAF 建立在 TestNG 的基础上,并为 BDD 提供原生的 TestNG 实现。您可以通过使用 QAF-Cucumber

来使用黄瓜 运行ner

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 支持不同的编程语言。

QAF 仅 Java。

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 具有场景生命周期的挂钩。

QAF 支持所有带有附加步骤侦听器的 TestNG 侦听器。除此之外,它还支持 webdriver listener、webelement listener、result updator 和 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 具有预定义的参数类型支持作为方法参数。它还支持自定义类型。对于任何自定义类型,您都需要实施和配置类型注册表。用户需要在步骤定义中使用定义的参数类型。

QAF 原生支持所有复杂类型,包括 Map、List 和任何自定义 类。它还具有自定义参数转换行为的转换支持。在步骤描述中,无论方法参数类型如何,用户都可以为参数占位符自由使用有意义的名称。

Cucumber doesn't support step definition in BDD.

QAF supports new step definition in BDD as well