Module: Spec::Watir

Defined in:
lib/spec/ui/watir_helper.rb

Overview

Matchers for Watir::IE/Watir::Safari instances

Defined Under Namespace

Classes: HaveHtml, HaveLink, HaveText, HaveTextField

Instance Method Summary collapse

Instance Method Details

#have_html(text) ⇒ Object

RSpec matcher that passes if @browser#html matches text (String or Regexp)



74
75
76
# File 'lib/spec/ui/watir_helper.rb', line 74

def have_html(text)
  Spec::Watir::HaveHtml.new(text)
end

RSpec matcher that passes if @browser#link(how,what) returns an existing link.



102
103
104
# File 'lib/spec/ui/watir_helper.rb', line 102

def have_link(how, what)
  Spec::Watir::HaveLink.new(how, what)
end

#have_text(text) ⇒ Object

RSpec matcher that passes if @browser#text matches text (String or Regexp)



46
47
48
# File 'lib/spec/ui/watir_helper.rb', line 46

def have_text(text)
  Spec::Watir::HaveText.new(text)
end

#have_text_field(how, what) ⇒ Object

RSpec matcher that passes if @browser#text_field(how,what) returns an existing text field.



138
139
140
# File 'lib/spec/ui/watir_helper.rb', line 138

def have_text_field(how, what)
  Spec::Watir::HaveTextField.new(how, what)
end