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,61 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::WebObjects::Table do
4
- describe "implementation" do
5
- let(:table_object) { double('table_object') }
6
- let(:table_row_object) { double('table_row_object') }
7
- let(:table) { Symbiont::WebObjects::Table }
8
-
9
- it "should reference standard usable selectors" do
10
- [:class, :id, :name, :index, :xpath].each do |s|
11
- locator = table.provide_locator_for s => 'value'
12
- locator.keys.first.should == s
13
- end
14
- end
15
-
16
- it "should register with a table tag" do
17
- ::Symbiont::WebObjects.get_class_for(:table).should == ::Symbiont::WebObjects::Table
18
- end
19
-
20
- context "on the watir platform" do
21
- let(:watir_table) { Symbiont::WebObjects::Table.new(table_object) }
22
-
23
- it "should return a table row when indexed" do
24
- table_object.stub(:[]).with(1).and_return(table_object)
25
- watir_table[1].should be_instance_of Symbiont::WebObjects::TableRow
26
- end
27
-
28
- it "should return the first row" do
29
- table_object.stub(:[]).with(0).and_return(table_object)
30
- watir_table.first_row.should be_instance_of Symbiont::WebObjects::TableRow
31
- end
32
-
33
- it "should return the last row" do
34
- table_object.stub(:[]).with(-1).and_return(table_object)
35
- watir_table.last_row.should be_instance_of Symbiont::WebObjects::TableRow
36
- end
37
-
38
- it "should return a row using text from the first column" do
39
- table_object.stub(:[]).with("row_text").and_return(table_object)
40
- table_object.should_receive(:rows).and_return(table_object)
41
- table_object.should_receive(:find_index).and_return("row_text")
42
- watir_table["row_text"].should be_instance_of Symbiont::WebObjects::TableRow
43
- end
44
-
45
- it "should return the number of rows" do
46
- table_object.should_receive(:wd).and_return(table_object)
47
- table_object.should_receive(:find_elements).with(:xpath, ".//child::tr").and_return(table_object)
48
- table_object.should_receive(:size).and_return(2)
49
- watir_table.rows.should == 2
50
- end
51
-
52
- it "should iterate over the table rows" do
53
- watir_table.should_receive(:rows).and_return(2)
54
- table_object.stub(:[]).and_return(table_object)
55
- count = 0
56
- watir_table.each { |e| count += 1 }
57
- count.should == 2
58
- end
59
- end
60
- end
61
- end
@@ -1,18 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::WebObjects::TextArea do
4
- describe "implementation" do
5
- let(:text_area_object) { Symbiont::WebObjects::TextArea }
6
-
7
- it "should reference standard usable selectors" do
8
- [:class, :id, :name, :index, :xpath, :title, :value, :text, :label].each do |s|
9
- locator = text_area_object.provide_locator_for s => 'value'
10
- locator.keys.first.should == s
11
- end
12
- end
13
-
14
- it "should register with a text area tag" do
15
- ::Symbiont::WebObjects.get_class_for(:textarea).should == ::Symbiont::WebObjects::TextArea
16
- end
17
- end
18
- end
@@ -1,39 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::WebObjects::TextField do
4
- describe "implementation" do
5
- let(:text_field_object) { double('text_field_object') }
6
- let(:text_field_definition) { ::Symbiont::WebObjects::TextField.new(text_field_object) }
7
- let(:text_field) { Symbiont::WebObjects::TextField }
8
-
9
- it "should reference standard usable selectors" do
10
- [:class, :id, :name, :index, :xpath].each do |s|
11
- locator = text_field.provide_locator_for s => 'value'
12
- locator.keys.first.should == s
13
- end
14
- end
15
-
16
- it "should get the value of a text field" do
17
- text_field_object.should_receive(:value).and_return("testing")
18
- text_field_definition.value.should == "testing"
19
- end
20
-
21
- it "should set the value of a text field" do
22
- text_field_object.should_receive(:set).with("testing")
23
- text_field_definition.value = "testing"
24
- end
25
-
26
- it "should append text to a text field" do
27
- text_field_object.should_receive(:send_keys).with("testing")
28
- text_field_definition.append "testing"
29
- end
30
-
31
- it "should register with a text type" do
32
- ::Symbiont::WebObjects.get_class_for(:input, :text).should == ::Symbiont::WebObjects::TextField
33
- end
34
-
35
- it "should register with a password type" do
36
- ::Symbiont::WebObjects.get_class_for(:input, :password).should == ::Symbiont::WebObjects::TextField
37
- end
38
- end
39
- end
@@ -1,51 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Symbiont::WebObjects::UnorderedList do
4
- describe "implementation" do
5
- let(:unordered_list_object) { Symbiont::WebObjects::UnorderedList }
6
-
7
- it "should allow locators to be used" do
8
- [:class, :id, :index, :xpath, :name].each do |t|
9
- locator = unordered_list_object.provide_locator_for t => 'value'
10
- locator.keys.first.should == t
11
- end
12
- end
13
-
14
- it "should register with a unordered list (ul) tag" do
15
- ::Symbiont::WebObjects.get_class_for(:ul).should == ::Symbiont::WebObjects::UnorderedList
16
- end
17
-
18
- context "on the watir platform" do
19
- let(:ul_element) { double('ul_element') }
20
- let(:watir_unordered_list) { Symbiont::WebObjects::UnorderedList.new(ul_element) }
21
-
22
- it "should return a list item when indexed" do
23
- ul_element.stub(:uls).and_return([ul_element])
24
- ul_element.stub(:find_elements).and_return(ul_element)
25
- ul_element.stub(:map).and_return([ul_element])
26
- ul_element.stub(:parent).and_return(ul_element)
27
- ul_element.stub(:element).and_return(ul_element)
28
- ul_element.stub(:==).and_return(true)
29
- watir_unordered_list[1]
30
- end
31
-
32
- it "should know how many list items it contains" do
33
- ul_element.stub(:uls).and_return([ul_element])
34
- ul_element.stub(:find_elements).and_return(ul_element)
35
- ul_element.stub(:map).and_return([ul_element])
36
- ul_element.stub(:parent).and_return(ul_element)
37
- ul_element.stub(:element).and_return(ul_element)
38
- ul_element.stub(:==).and_return(true)
39
- watir_unordered_list.items.should == 1
40
- end
41
-
42
- it "should iterate over the list items" do
43
- watir_unordered_list.should_receive(:items).and_return(5)
44
- watir_unordered_list.stub(:[])
45
- count = 0
46
- watir_unordered_list.each { |item| count += 1 }
47
- count.should == 5
48
- end
49
- end
50
- end
51
- end
@@ -1,25 +0,0 @@
1
- module Symbiont
2
- module Browser
3
-
4
- @@browser = false
5
-
6
- def self.start
7
- unless @@browser
8
- target = ENV['BROWSER']
9
- @@browser = watir_browser(target)
10
- end
11
- @@browser
12
- end
13
-
14
- def self.stop
15
- @@browser.quit if @@browser
16
- @@browser = false
17
- end
18
-
19
- private
20
-
21
- def self.watir_browser(target)
22
- Watir::Browser.new(target.to_sym)
23
- end
24
- end
25
- end
@@ -1,6 +0,0 @@
1
- require 'symbiont'
2
- require 'symbiont/factory'
3
-
4
- include RSpec::Matchers
5
-
6
- World(Symbiont::Factory)
@@ -1,15 +0,0 @@
1
- AfterConfiguration do |config|
2
- puts("Tests are being executed from: #{config.feature_dirs}")
3
- end
4
-
5
- Before do
6
- @browser = Symbiont::Browser.start
7
- end
8
-
9
- After do
10
- #Symbiont::Browser.stop
11
- end
12
-
13
- at_exit do
14
- Symbiont::Browser.stop
15
- end
@@ -1,9 +0,0 @@
1
- Feature: Ability to handle enclosing elements.
2
-
3
- Scenario: Handling javascript message boxes
4
- * the alert message is "Alert Message Received"
5
- * the confirm message is "Confirmation Message Received"
6
- * the prompt message is "Favorite Sith Lord" and the default value is "Darth Bane"
7
-
8
- Scenario: Handling framed elements
9
- * the year for stardate "51887.2" is "2375"
@@ -1,26 +0,0 @@
1
- Feature: Ability to handle browser and page actions.
2
-
3
- Scenario: Getting web page text
4
- * the text "Multiphasic Temporal Convergence" appears on the web objects page
5
-
6
- Scenario: Getting web page markup
7
- * the markup "<legend>Tell Us What You Read</legend>" appears in the web objects page
8
-
9
- Scenario: Getting web page title
10
- * the title "Web Objects | Symbiote" appears for the web objects page
11
-
12
- Scenario: Getting the web page url
13
- * the url "http://localhost:9292/webobject" matches the web objects page
14
-
15
- Scenario: Getting the type of element with focus
16
- * the "name" text field should have focus on initial loading of the web objects page
17
-
18
- Scenario: Setting the focus to an element
19
- When setting the focus on the chameleoflage armor field
20
- Then the "cameleoflage armor" checkbox should have focus
21
-
22
- Scenario: Back, forward, and refresh browser actions
23
- * going back from the web objects to the home page
24
- * going forward from the home page to the web objects page
25
- * refreshing the web objects page
26
-
@@ -1,22 +0,0 @@
1
- class Characters
2
- include Symbiont
3
- include Symbiont::Factory
4
-
5
- url_is "http://localhost:9292/comics"
6
- title_is "Comic Heroes and Villains | Symbiote"
7
-
8
- table :characters_id, id: "comic-grid"
9
- table :characters_name, name: "comic-grid"
10
- table :characters_class, class: "display"
11
- table :characters_xpath, xpath: "//table"
12
- table :characters_index, index: 0
13
-
14
- table :publishers, id: "pub-grid"
15
-
16
- cell :dc_year_id, id: "dc_founded"
17
- cell :dc_year_name, name: "dc_founded"
18
- cell :dc_year_class, class: "pub"
19
- cell :dc_year_xpath, xpath: "//td[@id='dc_founded']"
20
-
21
- cell :marvel_year_id, id: "marvel_founded"
22
- end
data/specs/pages/home.rb DELETED
@@ -1,9 +0,0 @@
1
- class Home
2
- include Symbiont
3
-
4
- url_is "http://localhost:9292"
5
-
6
- def check_for_title(text)
7
- self.title.should == text
8
- end
9
- end
@@ -1,23 +0,0 @@
1
- class Stardate
2
- include Symbiont
3
-
4
- url_is "http://localhost:9292/stardate"
5
-
6
- link :calculator, href: "stardate_calc"
7
-
8
- frame(id: "fancybox-frame") do |context|
9
- text_field :tng_stardate, name: "stardateTNGValue", frame: context
10
- text_field :tos_stardate, name: "stardateTOSValue", frame: context
11
- text_field :tng_value, name: "calendarTNGValue", frame: context
12
- text_field :tos_value, name: "calendarTOSValue", frame: context
13
- button :convert_tng, id: "convertTNG", frame: context
14
- button :convert_tos, id: "convertTOS", frame: context
15
- end
16
-
17
- def calculate_tng(value)
18
- self.wait_for_app(2)
19
- self.tng_stardate = value
20
- self.convert_tng
21
- self.tng_value
22
- end
23
- end
@@ -1,77 +0,0 @@
1
- class WebObjects
2
- include Symbiont
3
- include Symbiont::Factory
4
-
5
- url_is "http://localhost:9292/webobject"
6
- title_is "Web Objects | Symbiote"
7
-
8
- text_field :name, id: "name"
9
- text_field :email, id: "email"
10
-
11
- checkbox :chameleoflage_armor, id: "camoArmor"
12
- checkbox :make_sith_active, id: "toggleSith"
13
-
14
- select_list :sith_power, id: "sith"
15
- select :physics_id, id: "physics"
16
- select :physics_name, name: "physics"
17
- select :physics_xpath, xpath: "//select[@id='physics']"
18
- select :physics_index, index: 1
19
-
20
- button :alert, id: "alertButton"
21
- button :confirm, id: "confirmButton"
22
- button :prompt, id: "promptButton"
23
-
24
- def check_for_text(text)
25
- self.text.include? text
26
- end
27
-
28
- def check_for_markup(text)
29
- self.html.include? text
30
- end
31
-
32
- def check_for_title(text)
33
- self.title.should == text
34
- end
35
-
36
- def check_for_url(text)
37
- self.url.should == text
38
- end
39
-
40
- def check_for_focus(element)
41
- case element
42
- when "name"
43
- self.focus.should be_an_instance_of Symbiont::WebObjects::TextField
44
- when "cameleoflage armor"
45
- self.focus.should be_an_instance_of Symbiont::WebObjects::CheckBox
46
- end
47
- end
48
-
49
- def set_focus_for(locator)
50
- self.checkbox_object(locator).focus
51
- end
52
-
53
- def generate_alert(text)
54
- message = self.will_alert do
55
- self.alert
56
- end
57
-
58
- message.should == text
59
- end
60
-
61
- def generate_confirm(text)
62
- message = self.will_confirm(true) do
63
- self.confirm
64
- end
65
-
66
- message.should == text
67
- end
68
-
69
- def generate_prompt(text, value)
70
- message = self.will_prompt("Darth Invictus") do
71
- self.prompt
72
- end
73
-
74
- message[:message].should == text
75
- message[:default_value].should == value
76
- end
77
- end
@@ -1,53 +0,0 @@
1
- Feature: Work with select list objects
2
-
3
- Background:
4
- Given the web objects page
5
-
6
- Scenario: Checking the state of select lists
7
- * the physics expertise select list should exist
8
- * the physics expertise select list should be visible
9
- * the physics expertise select list should be enabled
10
- * the physics expertise select list should be a select list object
11
- * the sith power select list should not be enabled
12
-
13
- Scenario Outline: Finding a select list on the page
14
- When the physics expertise select list is searched for by "<identifier>"
15
- Then it is possible to select a physics topic of "Loop Quantum Gravity"
16
- And the value of the selected item for physics expertise should be "Loop Quantum Gravity"
17
- And the value of the selected option for physics expertise should be "lqg"
18
-
19
- Scenarios:
20
- | identifier |
21
- | id |
22
- | name |
23
- | xpath |
24
- | index |
25
-
26
- Scenario: Finding if a select list contains a particular value
27
- * the physics expertise select list should include "Alcubierre Warp Metrics"
28
-
29
- Scenario: Getting the selected value and option
30
- When the physics expertise topic "Loop Quantum Gravity" is selected
31
- Then the selected physics expertise value is "Loop Quantum Gravity"
32
- And the selected physics expertise option is "lqg"
33
-
34
- Scenario: Getting a value from the selected option
35
- When the physics expertise option "lqg" is selected
36
- Then the selected physics expertise option is "lqg"
37
-
38
- Scenario: Selecting multiple values from a list
39
- When the physics expertise values "Tachyonic Antitravel" and "Krasnikov Tubes" are selected
40
- Then the selected physics expertise values are "Tachyonic Antitravel" and "Krasnikov Tubes"
41
- When the physics expertise select list is cleared
42
- Then the physics expertise select list should have no selected values
43
-
44
- Scenario: Getting all values from a select list
45
- * the physics expertise select list contains the following
46
- | Quantum Entanglement |
47
- | Tachyonic Antitravel |
48
- | Bose-Einstein Condensates |
49
- | Alcubierre Warp Metrics |
50
- | Krasnikov Tubes |
51
- | Supersymmetric Particle Theory |
52
- | Loop Quantum Gravity |
53
- | Noncommutative Geometric Spaces |
@@ -1,17 +0,0 @@
1
- Given(/^the alert message is "(.*?)"$/) do |text|
2
- on_view(WebObjects).generate_alert(text)
3
- end
4
-
5
- Given(/^the confirm message is "(.*?)"$/) do |text|
6
- on_view(WebObjects).generate_confirm(text)
7
- end
8
-
9
- Given(/^the prompt message is "(.*?)" and the default value is "(.*?)"$/) do |text, value|
10
- on_view(WebObjects).generate_prompt(text, value)
11
- end
12
-
13
- Given(/^the year for stardate "(.*?)" is "(.*?)"$/) do |value, year|
14
- on_view(Stardate).calculator
15
- result = on(Stardate).calculate_tng("51887.2")
16
- result.include? year
17
- end
@@ -1,44 +0,0 @@
1
- Given(/^the text "(.*?)" appears on the web objects page$/) do |text|
2
- on_view(WebObjects).check_for_text(text)
3
- end
4
-
5
- Given(/^the markup "(.*?)" appears in the web objects page$/) do |text|
6
- on_view(WebObjects).check_for_markup(text)
7
- end
8
-
9
- Given(/^the title "(.*?)" appears for the web objects page$/) do |text|
10
- on_view(WebObjects).check_for_title(text)
11
- end
12
-
13
- Given(/^the url "(.*?)" matches the web objects page$/) do |text|
14
- on_view(WebObjects).check_for_url(text)
15
- end
16
-
17
- Given(/^the "(.*?)" text field should have focus on initial loading of the web objects page$/) do |element|
18
- on_view(WebObjects).check_for_focus(element)
19
- end
20
-
21
- When(/^setting the focus on the chameleoflage armor field$/) do
22
- on_view(WebObjects).set_focus_for(:id => "camoArmor")
23
- end
24
-
25
- Then(/^the "(.*?)" checkbox should have focus$/) do |element|
26
- on(WebObjects).check_for_focus(element)
27
- end
28
-
29
- Given(/^going back from the web objects to the home page$/) do
30
- on_view(Home).check_for_title("Home | Symbiote")
31
- on_view(WebObjects).check_for_title("Web Objects | Symbiote")
32
- on(WebObjects).back
33
- on(Home).check_for_title("Home | Symbiote")
34
- end
35
-
36
- Given(/^going forward from the home page to the web objects page$/) do
37
- on(Home).forward
38
- on(WebObjects).check_for_title("Web Objects | Symbiote")
39
- end
40
-
41
- Given(/^refreshing the web objects page$/) do
42
- on(WebObjects).refresh
43
- on(WebObjects).check_for_title("Web Objects | Symbiote")
44
- end
@@ -1,14 +0,0 @@
1
- #When(/^on the (.*) page$/) do |name|
2
- #case name
3
- # when "web objects"
4
- # @page = WebObjects.new(@browser, true)
5
- #end
6
- #end
7
-
8
- Given(/^the web objects page$/) do
9
- on_view(WebObjects)
10
- end
11
-
12
- Given(/^the comic characters page$/) do
13
- on_view(Characters)
14
- end
@@ -1,94 +0,0 @@
1
- When(/^the physics expertise select list is searched for by "(.*?)"$/) do |identifier|
2
- @find_by = identifier
3
- end
4
-
5
- When(/^the sith power select list is enabled$/) do
6
- on(WebObjects).check_make_sith_active
7
- end
8
-
9
- When(/^the physics expertise topic "(.*?)" is selected$/) do |value|
10
- on(WebObjects).physics_id = value
11
- end
12
-
13
- When(/^the physics expertise option "(.*?)" is selected$/) do |option|
14
- on(WebObjects).physics_id_object.select_value(option)
15
- end
16
-
17
- When(/^the physics expertise values "(.*?)" and "(.*?)" are selected$/) do |value1, value2|
18
- on(WebObjects).physics_id_object.select(value1)
19
- on(WebObjects).physics_id_object.select(value2)
20
- end
21
-
22
- When(/^the physics expertise select list is cleared$/) do
23
- on(WebObjects).physics_id_object.clear
24
- end
25
-
26
- Then(/^the physics expertise select list should exist$/) do
27
- on(WebObjects).physics_id_exists?.should == true
28
- on(WebObjects).physics_id?.should == true
29
- end
30
-
31
- Then(/^the physics expertise select list should be visible$/) do
32
- on(WebObjects).physics_id_visible?.should == true
33
- on(WebObjects).physics_id?.should == true
34
- end
35
-
36
- Then(/^the physics expertise select list should be enabled$/) do
37
- on(WebObjects).physics_id_enabled?.should == true
38
- on(WebObjects).physics_id!.should == true
39
- end
40
-
41
- Then(/^the physics expertise select list should be a select list object$/) do
42
- element = on(WebObjects).physics_id_select_list
43
- element.should be_instance_of Symbiont::WebObjects::SelectList
44
- end
45
-
46
- Then(/^the sith power select list should not be enabled$/) do
47
- on(WebObjects).sith_power_enabled?.should == false
48
- end
49
-
50
- Then(/^it is possible to select a physics topic of "(.*?)"$/) do |value|
51
- on(WebObjects).send "physics_#{@find_by}=".to_sym, value
52
- end
53
-
54
- Then(/^the value of the selected item for physics expertise should be "(.*?)"$/) do |value|
55
- result = on(WebObjects).send "physics_#{@find_by}".to_sym
56
- result.should == value
57
- end
58
-
59
- Then(/^the value of the selected option for physics expertise should be "(.*?)"$/) do |option|
60
- element = on(WebObjects).send "physics_#{@find_by}_object".to_sym
61
- element.value.should == option
62
- end
63
-
64
- Then(/^the physics expertise select list should include "(.*?)"$/) do |value|
65
- on(WebObjects).physics_id_object.should include value
66
- on(WebObjects).physics_id_object.include?(value)
67
- end
68
-
69
- Then(/^the selected physics expertise value is "(.*?)"$/) do |value|
70
- on(WebObjects).select_list_object(id: 'physics').selected_options[0].should == value
71
- on(WebObjects).physics_id_object.selected?(value).should be_true
72
- on(WebObjects).physics_id_object.selected?(value)
73
- on(WebObjects).physics_id.should == value
74
- end
75
-
76
- Then(/^the selected physics expertise option is "(.*?)"$/) do |value|
77
- on(WebObjects).physics_id_option?.should == value
78
- on(WebObjects).physics_id_object.selected_values[0].should == value
79
- end
80
-
81
- Then(/^the selected physics expertise values are "(.*?)" and "(.*?)"$/) do |value1, value2|
82
- on(WebObjects).physics_id_object.selected_options.should == [value1, value2]
83
- end
84
-
85
- Then(/^the physics expertise select list should have no selected values$/) do
86
- on(WebObjects).physics_id_object.selected_options.should be_empty
87
- end
88
-
89
- Then(/^the physics expertise select list contains the following$/) do |values|
90
- list = on(WebObjects).physics_id_options?
91
- values.raw.each do |item|
92
- list.should include item[0]
93
- end
94
- end
@@ -1,31 +0,0 @@
1
- When(/^the founded table entry for DC is searched for by "(.*?)"$/) do |identifier|
2
- @find_by = identifier
3
- end
4
-
5
- Then(/^the founded table entry for DC should exist$/) do
6
- @active.dc_year_id_exists?.should == true
7
- @active.dc_year_id?.should == true
8
- end
9
-
10
- Then(/^the founded table entry for DC should be visible$/) do
11
- @active.dc_year_id_visible?.should == true
12
- @active.dc_year_id_?.should == true
13
- end
14
-
15
- Then(/^the founded table entry for DC should be a table cell object$/) do
16
- element = @active.dc_year_id_cell
17
- element.should be_instance_of Symbiont::WebObjects::TableCell
18
- end
19
-
20
- Then(/^the founded table entry for DC should be "(.*?)"$/) do |value|
21
- @active.dc_year_id.should == value
22
- end
23
-
24
- Then(/^the founded table entry for Marvel should be "(.*?)"$/) do |value|
25
- @active.marvel_year_id.should == value
26
- end
27
-
28
- Then(/^it can be confirmed that the founded table entry for DC should be "(.*?)"$/) do |value|
29
- result = @active.send "dc_year_#{@find_by}".to_sym
30
- result.should == value
31
- end