watirloo 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. data/.gitignore +22 -0
  2. data/History.txt +44 -0
  3. data/Manifest.txt +59 -0
  4. data/README.rdoc +94 -0
  5. data/Rakefile +68 -0
  6. data/VERSION +1 -0
  7. data/lib/watirloo/browsers.rb +73 -0
  8. data/lib/watirloo/desktop.rb +44 -0
  9. data/lib/watirloo/extension/firewatir_ducktape.rb +194 -0
  10. data/lib/watirloo/extension/object.rb +32 -0
  11. data/lib/watirloo/extension/watir_ducktape.rb +552 -0
  12. data/lib/watirloo/extension/watir_reflector.rb +83 -0
  13. data/lib/watirloo/locker.rb +85 -0
  14. data/lib/watirloo/page.rb +140 -0
  15. data/lib/watirloo.rb +16 -0
  16. data/spec/browser_spec.rb +38 -0
  17. data/spec/browser_threads_spec.rb +45 -0
  18. data/spec/checkbox_group_spec.rb +136 -0
  19. data/spec/checkbox_groups_spec.rb +55 -0
  20. data/spec/checkboxes_value_spec.rb +35 -0
  21. data/spec/desktop_spec.rb +54 -0
  22. data/spec/extra/browser_events_spec.rb +76 -0
  23. data/spec/extra/page_objects_metrics.rb +139 -0
  24. data/spec/face_mixing_spec.rb +55 -0
  25. data/spec/firewatir/attach_instance_test.rb +38 -0
  26. data/spec/firewatir/spec_results.html +263 -0
  27. data/spec/firewatir/spec_results.txt +23 -0
  28. data/spec/firewatir/spec_results_failed.txt +3 -0
  29. data/spec/html/census.html +332 -0
  30. data/spec/html/checkbox_group1.html +33 -0
  31. data/spec/html/frameset1.html +17 -0
  32. data/spec/html/labels.html +53 -0
  33. data/spec/html/no_title.html +13 -0
  34. data/spec/html/person.html +37 -0
  35. data/spec/html/radio_group.html +35 -0
  36. data/spec/html/select_lists.html +82 -0
  37. data/spec/input_element_spec.rb +51 -0
  38. data/spec/label_spec.rb +65 -0
  39. data/spec/locker_spec.rb +49 -0
  40. data/spec/page_spec.rb +91 -0
  41. data/spec/person_def_wrappers_spec.rb +40 -0
  42. data/spec/radio_group_spec.rb +95 -0
  43. data/spec/radio_groups_spec.rb +55 -0
  44. data/spec/reflector_spec.rb +82 -0
  45. data/spec/select_list_options_spec.rb +40 -0
  46. data/spec/select_lists_spec.rb +151 -0
  47. data/spec/spec_helper.rb +20 -0
  48. data/spec/spec_helper_ff.rb +5 -0
  49. data/spec/spec_helper_runner.rb +13 -0
  50. data/spec/spec_results.html +556 -0
  51. data/spec/spec_results.txt +175 -0
  52. data/spec/spec_results_failed.txt +1 -0
  53. data/spec/text_fields_spec.rb +56 -0
  54. data/watirloo.gemspec +122 -0
  55. metadata +150 -0
@@ -0,0 +1,175 @@
1
+
2
+ Watirloo browser when no browsers on desktop nor in locker
3
+ - should start a default new browser and load a testfile
4
+ - should attach to a default browser with loaded testfile and return its title
5
+ - should start second browser with a named keyword
6
+ - should attach to second browser with keyword and navigate to a testfile
7
+ - should attach to two distinct browsers by key values by kewords used to start them
8
+
9
+ Watirloo multiple browsers and threads
10
+ - open 5 new browsers in threads and add them to locker
11
+ - use locker to reattach to 5 browsers and load 5 diff pages at once
12
+ - reattach and close all 5 browsers
13
+
14
+ setting and getting values for individual checkboxes with value attributes in face definitions
15
+ - semantic name accesses individual CheckBox
16
+ - set individual checkbox does not set other checkboxes sharing the same name
17
+
18
+ checkbox_groups access for browser
19
+ - browser responds to checkbox_group
20
+ - returns group object and its values from the page
21
+ - lenght returns integer count of groups
22
+ - each iterator returns CheckboxGroup
23
+ - each accesses the group and returns name
24
+ - bracket access[] returns 1-based indexed group
25
+ - if checkbox group does not exists it returns size 0 or name nil (or should it blow up? or respond to exists? method
26
+ - return checkbox groups contained by the form element
27
+
28
+ browser checkbox_group accesses a group of checkboxes sharing the same name on a page
29
+ - browser responds to checkbox_group
30
+ - access by name as default returns CheckboxGroup
31
+ - size retuns checkboxes as items count in a group
32
+ - values returns array of value attributes for each checkbox in a group
33
+
34
+ checkbox_group values when no checkbox is checked in a group
35
+ - selected should return nil
36
+ - selected_value should return nil
37
+ - selected_values should return empty array
38
+ - set? should return false when no checkbox is checked in a group
39
+
40
+ checkbox_group values when set string selecs one item only
41
+ - selected should return the string used to select it
42
+ - selected_value should return the string when one item is selected
43
+ - selected values returns array with one element
44
+ - set? should return truee when 1 checkbox is checked in a group
45
+
46
+ checkbox_group set array of strings selects multiple values in a group
47
+ - selected returns array of strings when multiple values are selected
48
+ - selected_value returns the same array of strings by position in a group
49
+ - selected_values returns the same array of strings by position in a group
50
+ - set? should return truee when more than 1 checkbox is checked in a group
51
+
52
+ checkbox_group set by numberical position
53
+ - set Fixnum checks checkbox by position in a group. Position is 1 based.
54
+ - set array of Fixnums checks each checkbox by position
55
+
56
+ Watirloo Desktop
57
+ - clear closes all browsers on the desktop and browsers should be empty
58
+ - adding first browser should report 1 addition and no deletions
59
+ - while one browser on the desktop the additions and deletions should be false
60
+ - adding second browser should report one addition and no deletions
61
+ - close one should report 1 deletion and no additions, attempt to attach to deleted cause exception
62
+ - close one and start new one should report one addition and one deletion
63
+
64
+ Class client mixing interfaces from other modules
65
+ - spray and scrape example
66
+
67
+ Mystery input element
68
+ - the id is text_field
69
+ - the label points to text_field
70
+ - the id should return select_list
71
+
72
+ text field wrapped in label tag without for attribute defined
73
+ - parent of text_field should be Watir Element
74
+ - parent tagName should be a LABEL
75
+ - parent text returns text of label
76
+
77
+ label for text field not wrapped
78
+ - text value of label
79
+
80
+ Locker
81
+ - locker file does not exist. create it. mapping should return empty hash
82
+ - clear should create locker file and save empty mapping
83
+ - add stores ie.hwnd with friendly name and adds it to mapping
84
+ - mapping holds what was added
85
+ - remove deletes a key value record
86
+ - browser reattaches to named browser based on windows handle
87
+ - browser attach to nonexisting windows behaves like IE.attach, it raises error
88
+
89
+ Page class with face definitions
90
+ - has face method as singleton
91
+ - face class method defines method
92
+ - face accepts args used by method body
93
+ - when optional args not supplied provide default arg in method
94
+
95
+ Page faces included in rspec
96
+ - face defines a watir element access
97
+ - faces with arguments
98
+
99
+ Page doc provides access to frame in frameset browser
100
+ - face defines a watir element access
101
+ - faces with arguments
102
+
103
+ Person Page interfaces defined by def wrappers and class definitions
104
+ - calling face when there is wrapper method
105
+ - calling interface when there is definition and no method
106
+ - spray method by convetion has keys correspondig to interface names for watir elements
107
+
108
+ RadioGroup class access in watir browser
109
+ - browser responds to radio_group
110
+ - returns RadioGroups class
111
+ - lenght returns integer count of groups
112
+ - each iterator returns RadioGroup
113
+ - each accesses the group and returns name
114
+ - bracket access[] returns 1-based indexed group
115
+ - if radio group does not exists it returns size 0 or name nil (or should it blow up? or respond to exists? method
116
+ - groups contained by a form element
117
+
118
+ RadioGroup class access in watir browser
119
+ - browser responds to radio_group
120
+ - radio group needs :what value with implicit :how=name
121
+
122
+ RadioGroup class interface in watirloo
123
+ - container radio_group method returns RadioGroup class
124
+ - size or count returns how many radios in a group
125
+ - values returns value attributes text items as an array
126
+ - selected_value returns internal option value for selected radio item in a group
127
+ - set selects radio by position in a group
128
+ - set selects radio by value in a group. selected returns value
129
+ - set position throws exception if number not within the range of group size
130
+ - set value throws exception if value not found in options
131
+ - set throws exception if sybmol is used. it should accept Fixnum or String element only
132
+
133
+ SelectList selections
134
+ - selected returns preselected item in single select
135
+ - selected returns preselected value in single select
136
+ - selected returns nil for none selected items in multi select
137
+ - selected returns nil for none selected values in multi select
138
+ - set item text and find selected item and text for multiselect
139
+ - set value and find selected item and value for multiselect
140
+ - set and query option by text for single select
141
+ - set and query option by value for single select
142
+ - set by text multple items for multiselect selects each item
143
+ - set by value multple items for multiselect selects each item
144
+ - set items array for single select selects each in turn. selected is the last item in array
145
+ - set item after multiple items were set returns all values selected for multiselect
146
+ - set using position for multiselect
147
+ - set using position and item for multiselect
148
+ - set using position for single select
149
+ - clear removes selected attribute for all selected items in multiselect
150
+ - clear removes selected attribute for item in single select list (FAILED - 1)
151
+ - set_value selects value atribute text
152
+ - set_value for multiselect returns selected and selected_values
153
+
154
+ SelectList options as visible items and values as hidden to the user attributes
155
+ - values of options by facename method
156
+ - options with no value attribute
157
+ - items method returns visible contents as array of text items
158
+ - items returns visible text items as array
159
+
160
+ add faces text fields page objects
161
+ - face returns a watir element text_field
162
+ - face name method and value returns current text
163
+ - face name method and set enters value into field
164
+ - spray method matches keys as facenames and sets values to fields
165
+ - scrape keys updates keys with values and returns datamap
166
+
167
+ 1)
168
+ 'SelectList selections clear removes selected attribute for item in single select list' FAILED
169
+ expected not: == "F",
170
+ got: "F"
171
+ ./spec/select_lists_spec.rb:134:
172
+
173
+ Finished in 480.021 seconds
174
+
175
+ 115 examples, 1 failure
@@ -0,0 +1 @@
1
+ SelectList selections clear removes selected attribute for item in single select list
@@ -0,0 +1,56 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "add faces text fields page objects" do
4
+
5
+ include Watirloo::Page
6
+
7
+ face :last do
8
+ text_field(:name, 'last_nm')
9
+ end
10
+
11
+ face :first do
12
+ text_field(:name, 'first_nm')
13
+ end
14
+
15
+ before do
16
+ browser.goto testfile('person.html')
17
+ end
18
+
19
+ it 'face returns a watir element text_field' do
20
+ if browser.kind_of? FireWatir::Firefox
21
+ first.should be_kind_of(FireWatir::TextField)
22
+ last.should be_kind_of(FireWatir::TextField)
23
+ elsif browser.kind_of? Watir::IE
24
+ first.should be_kind_of(Watir::TextField)
25
+ last.should be_kind_of(Watir::TextField)
26
+ end
27
+ end
28
+
29
+ it 'face name method and value returns current text' do
30
+ first.value.should == 'Joanney'
31
+ last.value.should == 'Begoodnuffski'
32
+ end
33
+
34
+ it "face name method and set enters value into field" do
35
+ params = {:first => 'Grzegorz',:last => 'Brzeczyszczykiewicz'}
36
+ first.set params[:first]
37
+ last.set params[:last]
38
+ first.value.should == params[:first]
39
+ last.value.should == params[:last]
40
+ end
41
+
42
+ it 'spray method matches keys as facenames and sets values to fields' do
43
+ params = {:first => 'Grzegorz',:last => 'Brzeczyszczykiewicz'}
44
+ spray params
45
+ first.value.should == params[:first]
46
+ last.value.should == params[:last]
47
+
48
+ end
49
+ it 'scrape keys updates keys with values and returns datamap' do
50
+ datamap = {:first => 'Hermenegilda', :last => 'Kociubinska'}
51
+ spray datamap
52
+ values = scrape datamap.keys
53
+ values.should == datamap
54
+ end
55
+ end
56
+
data/watirloo.gemspec ADDED
@@ -0,0 +1,122 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{watirloo}
8
+ s.version = "0.0.7"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["marekj"]
12
+ s.date = %q{2009-12-24}
13
+ s.description = %q{Helps you write tests in the language of the customer's domain}
14
+ s.email = %q{marekj.com@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "README.rdoc"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "History.txt",
21
+ "Manifest.txt",
22
+ "README.rdoc",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "lib/watirloo.rb",
26
+ "lib/watirloo/browsers.rb",
27
+ "lib/watirloo/desktop.rb",
28
+ "lib/watirloo/extension/firewatir_ducktape.rb",
29
+ "lib/watirloo/extension/object.rb",
30
+ "lib/watirloo/extension/watir_ducktape.rb",
31
+ "lib/watirloo/extension/watir_reflector.rb",
32
+ "lib/watirloo/locker.rb",
33
+ "lib/watirloo/page.rb",
34
+ "spec/browser_spec.rb",
35
+ "spec/browser_threads_spec.rb",
36
+ "spec/checkbox_group_spec.rb",
37
+ "spec/checkbox_groups_spec.rb",
38
+ "spec/checkboxes_value_spec.rb",
39
+ "spec/desktop_spec.rb",
40
+ "spec/extra/browser_events_spec.rb",
41
+ "spec/extra/page_objects_metrics.rb",
42
+ "spec/face_mixing_spec.rb",
43
+ "spec/firewatir/attach_instance_test.rb",
44
+ "spec/firewatir/spec_results.html",
45
+ "spec/firewatir/spec_results.txt",
46
+ "spec/firewatir/spec_results_failed.txt",
47
+ "spec/html/census.html",
48
+ "spec/html/checkbox_group1.html",
49
+ "spec/html/frameset1.html",
50
+ "spec/html/labels.html",
51
+ "spec/html/no_title.html",
52
+ "spec/html/person.html",
53
+ "spec/html/radio_group.html",
54
+ "spec/html/select_lists.html",
55
+ "spec/input_element_spec.rb",
56
+ "spec/label_spec.rb",
57
+ "spec/locker_spec.rb",
58
+ "spec/page_spec.rb",
59
+ "spec/person_def_wrappers_spec.rb",
60
+ "spec/radio_group_spec.rb",
61
+ "spec/radio_groups_spec.rb",
62
+ "spec/reflector_spec.rb",
63
+ "spec/select_list_options_spec.rb",
64
+ "spec/select_lists_spec.rb",
65
+ "spec/spec_helper.rb",
66
+ "spec/spec_helper_ff.rb",
67
+ "spec/spec_helper_runner.rb",
68
+ "spec/spec_results.html",
69
+ "spec/spec_results.txt",
70
+ "spec/spec_results_failed.txt",
71
+ "spec/text_fields_spec.rb",
72
+ "watirloo.gemspec"
73
+ ]
74
+ s.homepage = %q{http://github.com/marekj/watirloo}
75
+ s.rdoc_options = ["--charset=UTF-8"]
76
+ s.require_paths = ["lib"]
77
+ s.rubygems_version = %q{1.3.5}
78
+ s.summary = %q{small Watir framework based on semantic page object adapters for DOM elements}
79
+ s.test_files = [
80
+ "spec/browser_spec.rb",
81
+ "spec/browser_threads_spec.rb",
82
+ "spec/checkboxes_value_spec.rb",
83
+ "spec/checkbox_groups_spec.rb",
84
+ "spec/checkbox_group_spec.rb",
85
+ "spec/desktop_spec.rb",
86
+ "spec/extra/browser_events_spec.rb",
87
+ "spec/extra/page_objects_metrics.rb",
88
+ "spec/face_mixing_spec.rb",
89
+ "spec/firewatir/attach_instance_test.rb",
90
+ "spec/input_element_spec.rb",
91
+ "spec/label_spec.rb",
92
+ "spec/locker_spec.rb",
93
+ "spec/page_spec.rb",
94
+ "spec/person_def_wrappers_spec.rb",
95
+ "spec/radio_groups_spec.rb",
96
+ "spec/radio_group_spec.rb",
97
+ "spec/reflector_spec.rb",
98
+ "spec/select_lists_spec.rb",
99
+ "spec/select_list_options_spec.rb",
100
+ "spec/spec_helper.rb",
101
+ "spec/spec_helper_ff.rb",
102
+ "spec/spec_helper_runner.rb",
103
+ "spec/text_fields_spec.rb"
104
+ ]
105
+
106
+ if s.respond_to? :specification_version then
107
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
108
+ s.specification_version = 3
109
+
110
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
111
+ s.add_runtime_dependency(%q<watir>, [">= 1.6.2"])
112
+ s.add_development_dependency(%q<rspec>, [">= 1.2.7"])
113
+ else
114
+ s.add_dependency(%q<watir>, [">= 1.6.2"])
115
+ s.add_dependency(%q<rspec>, [">= 1.2.7"])
116
+ end
117
+ else
118
+ s.add_dependency(%q<watir>, [">= 1.6.2"])
119
+ s.add_dependency(%q<rspec>, [">= 1.2.7"])
120
+ end
121
+ end
122
+
metadata ADDED
@@ -0,0 +1,150 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: watirloo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.7
5
+ platform: ruby
6
+ authors:
7
+ - marekj
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-12-24 00:00:00 -06:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: watir
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.6.2
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.2.7
34
+ version:
35
+ description: Helps you write tests in the language of the customer's domain
36
+ email: marekj.com@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - README.rdoc
43
+ files:
44
+ - .gitignore
45
+ - History.txt
46
+ - Manifest.txt
47
+ - README.rdoc
48
+ - Rakefile
49
+ - VERSION
50
+ - lib/watirloo.rb
51
+ - lib/watirloo/browsers.rb
52
+ - lib/watirloo/desktop.rb
53
+ - lib/watirloo/extension/firewatir_ducktape.rb
54
+ - lib/watirloo/extension/object.rb
55
+ - lib/watirloo/extension/watir_ducktape.rb
56
+ - lib/watirloo/extension/watir_reflector.rb
57
+ - lib/watirloo/locker.rb
58
+ - lib/watirloo/page.rb
59
+ - spec/browser_spec.rb
60
+ - spec/browser_threads_spec.rb
61
+ - spec/checkbox_group_spec.rb
62
+ - spec/checkbox_groups_spec.rb
63
+ - spec/checkboxes_value_spec.rb
64
+ - spec/desktop_spec.rb
65
+ - spec/extra/browser_events_spec.rb
66
+ - spec/extra/page_objects_metrics.rb
67
+ - spec/face_mixing_spec.rb
68
+ - spec/firewatir/attach_instance_test.rb
69
+ - spec/firewatir/spec_results.html
70
+ - spec/firewatir/spec_results.txt
71
+ - spec/firewatir/spec_results_failed.txt
72
+ - spec/html/census.html
73
+ - spec/html/checkbox_group1.html
74
+ - spec/html/frameset1.html
75
+ - spec/html/labels.html
76
+ - spec/html/no_title.html
77
+ - spec/html/person.html
78
+ - spec/html/radio_group.html
79
+ - spec/html/select_lists.html
80
+ - spec/input_element_spec.rb
81
+ - spec/label_spec.rb
82
+ - spec/locker_spec.rb
83
+ - spec/page_spec.rb
84
+ - spec/person_def_wrappers_spec.rb
85
+ - spec/radio_group_spec.rb
86
+ - spec/radio_groups_spec.rb
87
+ - spec/reflector_spec.rb
88
+ - spec/select_list_options_spec.rb
89
+ - spec/select_lists_spec.rb
90
+ - spec/spec_helper.rb
91
+ - spec/spec_helper_ff.rb
92
+ - spec/spec_helper_runner.rb
93
+ - spec/spec_results.html
94
+ - spec/spec_results.txt
95
+ - spec/spec_results_failed.txt
96
+ - spec/text_fields_spec.rb
97
+ - watirloo.gemspec
98
+ has_rdoc: true
99
+ homepage: http://github.com/marekj/watirloo
100
+ licenses: []
101
+
102
+ post_install_message:
103
+ rdoc_options:
104
+ - --charset=UTF-8
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: "0"
112
+ version:
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: "0"
118
+ version:
119
+ requirements: []
120
+
121
+ rubyforge_project:
122
+ rubygems_version: 1.3.5
123
+ signing_key:
124
+ specification_version: 3
125
+ summary: small Watir framework based on semantic page object adapters for DOM elements
126
+ test_files:
127
+ - spec/browser_spec.rb
128
+ - spec/browser_threads_spec.rb
129
+ - spec/checkboxes_value_spec.rb
130
+ - spec/checkbox_groups_spec.rb
131
+ - spec/checkbox_group_spec.rb
132
+ - spec/desktop_spec.rb
133
+ - spec/extra/browser_events_spec.rb
134
+ - spec/extra/page_objects_metrics.rb
135
+ - spec/face_mixing_spec.rb
136
+ - spec/firewatir/attach_instance_test.rb
137
+ - spec/input_element_spec.rb
138
+ - spec/label_spec.rb
139
+ - spec/locker_spec.rb
140
+ - spec/page_spec.rb
141
+ - spec/person_def_wrappers_spec.rb
142
+ - spec/radio_groups_spec.rb
143
+ - spec/radio_group_spec.rb
144
+ - spec/reflector_spec.rb
145
+ - spec/select_lists_spec.rb
146
+ - spec/select_list_options_spec.rb
147
+ - spec/spec_helper.rb
148
+ - spec/spec_helper_ff.rb
149
+ - spec/spec_helper_runner.rb
150
+ - spec/text_fields_spec.rb