Perhaps not so much newb, but what I believe should work does not seem 
to... Been trying to debug for hours. Using cucumber/watir I have this:

Feature: Google Search
  In order to find out more about AWTA
  I need to be able to search Google

  Scenario: Google search for AWTA
    Given that I am on the Google homepage
    When I search for AWTA
    Then I should see "Austin Workshop on Test Automation"

And these steps:
require 'watir-webdriver'

BROWSER = Watir::Browser.new :chrome

Given /^that I am on the Google homepage$/ do
  BROWSER.goto("http://google.com";)
end

When /^I search for AWTA$/ do
  BROWSER.text_field(:name, "q").set("AWTA")
  BROWSER.button(:name, "btnG").click
end

Then /^I should see "(.*)"$/ do |query|
  BROWSER.text.include?(query).should == true
  BROWSER.close
end

The problem is that the BROWSER.text.include returns false when the text is 
clearly on the page. Output from the run:
Started ChromeDriver
port=9516
version=26.0.1383.0
log=C:\Development\cuke_demo\chromedriver.log
[4128:4192:0210/181623:ERROR:bluetooth_adapter_win.cc(23)] NOT IMPLEMENTED
Feature: Google Search
  In order to find out more about AWTA
  I need to be able to search Google

  Scenario: Google search for AWTA                         # 
features\google_search.feature:5
    Given that I am on the Google homepage                 # 
features/step_definitions/google_search
.rb:6
    When I search for AWTA                                 # 
features/step_definitions/google_search
.rb:10
    Then I should see "Austin Workshop on Test Automation" # 
features/step_definitions/google_search
.rb:15
      expected: true
           got: false (using ==) 
(RSpec::Expectations::ExpectationNotMetError)
      ./features/step_definitions/google_search.rb:16:in `/^I should see 
"(.*)"$/'
      features\google_search.feature:8:in `Then I should see "Austin 
Workshop on Test Automation"'

Failing Scenarios:
cucumber features\google_search.feature:5 # Scenario: Google search for AWTA

1 scenario (1 failed)
3 steps (1 failed, 2 passed)
0m2.737s

Thanks in advance!

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to