Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleanup rename of google example

  • Loading branch information...
commit df1d60787d3066a9fc23cd454fc1d0bd9ab3efcf 1 parent b97485d
@bfaloona authored
Showing with 0 additions and 337 deletions.
  1. +0 −8 examples/search/config/config.yml
  2. +0 −4 examples/search/config/environments.yml
  3. +0 −12 examples/search/lib/init/site_start.rb
  4. +0 −23 examples/search/lib/init/spec_initialize.rb
  5. +0 −10 examples/search/lib/initialize.rb
  6. +0 −14 examples/search/lib/methods/login.rb
  7. +0 −21 examples/search/lib/methods/search.rb
  8. +0 −18 examples/search/lib/pages/home_page.rb
  9. +0 −19 examples/search/lib/pages/login_page.rb
  10. +0 −15 examples/search/lib/search.rb
  11. +0 −16 examples/search/lib/steps/search_steps.rb
  12. +0 −13 examples/search/lib/steps/world.rb
  13. +0 −3  examples/search/rakefile
  14. +0 −5 examples/search/script/console
  15. +0 −1  examples/search/script/console.cmd
  16. +0 −14 examples/search/script/destroy
  17. +0 −14 examples/search/script/generate
  18. +0 −12 examples/search/test/features/feature_helper.rb
  19. +0 −5 examples/search/test/features/search.feature
  20. +0 −20 examples/search/test/specs/failed_login_spec.rb
  21. +0 −35 examples/search/test/specs/home_page_spec.rb
  22. +0 −30 examples/search/test/specs/login_page_spec.rb
  23. +0 −18 examples/search/test/specs/search_spec.rb
  24. +0 −7 examples/search/test/specs/spec_helper.rb
View
8 examples/search/config/config.yml
@@ -1,8 +0,0 @@
-browser: firefox
-visible: true
-speed: fast
-attach: false
-bring_to_front: false
-leave_open: true
-driver: watir
-site: search
View
4 examples/search/config/environments.yml
@@ -1,4 +0,0 @@
-test:
- url: http://google.com
-staging:
- url:
View
12 examples/search/lib/init/site_start.rb
@@ -1,12 +0,0 @@
-# This file is autogenerated. Do not edit this file.
-# It may be replaced when you upgrade to new versions of watircraft.
-
-require 'initialize'
-require 'search'
-
-SITE = Search::Search.new
-at_exit {SITE.close}
-
-require 'spec/expectations'
-START = SITE.execution_context
-START.extend Spec::Expectations
View
23 examples/search/lib/init/spec_initialize.rb
@@ -1,23 +0,0 @@
-# This file is autogenerated. Do not edit this file.
-# It may be replaced when you upgrade to new versions of watircraft.
-
-require 'init/site_start'
-require 'spec'
-require 'mocha'
-begin
- # Needed for rspec 1.2.x. (Allows "ruby" to run specs.)
- # But not available before that.
- require 'spec/autorun'
-rescue LoadError
- nil
-end
-
-Spec::Runner.configure do |config|
- config.mock_with :mocha
- config.before(:all) do
- SITE.initialize_context!(self)
- end
- config.before(:each) do
- SITE.initialize_context!(self)
- end
-end
View
10 examples/search/lib/initialize.rb
@@ -1,10 +0,0 @@
-# This file is autogenerated. Do not edit this file.
-# It may be replaced when you upgrade to new versions of watircraft.
-
-# Generated at Wed Dec 30 19:39:22 -0800 2009
-# Generated by watircraft 0.5.0
-
-ENV['ENVIRONMENT'] ||= "test"
-APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) unless defined?(APP_ROOT)
-
-require 'watircraft'
View
14 examples/search/lib/methods/login.rb
@@ -1,14 +0,0 @@
-module Search
- module Methods
-
- def login(email, password)
- login_page.email_textbox = email
- login_page.password_textbox = password
- login_page.sign_in_button.click
- end
-
- def logged_in?
- true if browser.text.match(/sign out/i)
- end
- end
-end
View
21 examples/search/lib/methods/search.rb
@@ -1,21 +0,0 @@
-module Search
- module Methods
-
- def search(query)
- home_page.search_textbox = query
- home_page.google_search_button.click
- sleep 0.5
- end
-
- # hash of results {text => href}
- def results
- result_links = browser.links.select{ |link| link.class_name == 'l' }
- ret = {}
- result_links.each do |link|
- ret[link.text] = link.href
- end
- ret
- end
-
- end
-end
View
18 examples/search/lib/pages/home_page.rb
@@ -1,18 +0,0 @@
-require 'rubygems'
-require 'taza/page'
-
-module Search
- class HomePage < ::Taza::Page
-
- url '/'
-
- field(:search_textbox){ browser.text_field( :name, 'q')}
-
- element(:google_search_button){ browser.button( :name, 'btnG')}
- element(:privacy_link){ browser.link( :href, /^\/intl\/.+?\/privacy.html/)}
-
- # appears only when logged in
- element(:left_navigation_div){ browser.div( :id, 'full_nav')}
-
- end
-end
View
19 examples/search/lib/pages/login_page.rb
@@ -1,19 +0,0 @@
-require 'rubygems'
-require 'taza/page'
-
-module Search
- class LoginPage < ::Taza::Page
-
- url 'accounts/Login'
-
- field(:email_textbox){ browser.text_field( :id, 'Email')}
- field(:password_textbox){ browser.text_field( :id, 'Passwd')}
-
- element(:sign_in_button){ browser.button( :name, 'signIn')}
- element(:privacy_link){ browser.link( :href, /\/intl\/.+?\/privacy.html$/)}
-
- # appears only when password error is displayed
- element(:password_error_message){ browser.div( :id, 'errormsg_0_Passwd')}
-
- end
-end
View
15 examples/search/lib/search.rb
@@ -1,15 +0,0 @@
-require 'rubygems'
-require 'taza'
-
-module Search
- include ForwardInitialization
-
- class Search < ::Taza::Site
-
- # Sets @browser to be a browser initialized for testing your site.
- def initialize_browser
- super # configure the browser based on the configuration settings
- end
-
- end
-end
View
16 examples/search/lib/steps/search_steps.rb
@@ -1,16 +0,0 @@
-require 'spec'
-$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/..')
-require 'search'
-
-Then /^I search for '(.*?)'$/ do |search_term|
- search(search_term)
-end
-
-Then /^I should find '(.*?)'$/ do |result_term|
- found = false
- puts result_term
- results.each do |text, href|
- found = true if text.match(/#{result_term}/)
- end
- fail "The text #{result_term} did not appear in the text of any result links" unless found
-end
View
13 examples/search/lib/steps/world.rb
@@ -1,13 +0,0 @@
-# This file is autogenerated. Do not edit this file.
-# It may be replaced when you upgrade to new versions of watircraft.
-
-require 'rubygems'
-require 'spec'
-require 'cucumber'
-
-$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/..')
-require 'init/site_start'
-
-World do
- START
-end
View
3  examples/search/rakefile
@@ -1,3 +0,0 @@
-require 'rubygems'
-require 'taza/tasks'
-
View
5 examples/search/script/console
@@ -1,5 +0,0 @@
-#!/usr/bin/env ruby
-APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
-requires = %w(irb/completion watir/irb-history init/site_start pp)
-puts "Type 'irb START' at the prompt."
-exec "irb.bat -I #{APP_ROOT}/lib -r #{requires.join " -r "} --simple-prompt --readline"
View
1  examples/search/script/console.cmd
@@ -1 +0,0 @@
-@ruby script/console %*
View
14 examples/search/script/destroy
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
-
-begin
- require 'rubigen'
-rescue LoadError
- require 'rubygems'
- require 'rubigen'
-end
-require 'rubigen/scripts/destroy'
-
-ARGV.shift if ['--help', '-h'].include?(ARGV[0])
-RubiGen::Base.use_component_sources! [:watircraft, :test_unit]
-RubiGen::Scripts::Destroy.new.run(ARGV)
View
14 examples/search/script/generate
@@ -1,14 +0,0 @@
-#!/usr/bin/env ruby
-APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
-
-begin
- require 'rubigen'
-rescue LoadError
- require 'rubygems'
- require 'rubigen'
-end
-require 'rubigen/scripts/generate'
-
-ARGV.shift if ['--help', '-h'].include?(ARGV[0])
-RubiGen::Base.use_component_sources! [:watircraft, :test_unit]
-RubiGen::Scripts::Generate.new.run(ARGV)
View
12 examples/search/test/features/feature_helper.rb
@@ -1,12 +0,0 @@
-# This file is autogenerated. Do not edit this file.
-# It may be replaced when you upgrade to new versions of watircraft.
-
-require 'rubygems'
-
-library = File.expand_path(File.dirname(__FILE__) + '/../../lib')
-$LOAD_PATH.unshift library
-require 'initialize'
-require 'cucumber'
-
-step_libs = Dir.chdir(library) {Dir["steps/*.rb"]}
-step_libs.each {|f| require f}
View
5 examples/search/test/features/search.feature
@@ -1,5 +0,0 @@
-Feature: Search google
-
- Scenario: Search for watircraft
- When I search for 'watircraft'
- Then I should find 'bret'
View
20 examples/search/test/specs/failed_login_spec.rb
@@ -1,20 +0,0 @@
-$LOAD_PATH.unshift File.dirname(__FILE__) unless
- $LOAD_PATH.include? File.dirname(__FILE__)
-require 'spec_helper'
-
-describe "Failed Login" do
-
- before :each do
- login_page.goto
- end
-
-
- it "should display an error message when username or password are incorrect" do
- logged_in?.should be_nil
- login('foo', 'bar')
- logged_in?.should be_nil
- end
-
-
-
-end
View
35 examples/search/test/specs/home_page_spec.rb
@@ -1,35 +0,0 @@
-$LOAD_PATH.unshift File.dirname(__FILE__) unless
- $LOAD_PATH.include? File.dirname(__FILE__)
-require 'spec_helper'
-
-describe "Home Page" do
-
- before :all do
- home_page.goto
- end
-
- it "should display the copyright" do
- browser.text.should match(/©#{Time.now.year}\b/)
- end
-
- it "should have a privacy link" do
- home_page.privacy_link.should exist
- end
-
- it "should not have a left navigation div" do
- # this can be useful to verify that configurable objects do not exist
- home_page.left_navigation_div.should_not exist
- end
-
- it "should have an empty search box" do
- home_page.search_textbox.should == ''
- end
-
- it "should have a search box" do
- # to get the builtin element object of this field
- # reference the _field object
- home_page.search_textbox_field.should be_enabled
- end
-
-
-end
View
30 examples/search/test/specs/login_page_spec.rb
@@ -1,30 +0,0 @@
-$LOAD_PATH.unshift File.dirname(__FILE__) unless
- $LOAD_PATH.include? File.dirname(__FILE__)
-require 'spec_helper'
-
-describe "Login Page" do
-
- before :all do
- login_page.goto
- end
-
-
- it "should display the copyright" do
- browser.text.should match(/©#{Time.now.year}\b/)
- end
-
- it "should have a privacy link" do
- login_page.privacy_link.should exist
- end
-
- it "should not have a password error message" do
- login_page.password_error_message.should_not exist
- end
-
- it "should have empty email and password textboxs" do
- login_page.email_textbox.should == ''
- login_page.password_textbox.should == ''
- end
-
-
-end
View
18 examples/search/test/specs/search_spec.rb
@@ -1,18 +0,0 @@
-$LOAD_PATH.unshift File.dirname(__FILE__) unless
- $LOAD_PATH.include? File.dirname(__FILE__)
-require 'spec_helper'
-
-require 'pp'
-
-describe "Search" do
-
- before :all do
- home_page.goto
- end
-
- it "should find what I search for" do
- search('watircraft')
- browser.text.should match(/bret/)
- end
-
-end
View
7 examples/search/test/specs/spec_helper.rb
@@ -1,7 +0,0 @@
-# This file is autogenerated. Do not edit this file.
-# It may be replaced when you upgrade to new versions of watircraft.
-
-require 'rubygems'
-
-$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../../lib/')
-require 'init/spec_initialize'
Please sign in to comment.
Something went wrong with that request. Please try again.