黄瓜找不到Ruby步骤定义(windows)

时间:2017-03-22 12:42:03

标签: cucumber

请告诉我为什么功能不使用步骤定义?

1)feature \ test.feature

Feature: guru99 Demopage Login

In order to Login in Demopage we have to enter login details

Scenario: Register On Guru99 Demopage without email

Given I am on the Guru99 homepage

When enter blank details for Register

Then error email shown

2)特征\ step_definitions \ test_steps.rb

require 'watir-webdriver'

require 'colorize'

browser = Watir::Browser.new

Given (/^I am on the Guru99 homepage$/)do

browser.goto "http://demo.guru99.com"

end

When (/^enter blank details for Register$/)do

browser.text_field(:name,"emailid").set(" ")

browser.button(:name,"btnLogin").click

end

Then (/^error email shown$/)do

puts " Email is Required".red

browser.close

end

3)使用ruby

在Start命令提示符下运行
cucumber features\test.feature

Start command prompt with ruby screenshot

1 个答案:

答案 0 :(得分:0)

您的命令看起来像“功能 s ”,而您的文件夹是“功能”,没有结尾“s”。这有帮助吗?