symbiont 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +22 -22
  4. data/.travis.yml +25 -14
  5. data/Gemfile +4 -2
  6. data/{LICENSE → LICENSE.txt} +22 -22
  7. data/README.md +57 -65
  8. data/Rakefile +28 -34
  9. data/lib/symbiont/accessor.rb +7 -0
  10. data/lib/symbiont/assertions.rb +33 -0
  11. data/lib/symbiont/elements.rb +69 -0
  12. data/lib/symbiont/errors.rb +7 -0
  13. data/lib/symbiont/factory.rb +75 -46
  14. data/lib/symbiont/helpers.rb +49 -0
  15. data/lib/symbiont/logging.rb +5 -0
  16. data/lib/symbiont/pages.rb +32 -0
  17. data/lib/symbiont/platform.rb +12 -0
  18. data/lib/symbiont/version.rb +3 -3
  19. data/lib/symbiont.rb +34 -92
  20. data/spec/fixtures/element_definitions.rb +32 -0
  21. data/spec/fixtures/mock_drivers.rb +8 -0
  22. data/spec/fixtures/page_definitions.rb +36 -0
  23. data/spec/spec_helper.rb +31 -80
  24. data/spec/symbiont/assertion_spec.rb +88 -0
  25. data/spec/symbiont/driver_spec.rb +41 -0
  26. data/spec/symbiont/element_spec.rb +8 -0
  27. data/spec/symbiont/factory_spec.rb +70 -130
  28. data/spec/symbiont/page_spec.rb +50 -0
  29. data/symbiont.gemspec +52 -27
  30. data/test/symbiont-script.rb +97 -0
  31. metadata +89 -230
  32. data/Gemfile.lock +0 -44
  33. data/HISTORY.md +0 -99
  34. data/app/app.rb +0 -48
  35. data/app/public/css/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png +0 -0
  36. data/app/public/css/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png +0 -0
  37. data/app/public/css/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png +0 -0
  38. data/app/public/css/cupertino/images/ui-bg_glass_50_3baae3_1x400.png +0 -0
  39. data/app/public/css/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png +0 -0
  40. data/app/public/css/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png +0 -0
  41. data/app/public/css/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png +0 -0
  42. data/app/public/css/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png +0 -0
  43. data/app/public/css/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png +0 -0
  44. data/app/public/css/cupertino/images/ui-icons_2694e8_256x240.png +0 -0
  45. data/app/public/css/cupertino/images/ui-icons_2e83ff_256x240.png +0 -0
  46. data/app/public/css/cupertino/images/ui-icons_3d80b3_256x240.png +0 -0
  47. data/app/public/css/cupertino/images/ui-icons_72a7cf_256x240.png +0 -0
  48. data/app/public/css/cupertino/images/ui-icons_ffffff_256x240.png +0 -0
  49. data/app/public/css/cupertino/jquery-ui-1.8.16.custom.css +0 -290
  50. data/app/public/css/demo_table_jui.css +0 -471
  51. data/app/public/css/font/ColabLig-webfont.eot +0 -0
  52. data/app/public/css/font/ColabLig-webfont.svg +0 -149
  53. data/app/public/css/font/ColabLig-webfont.ttf +0 -0
  54. data/app/public/css/font/ColabLig-webfont.woff +0 -0
  55. data/app/public/css/font/ColabMed-webfont.eot +0 -0
  56. data/app/public/css/font/ColabMed-webfont.svg +0 -149
  57. data/app/public/css/font/ColabMed-webfont.ttf +0 -0
  58. data/app/public/css/font/ColabMed-webfont.woff +0 -0
  59. data/app/public/css/font/ColabReg-webfont.eot +0 -0
  60. data/app/public/css/font/ColabReg-webfont.svg +0 -149
  61. data/app/public/css/font/ColabReg-webfont.ttf +0 -0
  62. data/app/public/css/font/ColabReg-webfont.woff +0 -0
  63. data/app/public/css/font/ColabThi-webfont.eot +0 -0
  64. data/app/public/css/font/ColabThi-webfont.svg +0 -149
  65. data/app/public/css/font/ColabThi-webfont.ttf +0 -0
  66. data/app/public/css/font/ColabThi-webfont.woff +0 -0
  67. data/app/public/css/normalize.css +0 -376
  68. data/app/public/css/site.css +0 -446
  69. data/app/public/fancybox/blank.gif +0 -0
  70. data/app/public/fancybox/fancy_close.png +0 -0
  71. data/app/public/fancybox/fancy_loading.png +0 -0
  72. data/app/public/fancybox/fancy_nav_left.png +0 -0
  73. data/app/public/fancybox/fancy_nav_right.png +0 -0
  74. data/app/public/fancybox/fancy_shadow_e.png +0 -0
  75. data/app/public/fancybox/fancy_shadow_n.png +0 -0
  76. data/app/public/fancybox/fancy_shadow_ne.png +0 -0
  77. data/app/public/fancybox/fancy_shadow_nw.png +0 -0
  78. data/app/public/fancybox/fancy_shadow_s.png +0 -0
  79. data/app/public/fancybox/fancy_shadow_se.png +0 -0
  80. data/app/public/fancybox/fancy_shadow_sw.png +0 -0
  81. data/app/public/fancybox/fancy_shadow_w.png +0 -0
  82. data/app/public/fancybox/fancy_title_left.png +0 -0
  83. data/app/public/fancybox/fancy_title_main.png +0 -0
  84. data/app/public/fancybox/fancy_title_over.png +0 -0
  85. data/app/public/fancybox/fancy_title_right.png +0 -0
  86. data/app/public/fancybox/fancybox-x.png +0 -0
  87. data/app/public/fancybox/fancybox-y.png +0 -0
  88. data/app/public/fancybox/fancybox.png +0 -0
  89. data/app/public/fancybox/jquery.fancybox-1.3.4.css +0 -359
  90. data/app/public/fancybox/jquery.fancybox-1.3.4.js +0 -1156
  91. data/app/public/fancybox/jquery.fancybox-1.3.4.min.js +0 -1
  92. data/app/public/img/Sorting icons.psd +0 -0
  93. data/app/public/img/back_disabled.png +0 -0
  94. data/app/public/img/back_enabled.png +0 -0
  95. data/app/public/img/back_enabled_hover.png +0 -0
  96. data/app/public/img/close.png +0 -0
  97. data/app/public/img/favicon.ico +0 -0
  98. data/app/public/img/forward_disabled.png +0 -0
  99. data/app/public/img/forward_enabled.png +0 -0
  100. data/app/public/img/forward_enabled_hover.png +0 -0
  101. data/app/public/img/lucid-bg.png +0 -0
  102. data/app/public/img/lucid-ft.png +0 -0
  103. data/app/public/img/open.png +0 -0
  104. data/app/public/img/sort_asc.png +0 -0
  105. data/app/public/img/sort_asc_disabled.png +0 -0
  106. data/app/public/img/sort_both.png +0 -0
  107. data/app/public/img/sort_desc.png +0 -0
  108. data/app/public/img/sort_desc_disabled.png +0 -0
  109. data/app/public/js/comics.js +0 -11
  110. data/app/public/js/signup.js +0 -141
  111. data/app/public/js/site.js +0 -42
  112. data/app/public/js/stardate.js +0 -35
  113. data/app/public/js/vendor/html5shiv.js +0 -5
  114. data/app/public/js/vendor/jquery-1.8.3.min.js +0 -2
  115. data/app/public/js/vendor/jquery.dataTables.min.js +0 -151
  116. data/app/public/js/vendor/jquery.validate.min.js +0 -4
  117. data/app/views/comics.erb +0 -344
  118. data/app/views/index.erb +0 -7
  119. data/app/views/layout.erb +0 -72
  120. data/app/views/layout_small.erb +0 -21
  121. data/app/views/stardate.erb +0 -5
  122. data/app/views/stardate_calc.erb +0 -30
  123. data/app/views/webobject.erb +0 -147
  124. data/lib/symbiont/data_setter.rb +0 -53
  125. data/lib/symbiont/enclosers.rb +0 -118
  126. data/lib/symbiont/evaluators.rb +0 -92
  127. data/lib/symbiont/generators.rb +0 -331
  128. data/lib/symbiont/locators.rb +0 -43
  129. data/lib/symbiont/logger.rb +0 -5
  130. data/lib/symbiont/platform_watir/platform_object.rb +0 -466
  131. data/lib/symbiont/platform_watir.rb +0 -9
  132. data/lib/symbiont/platforms.rb +0 -23
  133. data/lib/symbiont/web_objects/_common.rb +0 -174
  134. data/lib/symbiont/web_objects/button.rb +0 -22
  135. data/lib/symbiont/web_objects/checkbox.rb +0 -31
  136. data/lib/symbiont/web_objects/div.rb +0 -15
  137. data/lib/symbiont/web_objects/heading.rb +0 -12
  138. data/lib/symbiont/web_objects/hidden_field.rb +0 -19
  139. data/lib/symbiont/web_objects/label.rb +0 -15
  140. data/lib/symbiont/web_objects/link.rb +0 -23
  141. data/lib/symbiont/web_objects/list_item.rb +0 -13
  142. data/lib/symbiont/web_objects/option.rb +0 -10
  143. data/lib/symbiont/web_objects/ordered_list.rb +0 -49
  144. data/lib/symbiont/web_objects/paragraph.rb +0 -11
  145. data/lib/symbiont/web_objects/radio.rb +0 -31
  146. data/lib/symbiont/web_objects/select_list.rb +0 -82
  147. data/lib/symbiont/web_objects/span.rb +0 -15
  148. data/lib/symbiont/web_objects/table.rb +0 -71
  149. data/lib/symbiont/web_objects/table_cell.rb +0 -24
  150. data/lib/symbiont/web_objects/table_row.rb +0 -59
  151. data/lib/symbiont/web_objects/text_area.rb +0 -26
  152. data/lib/symbiont/web_objects/text_field.rb +0 -31
  153. data/lib/symbiont/web_objects/unordered_list.rb +0 -49
  154. data/lib/symbiont/web_objects.rb +0 -22
  155. data/lucid.yml +0 -6
  156. data/spec/symbiont/data_setter_spec.rb +0 -65
  157. data/spec/symbiont/enclosers_spec.rb +0 -76
  158. data/spec/symbiont/evaluators_spec.rb +0 -95
  159. data/spec/symbiont/generators/button_generators_spec.rb +0 -72
  160. data/spec/symbiont/generators/checkbox_generators_spec.rb +0 -79
  161. data/spec/symbiont/generators/div_generators_spec.rb +0 -56
  162. data/spec/symbiont/generators/hidden_field_generators_spec.rb +0 -65
  163. data/spec/symbiont/generators/link_generators_spec.rb +0 -62
  164. data/spec/symbiont/generators/paragraph_generators_spec.rb +0 -57
  165. data/spec/symbiont/generators/radio_generators_spec.rb +0 -76
  166. data/spec/symbiont/generators/select_list_generators_spec.rb +0 -93
  167. data/spec/symbiont/generators/span_generators_spec.rb +0 -56
  168. data/spec/symbiont/generators/table_cell_generators_spec.rb +0 -56
  169. data/spec/symbiont/generators/table_generators_spec.rb +0 -56
  170. data/spec/symbiont/generators/text_area_generators_spec.rb +0 -72
  171. data/spec/symbiont/generators/text_field_generators_spec.rb +0 -72
  172. data/spec/symbiont/generators_spec.rb +0 -59
  173. data/spec/symbiont/locators_spec.rb +0 -68
  174. data/spec/symbiont/platform_object_spec.rb +0 -18
  175. data/spec/symbiont/symbiont_spec.rb +0 -29
  176. data/spec/symbiont/web_object_spec.rb +0 -194
  177. data/spec/symbiont/web_objects/button_spec.rb +0 -38
  178. data/spec/symbiont/web_objects/checkbox_spec.rb +0 -27
  179. data/spec/symbiont/web_objects/div_spec.rb +0 -18
  180. data/spec/symbiont/web_objects/heading_spec.rb +0 -22
  181. data/spec/symbiont/web_objects/hidden_field_spec.rb +0 -18
  182. data/spec/symbiont/web_objects/label_spec.rb +0 -18
  183. data/spec/symbiont/web_objects/link_spec.rb +0 -33
  184. data/spec/symbiont/web_objects/list_item_spec.rb +0 -18
  185. data/spec/symbiont/web_objects/option_spec.rb +0 -9
  186. data/spec/symbiont/web_objects/ordered_list_spec.rb +0 -53
  187. data/spec/symbiont/web_objects/paragraph_spec.rb +0 -18
  188. data/spec/symbiont/web_objects/radio_spec.rb +0 -27
  189. data/spec/symbiont/web_objects/select_list_spec.rb +0 -69
  190. data/spec/symbiont/web_objects/span_spec.rb +0 -18
  191. data/spec/symbiont/web_objects/table_cell_spec.rb +0 -19
  192. data/spec/symbiont/web_objects/table_row_spec.rb +0 -58
  193. data/spec/symbiont/web_objects/table_spec.rb +0 -61
  194. data/spec/symbiont/web_objects/text_area_spec.rb +0 -18
  195. data/spec/symbiont/web_objects/text_field_spec.rb +0 -39
  196. data/spec/symbiont/web_objects/unordered_list_spec.rb +0 -51
  197. data/specs/common/support/browser.rb +0 -25
  198. data/specs/common/support/env.rb +0 -6
  199. data/specs/common/support/events.rb +0 -15
  200. data/specs/enclosers.feature +0 -9
  201. data/specs/evaluators.feature +0 -26
  202. data/specs/pages/characters.rb +0 -22
  203. data/specs/pages/home.rb +0 -9
  204. data/specs/pages/stardate.rb +0 -23
  205. data/specs/pages/web_objects.rb +0 -77
  206. data/specs/select_list.feature +0 -53
  207. data/specs/steps/enclosers_steps.rb +0 -17
  208. data/specs/steps/evaluators_steps.rb +0 -44
  209. data/specs/steps/navigation_steps.rb +0 -14
  210. data/specs/steps/select_list_steps.rb +0 -94
  211. data/specs/steps/table_cell_steps.rb +0 -31
  212. data/specs/steps/table_steps.rb +0 -87
  213. data/specs/table.feature +0 -49
  214. data/specs/table_cell.feature +0 -27
@@ -1,76 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::Generators do
4
- let(:watir_browser) { mock_browser_for_watir }
5
- let(:watir_definition) { DefinitionTest.new(watir_browser) }
6
-
7
- describe "radio web objects" do
8
- context "when declared on a page definition" do
9
- it "should generate methods for referencing the radio" do
10
- watir_definition.should respond_to(:include_tax_radio)
11
- watir_definition.should respond_to(:include_tax_object)
12
- end
13
-
14
- it "should generate methods for interacting with the radio" do
15
- watir_definition.should respond_to(:include_tax_exists?)
16
- watir_definition.should respond_to(:include_tax_visible?)
17
- watir_definition.should respond_to(:include_tax_enabled?)
18
- watir_definition.should respond_to(:include_tax?)
19
- watir_definition.should respond_to(:include_tax_?)
20
- watir_definition.should respond_to(:include_tax!)
21
- watir_definition.should respond_to(:include_tax_selected?)
22
- watir_definition.should respond_to(:include_tax_set?)
23
- watir_definition.should respond_to(:set_include_tax)
24
- end
25
- end
26
-
27
- context "when used by the watir platform" do
28
- it "should locate the radio" do
29
- watir_browser.should_receive(:radio).and_return(watir_browser)
30
- web_object = watir_definition.include_tax_radio
31
- web_object.should_not be_nil
32
- web_object.should be_instance_of Symbiont::WebObjects::Radio
33
- end
34
-
35
- it "should determine if a radio exists" do
36
- watir_browser.should_receive(:radio).twice.and_return(watir_browser)
37
- watir_browser.should_receive(:exists?).twice.and_return(watir_browser)
38
- watir_definition.include_tax_exists?.should be_true
39
- watir_definition.include_tax?.should be_true
40
- end
41
-
42
- it "should determine if a radio is visible" do
43
- watir_browser.should_receive(:radio).twice.and_return(watir_browser)
44
- watir_browser.should_receive(:present?).twice.and_return(watir_browser)
45
- watir_definition.include_tax_visible?.should be_true
46
- watir_definition.include_tax_?.should be_true
47
- end
48
-
49
- it "should determine if a radio is enabled" do
50
- watir_browser.should_receive(:radio).twice.and_return(watir_browser)
51
- watir_browser.should_receive(:enabled?).twice.and_return(watir_browser)
52
- watir_definition.include_tax_enabled?.should be_true
53
- watir_definition.include_tax!.should be_true
54
- end
55
-
56
- it "should determine if a radio is set" do
57
- watir_browser.should_receive(:radio).twice.and_return(watir_browser)
58
- watir_browser.should_receive(:set?).twice.and_return(watir_browser)
59
- watir_definition.include_tax_selected?.should be_true
60
- watir_definition.include_tax_set?.should be_true
61
- end
62
-
63
- it "should set a radio" do
64
- watir_browser.should_receive(:radio).twice.and_return(watir_browser)
65
- watir_browser.should_receive(:set).twice.and_return(watir_browser)
66
- watir_definition.select_include_tax
67
- watir_definition.set_include_tax
68
- end
69
-
70
- it "should call a block on the radio if specified" do
71
- watir_definition.include_fee_object.should == "include_fee"
72
- end
73
- end
74
-
75
- end
76
- end
@@ -1,93 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::Generators do
4
- let(:watir_browser) { mock_browser_for_watir }
5
- let(:watir_definition) { DefinitionTest.new(watir_browser) }
6
-
7
- describe "select list web objects" do
8
- context "when declared in a definition" do
9
- it "should generate methods for referencing the select list" do
10
- watir_definition.should respond_to(:concepts_select_list)
11
- watir_definition.should respond_to(:concepts_object)
12
- end
13
-
14
- it "should generate methods for interacting with the select list" do
15
- watir_definition.should respond_to(:concepts)
16
- watir_definition.should respond_to(:concepts_option?)
17
- watir_definition.should respond_to(:concepts_exists?)
18
- watir_definition.should respond_to(:concepts_visible?)
19
- watir_definition.should respond_to(:concepts_enabled?)
20
- watir_definition.should respond_to(:concepts?)
21
- watir_definition.should respond_to(:concepts_?)
22
- watir_definition.should respond_to(:concepts!)
23
- watir_definition.should respond_to(:concepts=)
24
- end
25
- end
26
-
27
- context "when used by the watir platform" do
28
- it "should locate the select list" do
29
- watir_browser.should_receive(:select_list).and_return(watir_browser)
30
- web_object = watir_definition.concepts_object
31
- web_object.should_not be_nil
32
- web_object.should be_instance_of Symbiont::WebObjects::SelectList
33
- end
34
-
35
- it "should retrieve the current value of a selected option" do
36
- watir_browser.should_receive(:select_list).and_return(watir_browser)
37
- watir_browser.should_receive(:value).and_return("testing")
38
- watir_definition.concepts_option?.should == "testing"
39
- end
40
-
41
- it "should retrieve the current selection from the select list" do
42
- selected = "testing"
43
- selected.should_receive(:text).and_return("testing")
44
- watir_browser.should_receive(:select_list).and_return(watir_browser)
45
- watir_browser.should_receive(:selected_options).and_return([selected])
46
- watir_definition.concepts.should == "testing"
47
- end
48
-
49
- it "should select an item from the select list" do
50
- watir_browser.should_receive(:select_list).and_return watir_browser
51
- watir_browser.should_receive(:select).with("testing")
52
- watir_definition.concepts = "testing"
53
- end
54
-
55
- it "should retrieve a list of selection options" do
56
- option1 = double('option')
57
- option2 = double('option')
58
- option1.should_receive(:text).and_return("concept1")
59
- option2.should_receive(:text).and_return("concept2")
60
-
61
- select_element = double("select")
62
- select_element.should_receive(:options).twice.and_return([option1, option2])
63
- watir_definition.should_receive(:concepts_object).and_return(select_element)
64
- watir_definition.concepts_options?.should == ["concept1","concept2"]
65
- end
66
-
67
- it "should determine if a select list exists" do
68
- watir_browser.should_receive(:select_list).twice.and_return(watir_browser)
69
- watir_browser.should_receive(:exists?).twice.and_return(watir_browser)
70
- watir_definition.concepts_exists?.should be_true
71
- watir_definition.concepts?.should be_true
72
- end
73
-
74
- it "should determine if a select list is visible" do
75
- watir_browser.should_receive(:select_list).twice.and_return(watir_browser)
76
- watir_browser.should_receive(:present?).twice.and_return(watir_browser)
77
- watir_definition.concepts_visible?.should be_true
78
- watir_definition.concepts_?.should be_true
79
- end
80
-
81
- it "should determine if a select list is enabled" do
82
- watir_browser.should_receive(:select_list).twice.and_return(watir_browser)
83
- watir_browser.should_receive(:enabled?).twice.and_return(watir_browser)
84
- watir_definition.concepts_enabled?.should be_true
85
- watir_definition.concepts!.should be_true
86
- end
87
-
88
- it "should call a block on the select list if specified" do
89
- watir_definition.topics_object.should == "topics"
90
- end
91
- end
92
- end
93
- end
@@ -1,56 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::Generators do
4
- let(:watir_browser) { mock_browser_for_watir }
5
- let(:watir_definition) { DefinitionTest.new(watir_browser) }
6
-
7
- describe "span generators" do
8
- context "when declared in a definition" do
9
- it "should generate methods for referencing the span" do
10
- watir_definition.should respond_to(:inline_span)
11
- watir_definition.should respond_to(:inline_object)
12
- end
13
-
14
- it "should generate methods for interacting with the span" do
15
- watir_definition.should respond_to(:inline_exists?)
16
- watir_definition.should respond_to(:inline_visible?)
17
- watir_definition.should respond_to(:inline?)
18
- watir_definition.should respond_to(:inline_?)
19
- watir_definition.should respond_to(:inline)
20
- end
21
- end
22
-
23
- context "when used by the watir platform" do
24
- it "should locate the span" do
25
- watir_browser.should_receive(:span).and_return(watir_browser)
26
- web_object = watir_definition.inline_span
27
- web_object.should_not be_nil
28
- web_object.should be_instance_of Symbiont::WebObjects::Span
29
- end
30
-
31
- it "should determine if a span exists" do
32
- watir_browser.should_receive(:span).twice.and_return(watir_browser)
33
- watir_browser.should_receive(:exists?).twice.and_return(watir_browser)
34
- watir_definition.inline_exists?.should be_true
35
- watir_definition.inline?.should be_true
36
- end
37
-
38
- it "should determine if a span is visible" do
39
- watir_browser.should_receive(:span).twice.and_return(watir_browser)
40
- watir_browser.should_receive(:present?).twice.and_return(watir_browser)
41
- watir_definition.inline_visible?.should be_true
42
- watir_definition.inline_?.should be_true
43
- end
44
-
45
- it "should return the text of a span" do
46
- watir_browser.should_receive(:span).and_return(watir_browser)
47
- watir_browser.should_receive(:text).and_return("testing")
48
- watir_definition.inline.should == "testing"
49
- end
50
-
51
- it "should call a block on the span if specified" do
52
- watir_definition.part_object.should == "part"
53
- end
54
- end
55
- end
56
- end
@@ -1,56 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::Generators do
4
- let(:watir_browser) { mock_browser_for_watir }
5
- let(:watir_definition) { DefinitionTest.new(watir_browser) }
6
-
7
- describe "table cell generators" do
8
- context "when declared on a page definition" do
9
- it "should generate methods for referencing the cell" do
10
- watir_definition.should respond_to(:total_cell)
11
- watir_definition.should respond_to(:total_object)
12
- end
13
-
14
- it "should generate methods for interacting with the cell" do
15
- watir_definition.should respond_to(:total_exists?)
16
- watir_definition.should respond_to(:total_visible?)
17
- watir_definition.should respond_to(:total?)
18
- watir_definition.should respond_to(:total_?)
19
- watir_definition.should respond_to(:total)
20
- end
21
- end
22
-
23
- context "when used by the watir platform" do
24
- it "should locate the table cell" do
25
- watir_browser.should_receive(:td).and_return(watir_browser)
26
- web_object = watir_definition.total_cell
27
- web_object.should_not be_nil
28
- web_object.should be_instance_of Symbiont::WebObjects::TableCell
29
- end
30
-
31
- it "should determine if a table cell exists" do
32
- watir_browser.should_receive(:td).twice.and_return(watir_browser)
33
- watir_browser.should_receive(:exists?).twice.and_return(watir_browser)
34
- watir_definition.total_exists?.should be_true
35
- watir_definition.total?.should be_true
36
- end
37
-
38
- it "should determine if a table cell is visible" do
39
- watir_browser.should_receive(:td).twice.and_return(watir_browser)
40
- watir_browser.should_receive(:present?).twice.and_return(watir_browser)
41
- watir_definition.total_visible?.should be_true
42
- watir_definition.total_?.should be_true
43
- end
44
-
45
- it "should return the text of a table cell" do
46
- watir_browser.should_receive(:td).and_return(watir_browser)
47
- watir_browser.should_receive(:text).and_return("testing")
48
- watir_definition.total.should == "testing"
49
- end
50
-
51
- it "should call a block on the table cell if specified" do
52
- watir_definition.sum_object.should == "sum"
53
- end
54
- end
55
- end
56
- end
@@ -1,56 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::Generators do
4
- let(:watir_browser) { mock_browser_for_watir }
5
- let(:watir_definition) { DefinitionTest.new(watir_browser) }
6
-
7
- describe "table generators" do
8
- context "when declared on a page definition" do
9
- it "should generate methods for referencing the table" do
10
- watir_definition.should respond_to(:accounts_table)
11
- watir_definition.should respond_to(:accounts_object)
12
- end
13
-
14
- it "should generate methods for interacting with the table" do
15
- watir_definition.should respond_to(:accounts_exists?)
16
- watir_definition.should respond_to(:accounts?)
17
- watir_definition.should respond_to(:accounts_visible?)
18
- watir_definition.should respond_to(:accounts_?)
19
- watir_definition.should respond_to(:accounts)
20
- end
21
- end
22
-
23
- context "when used by the watir platform" do
24
- it "should locate the table" do
25
- watir_browser.should_receive(:table).and_return(watir_browser)
26
- web_object = watir_definition.accounts_table
27
- web_object.should_not be_nil
28
- web_object.should be_instance_of Symbiont::WebObjects::Table
29
- end
30
-
31
- it "should determine if a table exists" do
32
- watir_browser.should_receive(:table).twice.and_return(watir_browser)
33
- watir_browser.should_receive(:exists?).twice.and_return(watir_browser)
34
- watir_definition.accounts_exists?.should be_true
35
- watir_definition.accounts?.should be_true
36
- end
37
-
38
- it "should determine if a table is visible" do
39
- watir_browser.should_receive(:table).twice.and_return(watir_browser)
40
- watir_browser.should_receive(:present?).twice.and_return(watir_browser)
41
- watir_definition.accounts_visible?.should be_true
42
- watir_definition.accounts_?.should be_true
43
- end
44
-
45
- it "should return the text of a table" do
46
- watir_browser.should_receive(:table).and_return(watir_browser)
47
- watir_browser.should_receive(:text).and_return("testing")
48
- watir_definition.accounts.should == "testing"
49
- end
50
-
51
- it "should call a block on the table if specified" do
52
- watir_definition.invoices_object.should == "invoices"
53
- end
54
- end
55
- end
56
- end
@@ -1,72 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::Generators do
4
- let(:watir_browser) { mock_browser_for_watir }
5
- let(:watir_definition) { DefinitionTest.new(watir_browser) }
6
-
7
- describe "text area generators" do
8
- context "when declared on a page definition" do
9
- it "should generate methods for referencing the text area" do
10
- watir_definition.should respond_to(:summary_text_area)
11
- watir_definition.should respond_to(:summary_object)
12
- end
13
-
14
- it "should generate methods for interacting with the text area" do
15
- watir_definition.should respond_to(:summary)
16
- watir_definition.should respond_to(:summary_exists?)
17
- watir_definition.should respond_to(:summary_visible?)
18
- watir_definition.should respond_to(:summary_enabled?)
19
- watir_definition.should respond_to(:summary?)
20
- watir_definition.should respond_to(:summary_?)
21
- watir_definition.should respond_to(:summary!)
22
- watir_definition.should respond_to(:summary=)
23
- end
24
- end
25
-
26
- context "when used by the watir platform" do
27
- it "should locate the text area" do
28
- watir_browser.should_receive(:text_area).and_return(watir_browser)
29
- web_object = watir_definition.summary_object
30
- web_object.should_not be_nil
31
- web_object.should be_instance_of Symbiont::WebObjects::TextArea
32
- end
33
-
34
- it "should retrieve text from the text area" do
35
- watir_browser.should_receive(:text_area).and_return(watir_browser)
36
- watir_browser.should_receive(:value).and_return("testing")
37
- watir_definition.summary.should == "testing"
38
- end
39
-
40
- it "should enter text into a text area" do
41
- watir_browser.should_receive(:text_area).and_return(watir_browser)
42
- watir_browser.should_receive(:set).with("testing")
43
- watir_definition.summary = "testing"
44
- end
45
-
46
- it "should determine if a text area exists" do
47
- watir_browser.should_receive(:text_area).twice.and_return(watir_browser)
48
- watir_browser.should_receive(:exists?).twice.and_return(watir_browser)
49
- watir_definition.summary_exists?.should be_true
50
- watir_definition.summary?.should be_true
51
- end
52
-
53
- it "should determine if a text area is visible" do
54
- watir_browser.should_receive(:text_area).twice.and_return(watir_browser)
55
- watir_browser.should_receive(:present?).twice.and_return(watir_browser)
56
- watir_definition.summary_visible?.should be_true
57
- watir_definition.summary_?.should be_true
58
- end
59
-
60
- it "should determine if a text area is enabled" do
61
- watir_browser.should_receive(:text_area).twice.and_return(watir_browser)
62
- watir_browser.should_receive(:enabled?).twice.and_return(watir_browser)
63
- watir_definition.summary_enabled?.should be_true
64
- watir_definition.summary!.should be_true
65
- end
66
-
67
- it "should call a block on the text area if specified" do
68
- watir_definition.description_object.should == "description"
69
- end
70
- end
71
- end
72
- end
@@ -1,72 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::Generators do
4
- let(:watir_browser) { mock_browser_for_watir }
5
- let(:watir_definition) { DefinitionTest.new(watir_browser) }
6
-
7
- describe "text field generators" do
8
- context "when declared on a page definition" do
9
- it "should generate methods for referencing the text field" do
10
- watir_definition.should respond_to(:name_text_field)
11
- watir_definition.should respond_to(:name_object)
12
- end
13
-
14
- it "should generate methods for interacting with the text field" do
15
- watir_definition.should respond_to(:name)
16
- watir_definition.should respond_to(:name_exists?)
17
- watir_definition.should respond_to(:name_visible?)
18
- watir_definition.should respond_to(:name_enabled?)
19
- watir_definition.should respond_to(:name?)
20
- watir_definition.should respond_to(:name_?)
21
- watir_definition.should respond_to(:name!)
22
- watir_definition.should respond_to(:name=)
23
- end
24
- end
25
-
26
- context "when used by the watir platform" do
27
- it "should locate the text field" do
28
- watir_browser.should_receive(:text_field).and_return(watir_browser)
29
- web_object = watir_definition.name_object
30
- web_object.should_not be_nil
31
- web_object.should be_instance_of Symbiont::WebObjects::TextField
32
- end
33
-
34
- it "should retrieve text from the text field" do
35
- watir_browser.should_receive(:text_field).and_return(watir_browser)
36
- watir_browser.should_receive(:value).and_return("testing")
37
- watir_definition.name.should == "testing"
38
- end
39
-
40
- it "should enter text into a text field" do
41
- watir_browser.should_receive(:text_field).and_return(watir_browser)
42
- watir_browser.should_receive(:set).with("testing")
43
- watir_definition.name = "testing"
44
- end
45
-
46
- it "should determine if a text field exists" do
47
- watir_browser.should_receive(:text_field).twice.and_return(watir_browser)
48
- watir_browser.should_receive(:exists?).twice.and_return(watir_browser)
49
- watir_definition.name_exists?.should be_true
50
- watir_definition.name?.should be_true
51
- end
52
-
53
- it "should determine if a text field is visible" do
54
- watir_browser.should_receive(:text_field).twice.and_return(watir_browser)
55
- watir_browser.should_receive(:present?).twice.and_return(watir_browser)
56
- watir_definition.name_visible?.should be_true
57
- watir_definition.name_?.should be_true
58
- end
59
-
60
- it "should determine if a text field is enabled" do
61
- watir_browser.should_receive(:text_field).twice.and_return(watir_browser)
62
- watir_browser.should_receive(:enabled?).twice.and_return(watir_browser)
63
- watir_definition.name_enabled?.should be_true
64
- watir_definition.name!.should be_true
65
- end
66
-
67
- it "should call a block on the element method if specified" do
68
- watir_definition.email_object.should == "email"
69
- end
70
- end
71
- end
72
- end
@@ -1,59 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::Generators do
4
- let(:watir_browser) { mock_browser_for_watir }
5
- let(:watir_definition) { DefinitionTest.new(watir_browser) }
6
-
7
- context "a definition using watir-webdriver" do
8
- context "providing a url" do
9
- it "should navigate to the page when viewed" do
10
- watir_browser.should_receive(:goto)
11
- watir_definition.view
12
- end
13
-
14
- it "should navigate to the page when started" do
15
- watir_browser.should_receive(:goto)
16
- watir_definition.start
17
- end
18
- end
19
- end
20
-
21
- context "automatically looking for an object" do
22
- it "should specify and verify an expected object" do
23
- watir_definition.should_receive(:name_object).and_return(watir_browser)
24
- watir_browser.should_receive(:when_actionable).with(5).and_return(watir_browser)
25
- watir_definition.has_object?
26
- end
27
-
28
- it "should raise an error if an expected object is not verified" do
29
- class QuickDefinition
30
- include Symbiont
31
- look_for :fakeLink
32
- end
33
- expect { QuickDefinition.new(watir_browser).has_object? }.to raise_error
34
- expect { QuickDefinition.new(watir_browser).should_not have_object }.to raise_error
35
- end
36
- end
37
-
38
- context "providing a page title to be verified" do
39
- it "should specify and verify the page title" do
40
- watir_browser.should_receive(:title).and_return("Symbiote")
41
- watir_definition.should have_title
42
- end
43
-
44
- it "should raise an error if the page title is not verified" do
45
- watir_browser.should_receive(:title).twice.and_return("Incorrect Title")
46
- expect { watir_definition.has_title? }.to raise_error
47
- end
48
-
49
- it "should validate the title if provided a regular expression" do
50
- class QuickDefinition
51
- include Symbiont
52
- title_is (/\w+/)
53
- end
54
- watir_browser.should_receive(:title).and_return("Symbiote")
55
- QuickDefinition.new(watir_browser).should have_title
56
- end
57
- end
58
-
59
- end
@@ -1,68 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::Locators do
4
- let(:watir_browser) { mock_browser_for_watir }
5
- let(:watir_definition) { DefinitionTest.new(watir_browser) }
6
-
7
- context "a definition using watir-webdriver" do
8
- it "should locate a link web object" do
9
- watir_browser.should_receive(:link).with(text: 'test').and_return(watir_browser)
10
- web_object = watir_definition.link_object(text: 'test')
11
- web_object.should be_instance_of Symbiont::WebObjects::Link
12
- end
13
-
14
- it "should locate a button web object" do
15
- watir_browser.should_receive(:button).with(value: 'test').and_return(watir_browser)
16
- web_object = watir_definition.button_object(value: 'test')
17
- web_object.should be_instance_of Symbiont::WebObjects::Button
18
- end
19
-
20
- it "should locate a text field web object" do
21
- watir_browser.should_receive(:text_field).with(id: 'test').and_return(watir_browser)
22
- web_object = watir_definition.text_field_object(id: 'test')
23
- web_object.should be_instance_of Symbiont::WebObjects::TextField
24
- end
25
-
26
- it "should locate a select list web object" do
27
- watir_browser.should_receive(:select_list).with(class: 'test').and_return(watir_browser)
28
- web_object = watir_definition.select_list_object(class: 'test')
29
- web_object.should be_instance_of Symbiont::WebObjects::SelectList
30
- end
31
-
32
- it "should locate a checkbox web object" do
33
- watir_browser.should_receive(:checkbox).with(id: 'test').and_return(watir_browser)
34
- web_object = watir_definition.checkbox_object(id: 'test')
35
- web_object.should be_instance_of Symbiont::WebObjects::CheckBox
36
- end
37
-
38
- it "should locate a radio web object" do
39
- watir_browser.should_receive(:radio).with(id: 'test').and_return(watir_browser)
40
- web_object = watir_definition.radio_object(id: 'test')
41
- web_object.should be_instance_of Symbiont::WebObjects::Radio
42
- end
43
-
44
- it "should locate a div web object" do
45
- watir_browser.should_receive(:div).with(id: 'test').and_return(watir_browser)
46
- web_object = watir_definition.div_object(id: 'test')
47
- web_object.should be_instance_of Symbiont::WebObjects::Div
48
- end
49
-
50
- it "should locate a span object" do
51
- watir_browser.should_receive(:span).with(id: 'test').and_return(watir_browser)
52
- web_object = watir_definition.span_object(id: 'test')
53
- web_object.should be_instance_of Symbiont::WebObjects::Span
54
- end
55
-
56
- it "should locate a table web object" do
57
- watir_browser.should_receive(:table).with(id: 'test').and_return(watir_browser)
58
- web_object = watir_definition.table_object(id: 'test')
59
- web_object.should be_instance_of Symbiont::WebObjects::Table
60
- end
61
-
62
- it "should locate a table cell web object" do
63
- watir_browser.should_receive(:td).with(id: 'test').and_return(watir_browser)
64
- web_object = watir_definition.cell_object(id: 'test')
65
- web_object.should be_instance_of Symbiont::WebObjects::TableCell
66
- end
67
- end
68
- end
@@ -1,18 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont do
4
- let(:watir_browser) { mock_browser_for_watir }
5
- let(:watir_definition) { DefinitionTest.new(watir_browser) }
6
-
7
- context "a definition using watir-webdriver" do
8
- it "should return a watir platform object" do
9
- watir_definition.platform.should be_kind_of Symbiont::Platforms::WatirWebDriver::PlatformObject
10
- end
11
- end
12
-
13
- context "an unrecognized browser" do
14
- it "should raise an exception" do
15
- expect { DefinitionTest.new(:unknown_browser) }.to raise_error
16
- end
17
- end
18
- end
@@ -1,29 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont do
4
- it "should return version information" do
5
- Symbiont.version.should == "Symbiont v#{Symbiont::VERSION}"
6
- end
7
-
8
- it "should set the page level wait default to 15" do
9
- Symbiont.instance_variable_set("@page_wait", nil)
10
- Symbiont.page_level_wait.should == 15
11
- end
12
-
13
- it "should be able to set a page level wait value" do
14
- Symbiont.page_level_wait = 30
15
- value = Symbiont.instance_variable_get("@page_wait")
16
- value.should == 30
17
- end
18
-
19
- it "should set the element level wait default to 5" do
20
- Symbiont.instance_variable_set("@element_wait", nil)
21
- Symbiont.element_level_wait.should == 5
22
- end
23
-
24
- it "should be able to set an element level wait value" do
25
- Symbiont.element_level_wait = 10
26
- value = Symbiont.instance_variable_get("@element_wait")
27
- value.should == 10
28
- end
29
- end