Skip to content

Instantly share code, notes, and snippets.

@danascheider
Last active May 26, 2018 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danascheider/6f57d9722bf89f9d2f1afd7fd6bdfcaf to your computer and use it in GitHub Desktop.
Save danascheider/6f57d9722bf89f9d2f1afd7fd6bdfcaf to your computer and use it in GitHub Desktop.
Cucumber Ruby Core Issue #153
# This file is found in the features/support directory
require "watir"
require "webdrivers"
require "cucumber"
source "https://rubygems.org"
ruby "2.4.0"
gem "cucumber", "3.1.0"
gem "watir"
gem "webdrivers"
gem "byebug"
GEM
remote: https://rubygems.org/
specs:
backports (3.11.3)
builder (3.2.3)
byebug (10.0.2)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
cucumber (3.1.0)
builder (>= 2.1.2)
cucumber-core (~> 3.1.0)
cucumber-expressions (~> 5.0.4)
cucumber-wire (~> 0.0.1)
diff-lcs (~> 1.3)
gherkin (~> 5.0)
multi_json (>= 1.7.5, < 2.0)
multi_test (>= 0.1.2)
cucumber-core (3.1.0)
backports (>= 3.8.0)
cucumber-tag_expressions (~> 1.1.0)
gherkin (>= 5.0.0)
cucumber-expressions (5.0.18)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
diff-lcs (1.3)
ffi (1.9.23)
gherkin (5.0.0)
mini_portile2 (2.3.0)
multi_json (1.13.1)
multi_test (0.1.2)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
rubyzip (1.2.1)
selenium-webdriver (3.12.0)
childprocess (~> 0.5)
rubyzip (~> 1.2)
watir (6.11.0)
selenium-webdriver (~> 3.4, >= 3.4.1)
webdrivers (3.3.1)
nokogiri (~> 1.6)
rubyzip (~> 1.0)
selenium-webdriver (~> 3.0)
PLATFORMS
ruby
DEPENDENCIES
byebug
cucumber (= 3.1.0)
watir
webdrivers
RUBY VERSION
ruby 2.4.0p0
BUNDLED WITH
1.16.2
# This file is found in the features directory
Feature: Figure out issue 153
Scenario: Search for something
Given I have entered "foo" into the query
When I click "Google Search"
Then I should see some results
# This file is found in the features/step_definitions directory
Given /^I have entered "([^"]*)" into the query$/ do |term|
@browser ||= Watir::Browser.new :firefox
@browser.goto "google.com"
@browser.text_field(:name => "q").set term
end
When /^I click "([^"]*)"$/ do |button_name|
@browser.button.click
end
Then /^I should see some results$/ do
@browser.div(:id => "resultStats").wait_until_present
@browser.div(:id => "resultStats").should exist
@browser.close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment