RSpec Code Examples

 

 

text field wrapped in label tag without for attribute defined
parent of text_field should be Watir Element
undefined method `kind_of??' for "":String
./spec/label_spec.rb:17:
15    if browser.kind_of?(FireWatir::Firefox)
16      first.parent.should be_kind_of(String)
17      last.parent.should be_kind_of?(String)
18      flunk('FIXME Firefox returns String for parent and not Element')
19      
parent tagName should be a LABEL
undefined method `flunk' for #<Spec::Example::ExampleGroup::Subclass_1:0x33ca070>
./spec/label_spec.rb:33:
31
32    elsif browser.kind_of?(FireWatir::Firefox)
33      flunk('FIXME Firefox returns String for parent and not Element')
34    end
35  end
parent text returns text of label
undefined method `flunk' for #<Spec::Example::ExampleGroup::Subclass_1:0x3324cd8>
./spec/label_spec.rb:43:
41
42    elsif browser.kind_of?(FireWatir::Firefox)
43      flunk('FIXME Firefox returns String for parent and not Element.')
44    end
45  end
label for text field not wrapped
text value of label
SelectList selections
selected returns preselected item in single select
selected returns preselected value in single select
selected returns nil for none selected items in multi select
selected returns nil for none selected values in multi select
set item text and find selected item and text for multiselect
set value and find selected item and value for multiselect
set and query option by text for single select
set and query option by value for single select
set by text multple items for multiselect selects each item
set by value multple items for multiselect selects each item
set items array for single select selects each in turn. selected is the last item in array
set item after multiple items were set returns all values selected for multiselect
set using position for multiselect