symbiont 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. data/Gemfile.lock +1 -1
  2. data/HISTORY.md +6 -0
  3. data/app/app.rb +48 -0
  4. data/app/public/css/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png +0 -0
  5. data/app/public/css/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png +0 -0
  6. data/app/public/css/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png +0 -0
  7. data/app/public/css/cupertino/images/ui-bg_glass_50_3baae3_1x400.png +0 -0
  8. data/app/public/css/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png +0 -0
  9. data/app/public/css/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png +0 -0
  10. data/app/public/css/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png +0 -0
  11. data/app/public/css/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png +0 -0
  12. data/app/public/css/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png +0 -0
  13. data/app/public/css/cupertino/images/ui-icons_2694e8_256x240.png +0 -0
  14. data/app/public/css/cupertino/images/ui-icons_2e83ff_256x240.png +0 -0
  15. data/app/public/css/cupertino/images/ui-icons_3d80b3_256x240.png +0 -0
  16. data/app/public/css/cupertino/images/ui-icons_72a7cf_256x240.png +0 -0
  17. data/app/public/css/cupertino/images/ui-icons_ffffff_256x240.png +0 -0
  18. data/app/public/css/cupertino/jquery-ui-1.8.16.custom.css +290 -0
  19. data/app/public/css/demo_table_jui.css +471 -0
  20. data/app/public/css/font/ColabLig-webfont.eot +0 -0
  21. data/app/public/css/font/ColabLig-webfont.svg +149 -0
  22. data/app/public/css/font/ColabLig-webfont.ttf +0 -0
  23. data/app/public/css/font/ColabLig-webfont.woff +0 -0
  24. data/app/public/css/font/ColabMed-webfont.eot +0 -0
  25. data/app/public/css/font/ColabMed-webfont.svg +149 -0
  26. data/app/public/css/font/ColabMed-webfont.ttf +0 -0
  27. data/app/public/css/font/ColabMed-webfont.woff +0 -0
  28. data/app/public/css/font/ColabReg-webfont.eot +0 -0
  29. data/app/public/css/font/ColabReg-webfont.svg +149 -0
  30. data/app/public/css/font/ColabReg-webfont.ttf +0 -0
  31. data/app/public/css/font/ColabReg-webfont.woff +0 -0
  32. data/app/public/css/font/ColabThi-webfont.eot +0 -0
  33. data/app/public/css/font/ColabThi-webfont.svg +149 -0
  34. data/app/public/css/font/ColabThi-webfont.ttf +0 -0
  35. data/app/public/css/font/ColabThi-webfont.woff +0 -0
  36. data/app/public/css/normalize.css +376 -0
  37. data/app/public/css/site.css +430 -0
  38. data/app/public/fancybox/blank.gif +0 -0
  39. data/app/public/fancybox/fancy_close.png +0 -0
  40. data/app/public/fancybox/fancy_loading.png +0 -0
  41. data/app/public/fancybox/fancy_nav_left.png +0 -0
  42. data/app/public/fancybox/fancy_nav_right.png +0 -0
  43. data/app/public/fancybox/fancy_shadow_e.png +0 -0
  44. data/app/public/fancybox/fancy_shadow_n.png +0 -0
  45. data/app/public/fancybox/fancy_shadow_ne.png +0 -0
  46. data/app/public/fancybox/fancy_shadow_nw.png +0 -0
  47. data/app/public/fancybox/fancy_shadow_s.png +0 -0
  48. data/app/public/fancybox/fancy_shadow_se.png +0 -0
  49. data/app/public/fancybox/fancy_shadow_sw.png +0 -0
  50. data/app/public/fancybox/fancy_shadow_w.png +0 -0
  51. data/app/public/fancybox/fancy_title_left.png +0 -0
  52. data/app/public/fancybox/fancy_title_main.png +0 -0
  53. data/app/public/fancybox/fancy_title_over.png +0 -0
  54. data/app/public/fancybox/fancy_title_right.png +0 -0
  55. data/app/public/fancybox/fancybox-x.png +0 -0
  56. data/app/public/fancybox/fancybox-y.png +0 -0
  57. data/app/public/fancybox/fancybox.png +0 -0
  58. data/app/public/fancybox/jquery.fancybox-1.3.4.css +359 -0
  59. data/app/public/fancybox/jquery.fancybox-1.3.4.js +1156 -0
  60. data/app/public/fancybox/jquery.fancybox-1.3.4.min.js +1 -0
  61. data/app/public/img/Sorting icons.psd +0 -0
  62. data/app/public/img/back_disabled.png +0 -0
  63. data/app/public/img/back_enabled.png +0 -0
  64. data/app/public/img/back_enabled_hover.png +0 -0
  65. data/app/public/img/close.png +0 -0
  66. data/app/public/img/favicon.ico +0 -0
  67. data/app/public/img/forward_disabled.png +0 -0
  68. data/app/public/img/forward_enabled.png +0 -0
  69. data/app/public/img/forward_enabled_hover.png +0 -0
  70. data/app/public/img/lucid-bg.png +0 -0
  71. data/app/public/img/lucid-ft.png +0 -0
  72. data/app/public/img/open.png +0 -0
  73. data/app/public/img/sort_asc.png +0 -0
  74. data/app/public/img/sort_asc_disabled.png +0 -0
  75. data/app/public/img/sort_both.png +0 -0
  76. data/app/public/img/sort_desc.png +0 -0
  77. data/app/public/img/sort_desc_disabled.png +0 -0
  78. data/app/public/js/comics.js +11 -0
  79. data/app/public/js/signup.js +141 -0
  80. data/app/public/js/site.js +40 -0
  81. data/app/public/js/stardate.js +35 -0
  82. data/app/public/js/vendor/html5shiv.js +5 -0
  83. data/app/public/js/vendor/jquery-1.8.3.min.js +2 -0
  84. data/app/public/js/vendor/jquery.dataTables.min.js +151 -0
  85. data/app/public/js/vendor/jquery.validate.min.js +4 -0
  86. data/app/views/comics.erb +322 -0
  87. data/app/views/index.erb +7 -0
  88. data/app/views/layout.erb +72 -0
  89. data/app/views/layout_small.erb +21 -0
  90. data/app/views/stardate.erb +5 -0
  91. data/app/views/stardate_calc.erb +30 -0
  92. data/app/views/webobject.erb +147 -0
  93. data/lib/symbiont/enclosers.rb +18 -2
  94. data/lib/symbiont/evaluators.rb +1 -4
  95. data/lib/symbiont/generators.rb +22 -56
  96. data/lib/symbiont/locators.rb +10 -10
  97. data/lib/symbiont/platform_watir/platform_object.rb +28 -52
  98. data/lib/symbiont/platform_watir.rb +2 -11
  99. data/lib/symbiont/platforms.rb +8 -20
  100. data/lib/symbiont/version.rb +1 -1
  101. data/lib/symbiont/web_objects/_common.rb +110 -32
  102. data/lib/symbiont/web_objects/button.rb +2 -15
  103. data/lib/symbiont/web_objects/checkbox.rb +11 -17
  104. data/lib/symbiont/web_objects/div.rb +1 -5
  105. data/lib/symbiont/web_objects/link.rb +3 -20
  106. data/lib/symbiont/web_objects/radio.rb +10 -16
  107. data/lib/symbiont/web_objects/select_list.rb +60 -15
  108. data/lib/symbiont/web_objects/span.rb +1 -5
  109. data/lib/symbiont/web_objects/table.rb +22 -12
  110. data/lib/symbiont/web_objects/table_cell.rb +2 -6
  111. data/lib/symbiont/web_objects/table_row.rb +24 -13
  112. data/lib/symbiont/web_objects/text_field.rb +10 -19
  113. data/lib/symbiont/web_objects.rb +2 -2
  114. data/lib/symbiont.rb +13 -3
  115. data/spec/spec_helper.rb +1 -0
  116. data/spec/symbiont/enclosers_spec.rb +3 -0
  117. data/spec/symbiont/evaluators_spec.rb +5 -0
  118. data/spec/symbiont/generators/button_generators_spec.rb +1 -1
  119. data/spec/symbiont/generators/cell_generators_spec.rb +1 -1
  120. data/spec/symbiont/generators/checkbox_generators_spec.rb +1 -1
  121. data/spec/symbiont/generators/div_generators_spec.rb +2 -2
  122. data/spec/symbiont/generators/link_generators_spec.rb +1 -1
  123. data/spec/symbiont/generators/paragraph_generators_spec.rb +52 -0
  124. data/spec/symbiont/generators/radio_generators_spec.rb +1 -2
  125. data/spec/symbiont/generators/select_list_generators_spec.rb +3 -3
  126. data/spec/symbiont/generators/span_generators_spec.rb +1 -1
  127. data/spec/symbiont/generators/table_generators_spec.rb +8 -1
  128. data/spec/symbiont/generators/text_field_generators_spec.rb +1 -1
  129. data/spec/symbiont/symbiont_spec.rb +10 -0
  130. data/spec/symbiont/web_object_spec.rb +71 -10
  131. data/spec/symbiont/web_objects/paragraph_spec.rb +11 -0
  132. data/spec/symbiont/web_objects/radio_spec.rb +17 -1
  133. data/spec/symbiont/web_objects/table_cell_spec.rb +6 -0
  134. data/spec/symbiont/web_objects/table_row_spec.rb +20 -10
  135. metadata +94 -20
  136. data/lib/symbiont/platform_selenium/platform_object.rb +0 -236
  137. data/lib/symbiont/platform_selenium/web_objects/button.rb +0 -13
  138. data/lib/symbiont/platform_selenium/web_objects/checkbox.rb +0 -21
  139. data/lib/symbiont/platform_selenium/web_objects/common.rb +0 -104
  140. data/lib/symbiont/platform_selenium/web_objects/link.rb +0 -13
  141. data/lib/symbiont/platform_selenium/web_objects/radio.rb +0 -21
  142. data/lib/symbiont/platform_selenium/web_objects/select_list.rb +0 -79
  143. data/lib/symbiont/platform_selenium/web_objects/table.rb +0 -40
  144. data/lib/symbiont/platform_selenium/web_objects/table_row.rb +0 -36
  145. data/lib/symbiont/platform_selenium/web_objects/text_field.rb +0 -14
  146. data/lib/symbiont/platform_selenium.rb +0 -18
  147. data/lib/symbiont/platform_watir/web_objects/checkbox.rb +0 -21
  148. data/lib/symbiont/platform_watir/web_objects/common.rb +0 -82
  149. data/lib/symbiont/platform_watir/web_objects/radio.rb +0 -21
  150. data/lib/symbiont/platform_watir/web_objects/select_list.rb +0 -67
  151. data/lib/symbiont/platform_watir/web_objects/table.rb +0 -31
  152. data/lib/symbiont/platform_watir/web_objects/table_row.rb +0 -31
  153. data/lib/symbiont/platform_watir/web_objects/text_field.rb +0 -13
@@ -24,9 +24,29 @@ describe "Web Objects" do
24
24
 
25
25
  it "should retrieve the tag of a web object" do
26
26
  watir_browser.should_receive(:tag_name).and_return("div")
27
- watir_definition.tag.should == "div"
27
+ watir_definition.tag_name.should == "div"
28
28
  end
29
-
29
+
30
+ it "should retrieve the html of a web object" do
31
+ watir_browser.should_receive(:html).and_return("<p>Testing</p>")
32
+ watir_definition.html.should == "<p>Testing</p>"
33
+ end
34
+
35
+ it "should be able to hover over a web object" do
36
+ watir_browser.should_receive(:hover).and_return(watir_definition)
37
+ watir_definition.hover
38
+ end
39
+
40
+ it "should be able to focus on a web object" do
41
+ watir_browser.should_receive(:focus).and_return(watir_definition)
42
+ watir_definition.focus
43
+ end
44
+
45
+ it "should be able to fire an event on a web object" do
46
+ watir_browser.should_receive(:fire_event).and_return("onclick")
47
+ watir_definition.fire_event("onclick")
48
+ end
49
+
30
50
  it "should retrieve the id of a web object" do
31
51
  watir_browser.should_receive(:id).and_return("id")
32
52
  watir_definition.id.should == "id"
@@ -41,20 +61,27 @@ describe "Web Objects" do
41
61
  watir_browser.should_receive(:inspect).and_return(watir_definition)
42
62
  watir_definition.inspect.should be_instance_of Symbiont::WebObjects::WebObject
43
63
  end
44
-
64
+
65
+ it "should be able to determine if a web object is equal to another" do
66
+ watir_browser.should_receive(:==).and_return(true)
67
+ watir_definition.should == watir_definition
68
+ end
69
+
45
70
  it "should be able to flash a web_object" do
46
71
  watir_browser.should_receive(:flash).and_return(watir_definition)
47
72
  watir_definition.flash.should be_instance_of Symbiont::WebObjects::WebObject
48
73
  end
49
74
 
50
75
  it "should determine if a web object is enabled" do
51
- watir_browser.should_receive(:enabled?).and_return(true)
76
+ watir_browser.should_receive(:enabled?).twice.and_return(true)
52
77
  watir_definition.enabled?.should == true
78
+ watir_definition.should be_enabled
53
79
  end
54
80
 
55
81
  it "should determine if a web object is disabled" do
56
- watir_browser.should_receive(:enabled?).and_return(false)
82
+ watir_browser.should_receive(:enabled?).twice.and_return(false)
57
83
  watir_definition.disabled?.should == true
84
+ watir_definition.should be_disabled
58
85
  end
59
86
 
60
87
  it "should determine if a web object exists" do
@@ -68,8 +95,9 @@ describe "Web Objects" do
68
95
  end
69
96
 
70
97
  it "should determine if a web object is visible" do
71
- watir_browser.should_receive(:present?).and_return(true)
98
+ watir_browser.should_receive(:present?).twice.and_return(true)
72
99
  watir_definition.visible?.should == true
100
+ watir_definition.should be_visible
73
101
  end
74
102
 
75
103
  it "should determine if a web object is not visible" do
@@ -86,24 +114,51 @@ describe "Web Objects" do
86
114
  watir_browser.should_receive(:click)
87
115
  watir_definition.click
88
116
  end
89
-
117
+
118
+ it "should simulate a double-click event on a web object" do
119
+ watir_browser.should_receive(:double_click)
120
+ watir_definition.double_click
121
+ end
122
+
90
123
  it "should allow a clear event on a web object" do
91
124
  watir_browser.should_receive(:clear)
92
125
  watir_definition.clear
93
126
  end
94
-
127
+
128
+ it "should send key presses to a web object" do
129
+ watir_browser.should_receive(:send_keys).with([:control, 'a'])
130
+ watir_definition.send_keys([:control, 'a'])
131
+ end
132
+
133
+ it "should find the parent for a web object" do
134
+ watir_browser.should_receive(:tag_name).twice.and_return(:p)
135
+ watir_browser.should_receive(:parent).and_return(watir_definition)
136
+ watir_definition.parent
137
+ end
138
+
95
139
  it "should wait for a web object to be actionable" do
96
140
  watir_browser.should_receive(:wait_until_present).twice.with(5)
97
141
  watir_definition.when_actionable(5)
98
142
  watir_definition.when_present(5)
99
143
  end
100
-
144
+
145
+ it "should use the provided element wait time for actionable checks" do
146
+ Symbiont.element_level_wait = 30
147
+ watir_browser.should_receive(:wait_until_present).with(30)
148
+ watir_definition.when_present
149
+ end
150
+
101
151
  it "should reference a web object when it is actionable" do
102
152
  watir_browser.should_receive(:wait_until_present).with(5)
103
153
  web_object = watir_definition.when_actionable(5)
104
154
  web_object.should === watir_definition
105
155
  end
106
-
156
+
157
+ it "should wait for a web object to become non-actionable" do
158
+ watir_browser.should_receive(:wait_while_present).and_return(false)
159
+ watir_definition.when_not_present(5)
160
+ end
161
+
107
162
  it "should wait for a web object to become visible" do
108
163
  watir_browser.should_receive(:present?).and_return(true)
109
164
  watir_definition.when_visible(5)
@@ -130,4 +185,10 @@ describe "Web Objects" do
130
185
  Object::Watir::Wait.stub(:until).with(5, "Condition occurred.")
131
186
  watir_definition.wait_until(5, "Condition occurred.") { true }
132
187
  end
188
+
189
+ it "should scroll elements into view" do
190
+ watir_browser.should_receive(:wd).and_return(watir_browser)
191
+ watir_browser.should_receive(:location_once_scrolled_into_view)
192
+ watir_definition.scroll_into_view
193
+ end
133
194
  end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe Symbiont::WebObjects::Paragraph do
4
+ describe "implementation" do
5
+ let(:p_object) { double('p_object') }
6
+
7
+ it "should register with a paragraph tag" do
8
+ ::Symbiont::WebObjects.get_class_for(:p).should == ::Symbiont::WebObjects::Paragraph
9
+ end
10
+ end
11
+ end
@@ -3,9 +3,25 @@ require 'spec_helper'
3
3
  describe Symbiont::WebObjects::Radio do
4
4
  describe "implementation" do
5
5
  let(:radio_object) { double('radio_object') }
6
-
6
+ let(:radio) { Symbiont::WebObjects::Radio.new(radio_object) }
7
+
7
8
  it "should register with a radio type" do
8
9
  ::Symbiont::WebObjects.get_class_for(:input, :radio).should == ::Symbiont::WebObjects::Radio
9
10
  end
11
+
12
+ it "should be able to select a radio" do
13
+ radio_object.should_receive(:set).and_return(true)
14
+ radio.select
15
+ end
16
+
17
+ it "should be able to clear a radio" do
18
+ radio_object.should_receive(:clear).and_return(true)
19
+ radio.clear
20
+ end
21
+
22
+ it "should be able to see if a radio is selected" do
23
+ radio_object.should_receive(:set?).and_return(true)
24
+ radio.selected?
25
+ end
10
26
  end
11
27
  end
@@ -9,5 +9,11 @@ describe Symbiont::WebObjects::TableCell do
9
9
  it "should register with a table header tag" do
10
10
  ::Symbiont::WebObjects.get_class_for(:th).should == ::Symbiont::WebObjects::TableCell
11
11
  end
12
+
13
+ it "should always be enabled" do
14
+ table_cell_object = double('table_cell_object')
15
+ table_cell = Symbiont::WebObjects::TableCell.new(table_cell_object)
16
+ table_cell.enabled?.should be_true
17
+ end
12
18
  end
13
19
  end
@@ -9,6 +9,11 @@ describe Symbiont::WebObjects::TableRow do
9
9
  it "should return a table cell when indexed" do
10
10
  table_row = Symbiont::WebObjects::TableRow.new(table_row_object)
11
11
  table_row_object.should_receive(:[]).with(1).and_return(table_cell)
12
+
13
+ table_row_object.should_receive(:size).and_return(3)
14
+ table_row_object.should_receive(:find_elements).with(:xpath, ".//child::td|th").and_return(table_row_object)
15
+ table_row_object.should_receive(:wd).and_return(table_row_object)
16
+
12
17
  table_row[1].should be_instance_of Symbiont::WebObjects::TableCell
13
18
  end
14
19
 
@@ -29,16 +34,21 @@ describe Symbiont::WebObjects::TableRow do
29
34
  count.should == 2
30
35
  end
31
36
 
32
- it "should return a row using text from the first row" do
33
- table_row = Symbiont::WebObjects::TableRow.new(table_row_object)
34
- table_row_object.should_receive(:[]).with("column_text").and_return(table_row_object)
35
- table_row_object.should_receive(:[]).with(0).and_return(table_row_object)
36
- table_row_object.should_receive(:tag_name)
37
- table_row_object.should_receive(:parent).and_return(table_row_object)
38
- table_row_object.should_receive(:cells).and_return(table_row_object)
39
- table_row_object.should_receive(:find_index).and_return("column_text")
40
- table_row["column_text"].should be_instance_of Symbiont::WebObjects::TableCell
41
- end
37
+ #it "should return a row using text from the first row" do
38
+ #table_row = Symbiont::WebObjects::TableRow.new(table_row_object)
39
+ #table_row_object.should_receive(:[]).with("column_text").and_return(table_row_object)
40
+ #table_row_object.should_receive(:[]).with(0).and_return(table_row_object)
41
+ #table_row_object.should_receive(:tag_name)
42
+ #table_row_object.should_receive(:parent).and_return(table_row_object)
43
+ #table_row_object.should_receive(:cells).and_return(table_row_object)
44
+ #table_row_object.should_receive(:find_index).and_return("column_text")
45
+
46
+ #table_row_object.should_receive(:size).and_return(1)
47
+ #table_row_object.should_receive(:find_elements).with(:xpath, ".//child::td|th").and_return(table_row_object)
48
+ #table_row_object.should_receive(:wd).and_return(table_row_object)
49
+
50
+ #table_row[1]["column_text"].should be_instance_of Symbiont::WebObjects::TableCell
51
+ #end
42
52
 
43
53
  it "should register with a table row tag" do
44
54
  ::Symbiont::WebObjects.get_class_for(:tr).should == ::Symbiont::WebObjects::TableRow
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symbiont
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-30 00:00:00.000000000 Z
12
+ date: 2013-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: watir-webdriver
@@ -58,6 +58,96 @@ files:
58
58
  - LICENSE
59
59
  - README.md
60
60
  - Rakefile
61
+ - app/app.rb
62
+ - app/public/css/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png
63
+ - app/public/css/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png
64
+ - app/public/css/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png
65
+ - app/public/css/cupertino/images/ui-bg_glass_50_3baae3_1x400.png
66
+ - app/public/css/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png
67
+ - app/public/css/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png
68
+ - app/public/css/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png
69
+ - app/public/css/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png
70
+ - app/public/css/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png
71
+ - app/public/css/cupertino/images/ui-icons_2694e8_256x240.png
72
+ - app/public/css/cupertino/images/ui-icons_2e83ff_256x240.png
73
+ - app/public/css/cupertino/images/ui-icons_3d80b3_256x240.png
74
+ - app/public/css/cupertino/images/ui-icons_72a7cf_256x240.png
75
+ - app/public/css/cupertino/images/ui-icons_ffffff_256x240.png
76
+ - app/public/css/cupertino/jquery-ui-1.8.16.custom.css
77
+ - app/public/css/demo_table_jui.css
78
+ - app/public/css/font/ColabLig-webfont.eot
79
+ - app/public/css/font/ColabLig-webfont.svg
80
+ - app/public/css/font/ColabLig-webfont.ttf
81
+ - app/public/css/font/ColabLig-webfont.woff
82
+ - app/public/css/font/ColabMed-webfont.eot
83
+ - app/public/css/font/ColabMed-webfont.svg
84
+ - app/public/css/font/ColabMed-webfont.ttf
85
+ - app/public/css/font/ColabMed-webfont.woff
86
+ - app/public/css/font/ColabReg-webfont.eot
87
+ - app/public/css/font/ColabReg-webfont.svg
88
+ - app/public/css/font/ColabReg-webfont.ttf
89
+ - app/public/css/font/ColabReg-webfont.woff
90
+ - app/public/css/font/ColabThi-webfont.eot
91
+ - app/public/css/font/ColabThi-webfont.svg
92
+ - app/public/css/font/ColabThi-webfont.ttf
93
+ - app/public/css/font/ColabThi-webfont.woff
94
+ - app/public/css/normalize.css
95
+ - app/public/css/site.css
96
+ - app/public/fancybox/blank.gif
97
+ - app/public/fancybox/fancy_close.png
98
+ - app/public/fancybox/fancy_loading.png
99
+ - app/public/fancybox/fancy_nav_left.png
100
+ - app/public/fancybox/fancy_nav_right.png
101
+ - app/public/fancybox/fancy_shadow_e.png
102
+ - app/public/fancybox/fancy_shadow_n.png
103
+ - app/public/fancybox/fancy_shadow_ne.png
104
+ - app/public/fancybox/fancy_shadow_nw.png
105
+ - app/public/fancybox/fancy_shadow_s.png
106
+ - app/public/fancybox/fancy_shadow_se.png
107
+ - app/public/fancybox/fancy_shadow_sw.png
108
+ - app/public/fancybox/fancy_shadow_w.png
109
+ - app/public/fancybox/fancy_title_left.png
110
+ - app/public/fancybox/fancy_title_main.png
111
+ - app/public/fancybox/fancy_title_over.png
112
+ - app/public/fancybox/fancy_title_right.png
113
+ - app/public/fancybox/fancybox-x.png
114
+ - app/public/fancybox/fancybox-y.png
115
+ - app/public/fancybox/fancybox.png
116
+ - app/public/fancybox/jquery.fancybox-1.3.4.css
117
+ - app/public/fancybox/jquery.fancybox-1.3.4.js
118
+ - app/public/fancybox/jquery.fancybox-1.3.4.min.js
119
+ - app/public/img/Sorting icons.psd
120
+ - app/public/img/back_disabled.png
121
+ - app/public/img/back_enabled.png
122
+ - app/public/img/back_enabled_hover.png
123
+ - app/public/img/close.png
124
+ - app/public/img/favicon.ico
125
+ - app/public/img/forward_disabled.png
126
+ - app/public/img/forward_enabled.png
127
+ - app/public/img/forward_enabled_hover.png
128
+ - app/public/img/lucid-bg.png
129
+ - app/public/img/lucid-ft.png
130
+ - app/public/img/open.png
131
+ - app/public/img/sort_asc.png
132
+ - app/public/img/sort_asc_disabled.png
133
+ - app/public/img/sort_both.png
134
+ - app/public/img/sort_desc.png
135
+ - app/public/img/sort_desc_disabled.png
136
+ - app/public/js/comics.js
137
+ - app/public/js/signup.js
138
+ - app/public/js/site.js
139
+ - app/public/js/stardate.js
140
+ - app/public/js/vendor/html5shiv.js
141
+ - app/public/js/vendor/jquery-1.8.3.min.js
142
+ - app/public/js/vendor/jquery.dataTables.min.js
143
+ - app/public/js/vendor/jquery.validate.min.js
144
+ - app/views/comics.erb
145
+ - app/views/index.erb
146
+ - app/views/layout.erb
147
+ - app/views/layout_small.erb
148
+ - app/views/stardate.erb
149
+ - app/views/stardate_calc.erb
150
+ - app/views/webobject.erb
61
151
  - cucumber.yml
62
152
  - lib/symbiont.rb
63
153
  - lib/symbiont/data_setter.rb
@@ -67,26 +157,8 @@ files:
67
157
  - lib/symbiont/generators.rb
68
158
  - lib/symbiont/locators.rb
69
159
  - lib/symbiont/logger.rb
70
- - lib/symbiont/platform_selenium.rb
71
- - lib/symbiont/platform_selenium/platform_object.rb
72
- - lib/symbiont/platform_selenium/web_objects/button.rb
73
- - lib/symbiont/platform_selenium/web_objects/checkbox.rb
74
- - lib/symbiont/platform_selenium/web_objects/common.rb
75
- - lib/symbiont/platform_selenium/web_objects/link.rb
76
- - lib/symbiont/platform_selenium/web_objects/radio.rb
77
- - lib/symbiont/platform_selenium/web_objects/select_list.rb
78
- - lib/symbiont/platform_selenium/web_objects/table.rb
79
- - lib/symbiont/platform_selenium/web_objects/table_row.rb
80
- - lib/symbiont/platform_selenium/web_objects/text_field.rb
81
160
  - lib/symbiont/platform_watir.rb
82
161
  - lib/symbiont/platform_watir/platform_object.rb
83
- - lib/symbiont/platform_watir/web_objects/checkbox.rb
84
- - lib/symbiont/platform_watir/web_objects/common.rb
85
- - lib/symbiont/platform_watir/web_objects/radio.rb
86
- - lib/symbiont/platform_watir/web_objects/select_list.rb
87
- - lib/symbiont/platform_watir/web_objects/table.rb
88
- - lib/symbiont/platform_watir/web_objects/table_row.rb
89
- - lib/symbiont/platform_watir/web_objects/text_field.rb
90
162
  - lib/symbiont/platforms.rb
91
163
  - lib/symbiont/version.rb
92
164
  - lib/symbiont/web_objects.rb
@@ -114,6 +186,7 @@ files:
114
186
  - spec/symbiont/generators/checkbox_generators_spec.rb
115
187
  - spec/symbiont/generators/div_generators_spec.rb
116
188
  - spec/symbiont/generators/link_generators_spec.rb
189
+ - spec/symbiont/generators/paragraph_generators_spec.rb
117
190
  - spec/symbiont/generators/radio_generators_spec.rb
118
191
  - spec/symbiont/generators/select_list_generators_spec.rb
119
192
  - spec/symbiont/generators/span_generators_spec.rb
@@ -129,6 +202,7 @@ files:
129
202
  - spec/symbiont/web_objects/div_spec.rb
130
203
  - spec/symbiont/web_objects/link_spec.rb
131
204
  - spec/symbiont/web_objects/option_spec.rb
205
+ - spec/symbiont/web_objects/paragraph_spec.rb
132
206
  - spec/symbiont/web_objects/radio_spec.rb
133
207
  - spec/symbiont/web_objects/select_list_spec.rb
134
208
  - spec/symbiont/web_objects/span_spec.rb
@@ -1,236 +0,0 @@
1
- module Symbiont
2
- module Platforms
3
- module SeleniumWebDriver
4
-
5
- class PlatformObject
6
- def initialize(browser)
7
- @browser = browser
8
- end
9
-
10
- ## Browser-Level Actions ##
11
-
12
- def visit(url)
13
- @browser.navigate.to(url)
14
- end
15
-
16
- def url
17
- @browser.current_url
18
- end
19
-
20
- def screenshot(file)
21
- @browser.save_screenshot(file)
22
- end
23
-
24
- def run_script(script)
25
- @browser.execute_script(script)
26
- end
27
-
28
- def back
29
- @browser.navigate.back
30
- end
31
-
32
- ## Page-Level Actions ##
33
-
34
- def text
35
- @browser.find_element(:tag_name, 'body').text
36
- end
37
-
38
- def markup
39
- @browser.page_source
40
- end
41
-
42
- def title
43
- @browser.title
44
- end
45
-
46
- def focus
47
- web_object = @browser.execute_script("return document.activeElement")
48
- type = web_object.attribute(:type).to_s.downcase if web_object.tag_name.to_sym == :input
49
- object_class = ::Symbiont::WebObjects.get_class_for(web_object.tag_name, type)
50
- object_class.new(web_object, :platform => :selenium_webdriver)
51
- end
52
-
53
- ## Encloser Methods ##
54
-
55
- # Platform method to wait for an action to complete in a given time.
56
- # @see Symbiont::Enclosers#wait_for
57
- def wait_for(timeout, message="wait condition not found", &block)
58
- wait = ::Selenium::WebDriver::Wait.new({:timeout => timeout, :message => message})
59
- wait.until &block
60
- end
61
-
62
- ## Generator Methods ##
63
-
64
- ## Paragraphs **
65
-
66
- def paragraph_element(locator)
67
- reference_web_object(locator, WebObjects::Paragraph, 'p')
68
- end
69
-
70
- def paragraph_text_for(locator)
71
- access_web_object(locator, WebObjects::Paragraph, 'p') do |how, what|
72
- @browser.find_element(how, what).text
73
- end
74
- end
75
-
76
- ## Links ##
77
-
78
- def link_element(locator)
79
- reference_web_object(locator, WebObjects::Link, 'a')
80
- end
81
-
82
- def click_link_for(locator)
83
- access_web_object(locator, WebObjects::Link, 'a') do |how, what|
84
- @browser.find_element(how, what).click
85
- end
86
- end
87
-
88
- ## Buttons ##
89
-
90
- def button_element(locator)
91
- reference_web_object(locator, WebObjects::Button, 'input', :type => 'submit')
92
- end
93
-
94
- def click_button_for(locator)
95
- access_web_object(locator, WebObjects::Button, 'input', :type => 'submit') do |how, what|
96
- @browser.find_element(how, what).click
97
- end
98
- end
99
-
100
- ## Text Fields ##
101
-
102
- def text_field_element(locator)
103
- reference_web_object(locator, WebObjects::TextField, 'input', :type => 'text')
104
- end
105
-
106
- def get_text_field_value_for(locator)
107
- access_web_object(locator, WebObjects::TextField, 'input', :type => 'text') do |how, what|
108
- @browser.find_element(how, what).attribute('value')
109
- end
110
- end
111
-
112
- def set_text_field_value_for(locator, value)
113
- access_web_object(locator, WebObjects::TextField, 'input', :type => 'text') do |how, what|
114
- @browser.find_element(how, what).clear
115
- @browser.find_element(how, what).send_keys(value)
116
- end
117
- end
118
-
119
- ## Checkboxes ##
120
-
121
- def checkbox_element(locator)
122
- reference_web_object(locator, WebObjects::CheckBox, 'input', :type => 'checkbox')
123
- end
124
-
125
- def check_checkbox_for_checked(locator)
126
- access_web_object(locator, WebObjects::CheckBox, 'input', :type => 'checkbox') do |how, what|
127
- @browser.find_element(how, what).selected?
128
- end
129
- end
130
-
131
- def check_checkbox_for(locator)
132
- access_web_object(locator, WebObjects::CheckBox, 'input', :type => 'checkbox') do |how, what|
133
- @browser.find_element(how, what).click unless @browser.find_element(how, what).selected?
134
- end
135
- end
136
-
137
- def uncheck_checkbox_for(locator)
138
- access_web_object(locator, WebObjects::CheckBox, 'input', :type => 'checkbox') do |how, what|
139
- @browser.find_element(how, what).click if @browser.find_element(how, what).selected?
140
- end
141
- end
142
-
143
- ## Select Lists ##
144
-
145
- def select_list_element(locator)
146
- reference_web_object(locator, WebObjects::SelectList, 'select')
147
- end
148
-
149
- def get_select_list_item_for(locator)
150
- access_web_object(locator, WebObjects::SelectList, 'select') do |how, what|
151
- selected = nil
152
- @browser.find_element(how, what).find_elements(:tag_name => 'option').each do |o|
153
- if selected.nil?
154
- selected = o.text if o.selected?
155
- end
156
- end
157
- selected
158
- end
159
- end
160
-
161
- def get_select_list_value_for(locator)
162
- access_web_object(locator, WebObjects::SelectList, 'select') do |how, what|
163
- @browser.find_element(how, what).attribute('value')
164
- end
165
- end
166
-
167
- def set_select_list_value_for(locator, value)
168
- access_web_object(locator, WebObjects::SelectList, 'select') do |how, what|
169
- select_list = @browser.find_element(how, what)
170
- select_list.find_elements(:tag_name => 'option').find do |option|
171
- option.text == value
172
- end.click
173
- end
174
- end
175
-
176
- ## Radios ##
177
-
178
- def radio_element(locator)
179
- reference_web_object(locator, WebObjects::Radio, 'input', :type => 'radio')
180
- end
181
-
182
- def check_radio_for_selected(locator)
183
- access_web_object(locator, WebObjects::Radio, 'input', :type => 'radio') do |how, what|
184
- @browser.find_element(how, what).selected?
185
- end
186
- end
187
-
188
- def select_radio_for(locator)
189
- access_web_object(locator, WebObjects::Radio, 'input', :type => 'radio') do |how, what|
190
- @browser.find_element(how, what).click unless @browser.find_element(how, what).selected?
191
- end
192
- end
193
-
194
- def div_element(locator)
195
- reference_web_object(locator, WebObjects::Div, 'div')
196
- end
197
-
198
- def span_element(locator)
199
- reference_web_object(locator, WebObjects::Span, 'span')
200
- end
201
-
202
- private
203
-
204
- def reference_web_object(locator, object_type, object_tag, type=nil)
205
- enclosers = locator.delete(:frame)
206
- enter_encloser_context_for(enclosers)
207
- how, what = object_type.provide_selenium_locator_for(locator)
208
- web_object = @browser.find_element(how, what)
209
- object_type.new(web_object, :platform => :selenium_webdriver)
210
- end
211
-
212
- def access_web_object(locator, object_type, object_tag, type=nil)
213
- enclosers = locator.delete(:frame)
214
- enter_encloser_context_for(enclosers)
215
- how, what = object_type.provide_selenium_locator_for(locator)
216
- value = yield how, what
217
- @browser.switch_to.default_content unless enclosers.nil?
218
- value
219
- end
220
-
221
- def enter_encloser_context_for(enclosers)
222
- unless enclosers.nil?
223
- enclosers.each do |encloser|
224
- value = encloser.values.first
225
- @browser.switch_to.frame(value)
226
- end
227
- end
228
- end
229
- end # class: PlatformObject
230
-
231
- end # module: SeleniumWebDriver
232
- end # module: Platforms
233
- end # module: Symbiont
234
-
235
- require 'symbiont/web_objects'
236
- Dir["#{File.dirname(__FILE__)}/../web_objects/**/*.rb"].sort.each { |file| require file }
@@ -1,13 +0,0 @@
1
- module Symbiont
2
- module Platforms
3
- module SeleniumWebDriver
4
- module Button
5
-
6
- def text
7
- raise "Currently Selenium is not very good at grabbing text from a button."
8
- end
9
-
10
- end
11
- end
12
- end
13
- end
@@ -1,21 +0,0 @@
1
- module Symbiont
2
- module Platforms
3
- module SeleniumWebDriver
4
- module CheckBox
5
-
6
- def check
7
- web_object.click unless web_object.selected?
8
- end
9
-
10
- def uncheck
11
- web_object.click if web_object.selected?
12
- end
13
-
14
- def checked?
15
- web_object.selected?
16
- end
17
-
18
- end
19
- end
20
- end
21
- end