上一篇博文中我们已经在package.json中写入了cucumber依赖库,在执行 npm install 之后,cucumber就已经下载好了。接下来要做的是修改conf.js,请参考下图:

Protractor-引入Cucumber

去年我搭这个框架的时候,如果要引入Cucumber,只需要将framework设置为cucumber即可。但是Protractor做了更改,此处需要设置为custom,并且需要增加frameworkPath这一项,这就是我去年搭建的框架跑不起来的原因。

 

下面我们以在亚马逊上搜索一本书为例子来编写featrue和实现步骤。

新建一个featrue文件,例如amazonTest.feature

1 Feature: Search book
2 
3   Scenario: Search a book
4     Given I open Amazon website
5     When I search book "Agile Estimating and Planning"
6     Then I should see the book "Agile Estimating and Planning" in search result
amazonTest.feature

相关文章:

  • 2021-11-24
  • 2022-01-14
  • 2021-08-25
  • 2022-01-17
  • 2021-09-21
  • 2022-12-23
猜你喜欢
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2021-06-29
  • 2021-10-23
相关资源
相似解决方案