Module: RWebSpec

Defined in:
lib/rwebspec-common/core.rb,
lib/rwebspec.rb,
lib/rwebspec-common/popup.rb,
lib/rwebspec-watir/driver.rb,
lib/rwebspec-common/assert.rb,
lib/rwebspec-common/context.rb,
lib/rwebspec-common/web_page.rb,
lib/rwebspec-webdriver/driver.rb,
lib/rwebspec-watir/web_browser.rb,
lib/rwebspec-common/test_script.rb,
lib/rwebspec-common/using_pages.rb,
lib/rwebspec-common/rspec_helper.rb,
lib/rwebspec-common/web_testcase.rb,
lib/rwebspec-webdriver/web_browser.rb,
lib/rwebspec-common/database_checker.rb,
lib/rwebspec-common/load_test_helper.rb,
lib/rwebspec-webdriver/element_locator.rb

Overview

example

should link_by_text(text, options).size > 0

Defined Under Namespace

Modules: Assert, Core, DatabaseChecker, Driver, ElementLocator, LoadTestHelper, Popup, RSpecHelper, TestScript, UsingPages Classes: AbstractWebPage, Assertion, Context, WebBrowser, WebTestCase

Class Method Summary collapse

Class Method Details

.frameworkObject



66
67
68
69
70
71
72
# File 'lib/rwebspec.rb', line 66

def framework
  @_framework ||= begin
    ENV["RWEBSPEC_FRAMEWORK"] 
    # ||= (RUBY_PLATFORM =~ /mingw/ ? "Watir" : "Selenium-WebDriver")
  end
  @_framework
end

.framework=(framework) ⇒ Object



74
75
76
77
78
79
80
# File 'lib/rwebspec.rb', line 74

def framework=(framework)
  old_framework = @_framework
  @_framework = ActiveSupport::StringInquirer.new(framework)
  if (old_framework != @_framework) then
    load_framework
  end
end

.load_frameworkObject



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/rwebspec.rb', line 104

def load_framework
  if @_framework.nil?
    framework
  end

  if RWebSpec.framework =~ /watir/i
    load_watir
    return
  end

  if RWebSpec.framework =~ /selenium/i
     load_selenium
     return
  end

  puts "[WARN] not framework loaded yet"
end

.load_seleniumObject



96
97
98
99
100
101
102
# File 'lib/rwebspec.rb', line 96

def load_selenium
  require 'selenium-webdriver'
  # puts "Loading Selenium"
  load(File.dirname(__FILE__) + "/rwebspec-webdriver/web_browser.rb")
  load(File.dirname(__FILE__) + "/rwebspec-webdriver/driver.rb")
  require File.dirname(__FILE__) + "/extensions/webdriver_extensions"
end

.load_watirObject



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/rwebspec.rb', line 82

def load_watir
  # puts "Loading Watir"
  require 'watir'
  
  if RUBY_PLATFORM =~ /mingw/i
    require 'watir-classic'
  end

  load(File.dirname(__FILE__) + "/rwebspec-watir/web_browser.rb")
  load(File.dirname(__FILE__) + "/rwebspec-watir/driver.rb")
  require File.dirname(__FILE__) + "/extensions/watir_extensions"
  require File.dirname(__FILE__) + "/extensions/window_script_extensions"
end

.versionObject



62
63
64
# File 'lib/rwebspec.rb', line 62

def version
  RWEBSPEC_VERSION
end