使用Cucumber量角器集成生成骨架

时间:2016-08-03 15:46:44

标签: protractor cucumber

我正在尝试通过运行protractor conf.js文件生成Step defination骨架。 我需要在Protractor中实现BDD。

conf.js

exports.config = {
  directConnect: true,
  capabilities: {
    'browserName': 'chrome'
  },
  framework: 'custom',
  frameworkPath: require.resolve('protractor-cucumber-framework'),
  specs: ['features /*.feature'],
  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
};

功能文件

@tag1
Feature: Add Numbers
  As a user of the calculator
  I want to add 2 numbers

  @tag2
  Scenario: Add 2 small numbers
    Given the calculator is cleared
    When I add 5 and 6
    Then the result should be 11

1 个答案:

答案 0 :(得分:0)

您必须格式化巡视要素文件文本,如下所示。然后,如果您运行conf.js文件,您将看到步骤。

@ TAG1

功能:添加数字作为计算器的用户,我想添加2个数字

@ TAG2

场景:添加2个小号

Given the calculator is cleared
When I add 5 and 6
Then the result should be 11