Огурец: неопределенный шаг, хотя шаг определен (Ruby) - PullRequest
0 голосов
/ 29 октября 2018

Я пытаюсь создать простой тестовый сценарий со сценарием файла объектов:

Feature: Amazon Search Functionality

Scenario: Users can search for a specific item on Amazon
    Given a user goes to Amazon
    When they search for "pens"
    Then amazon should return results for "pens"

Код руби для определения шага:

require 'watir-webdriver'
require 'cucumber'

Given(/^a user goes to Amazon$/) do
  @browser= Selenium::WebDriver::Chrome::Profile.new
  @browser.goto "http://www.amazon.com"
end

When(/^they search for "([^"]*)"$/) do |arg|
  @browser.text_field(:id=> "twotabsearchtextbox").set "#{arg}"
  @browser.send_keys: return
end

Then(/^amazon should return results for "([^"]*)"$/) do |arg|
  @browser.div(:id=>"result_2").wait_untill_present
  page_output = @browser.div(:id=> "resultsCol").text.include? "#{arg}"
  assert (page_output=true)
  @browser.close

end

Я получаю вывод: тестирование началось в3:49

C:\Ruby24-x64\bin\ruby.exe -EUTF-8 C:\Ruby24-x64\bin\cucumber C:/Users/rahulpathak01/Desktop/automatedtest/Features/Amazon_search.feature --format Teamcity::Cucumber::Formatter --expand --color -r features
WARNING: The formatter Teamcity::Cucumber::Formatter is using the deprecated formatter API which will be removed in v4.0 of Cucumber.

You can implement step definitions for undefined steps with these snippets:

Given("a user goes to Amazon") do
  pending # Write code here that turns the phrase above into concrete actions
end


You can implement step definitions for undefined steps with these snippets:

When("they search for {string}") do |string|
  pending # Write code here that turns the phrase above into concrete actions
end


You can implement step definitions for undefined steps with these snippets:

Then("amazon should return results for {string}") do |string|
  pending # Write code here that turns the phrase above into concrete actions
end
1 scenario (1 undefined)
3 steps (3 undefined)
0m0.019s

Моя структура папок верна, но rubymine не может найти определения шагов.

Структура папок:

Features
   Step Definitions
        test.rb
   testfeatures.feature
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...