symbiont 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/Gemfile.lock +10 -39
  2. data/HISTORY.md +6 -0
  3. data/lib/symbiont.rb +8 -4
  4. data/lib/symbiont/enclosers.rb +4 -4
  5. data/lib/symbiont/evaluators.rb +22 -29
  6. data/lib/symbiont/generators.rb +82 -317
  7. data/lib/symbiont/platform_selenium.rb +18 -0
  8. data/lib/symbiont/platform_selenium/platform_object.rb +236 -0
  9. data/lib/symbiont/platform_selenium/web_objects/button.rb +13 -0
  10. data/lib/symbiont/platform_selenium/web_objects/checkbox.rb +21 -0
  11. data/lib/symbiont/platform_selenium/web_objects/common.rb +104 -0
  12. data/lib/symbiont/platform_selenium/web_objects/link.rb +13 -0
  13. data/lib/symbiont/platform_selenium/web_objects/radio.rb +21 -0
  14. data/lib/symbiont/platform_selenium/web_objects/select_list.rb +79 -0
  15. data/lib/symbiont/platform_selenium/web_objects/table.rb +40 -0
  16. data/lib/symbiont/platform_selenium/web_objects/table_row.rb +36 -0
  17. data/lib/symbiont/platform_selenium/web_objects/text_field.rb +14 -0
  18. data/lib/symbiont/platform_watir.rb +13 -4
  19. data/lib/symbiont/platform_watir/platform_object.rb +74 -262
  20. data/lib/symbiont/platform_watir/web_objects/checkbox.rb +21 -0
  21. data/lib/symbiont/platform_watir/web_objects/common.rb +82 -0
  22. data/lib/symbiont/platform_watir/web_objects/radio.rb +21 -0
  23. data/lib/symbiont/platform_watir/web_objects/select_list.rb +67 -0
  24. data/lib/symbiont/platform_watir/web_objects/table.rb +31 -0
  25. data/lib/symbiont/platform_watir/web_objects/table_row.rb +31 -0
  26. data/lib/symbiont/platform_watir/web_objects/text_field.rb +13 -0
  27. data/lib/symbiont/platforms.rb +18 -6
  28. data/lib/symbiont/version.rb +1 -1
  29. data/lib/symbiont/web_objects/_common.rb +53 -74
  30. data/lib/symbiont/web_objects/button.rb +23 -4
  31. data/lib/symbiont/web_objects/checkbox.rb +24 -10
  32. data/lib/symbiont/web_objects/div.rb +9 -1
  33. data/lib/symbiont/web_objects/link.rb +25 -4
  34. data/lib/symbiont/web_objects/paragraph.rb +11 -0
  35. data/lib/symbiont/web_objects/radio.rb +27 -1
  36. data/lib/symbiont/web_objects/select_list.rb +20 -56
  37. data/lib/symbiont/web_objects/span.rb +9 -1
  38. data/lib/symbiont/web_objects/table.rb +19 -22
  39. data/lib/symbiont/web_objects/table_cell.rb +17 -1
  40. data/lib/symbiont/web_objects/table_row.rb +18 -25
  41. data/lib/symbiont/web_objects/text_field.rb +27 -11
  42. data/symbiont.gemspec +3 -8
  43. metadata +29 -122
  44. data/app/Gemfile +0 -4
  45. data/app/app.rb +0 -181
  46. data/app/config/database.rb +0 -9
  47. data/app/models/plan.rb +0 -10
  48. data/app/models/product.rb +0 -10
  49. data/app/models/study.rb +0 -11
  50. data/app/models/user.rb +0 -13
  51. data/app/public/css/style.css +0 -138
  52. data/app/views/create_plan.erb +0 -21
  53. data/app/views/create_product.erb +0 -15
  54. data/app/views/create_study.erb +0 -24
  55. data/app/views/create_user.erb +0 -60
  56. data/app/views/db_plans.erb +0 -31
  57. data/app/views/db_products.erb +0 -29
  58. data/app/views/db_studies.erb +0 -33
  59. data/app/views/db_users.erb +0 -23
  60. data/app/views/entity_list.erb +0 -10
  61. data/app/views/index.erb +0 -8
  62. data/app/views/layout.erb +0 -39
  63. data/app/views/login_page.erb +0 -17
  64. data/app/views/success_1.erb +0 -2
  65. data/app/views/success_2.erb +0 -2
  66. data/app/views/test_database.erb +0 -13
  67. data/app/views/test_events.erb +0 -51
  68. data/app/views/test_login.erb +0 -53
  69. data/app/views/test_login_error.erb +0 -22
  70. data/app/views/test_login_success.erb +0 -22
  71. data/app/views/test_page.erb +0 -184
  72. data/specs/button.feature +0 -44
  73. data/specs/checkbox.feature +0 -40
  74. data/specs/data_setter.feature +0 -29
  75. data/specs/definitions/pages.rb +0 -156
  76. data/specs/div.feature +0 -11
  77. data/specs/evaluators.feature +0 -17
  78. data/specs/events.feature +0 -30
  79. data/specs/frame.feature +0 -5
  80. data/specs/link.feature +0 -42
  81. data/specs/locators.feature +0 -17
  82. data/specs/radio.feature +0 -38
  83. data/specs/select_list.feature +0 -50
  84. data/specs/simple_test.feature +0 -13
  85. data/specs/span.feature +0 -11
  86. data/specs/support/env.rb +0 -20
  87. data/specs/support/hooks.rb +0 -11
  88. data/specs/support/test_steps/action_steps_buttons.rb +0 -70
  89. data/specs/support/test_steps/action_steps_checkboxes.rb +0 -75
  90. data/specs/support/test_steps/action_steps_data_setter.rb +0 -56
  91. data/specs/support/test_steps/action_steps_divs.rb +0 -18
  92. data/specs/support/test_steps/action_steps_evaluators.rb +0 -15
  93. data/specs/support/test_steps/action_steps_events.rb +0 -77
  94. data/specs/support/test_steps/action_steps_frames.rb +0 -13
  95. data/specs/support/test_steps/action_steps_links.rb +0 -61
  96. data/specs/support/test_steps/action_steps_locators.rb +0 -44
  97. data/specs/support/test_steps/action_steps_navigate.rb +0 -25
  98. data/specs/support/test_steps/action_steps_radios.rb +0 -75
  99. data/specs/support/test_steps/action_steps_select_lists.rb +0 -106
  100. data/specs/support/test_steps/action_steps_spans.rb +0 -18
  101. data/specs/support/test_steps/action_steps_tables.rb +0 -82
  102. data/specs/support/test_steps/action_steps_text_fields.rb +0 -107
  103. data/specs/support/test_steps/action_steps_webobjects.rb +0 -31
  104. data/specs/support/test_steps/simple_test_steps.rb +0 -8
  105. data/specs/table.feature +0 -39
  106. data/specs/text_field.feature +0 -47
  107. data/specs/web_object.feature +0 -15
@@ -1,44 +0,0 @@
1
- When (/^the test needs to utilize the oath link$/) do
2
- step %{on the object test page}
3
- @link = @page.link_object(id: "oath")
4
- end
5
-
6
- When (/^the test needs to utilize the nostalgic button$/) do
7
- step %{on the object test page}
8
- @button = @page.button_object(value: "All Your Base Are Belong To Us")
9
- end
10
-
11
- When (/^the test needs to utilize the book summary text field$/) do
12
- step %{on the object test page}
13
- @text_field = @page.text_field_object(id: "bookSummaryID")
14
- end
15
-
16
- Then (/^the oath link can be referenced$/) do
17
- @link.should be_instance_of Symbiont::WebObjects::Link
18
- end
19
-
20
- Then (/^the oath link can be clicked$/) do
21
- @link.click
22
- step %{the first success page appears}
23
- end
24
-
25
- Then (/^the nostalgic button can be referenced$/) do
26
- @button.should be_instance_of Symbiont::WebObjects::Button
27
- end
28
-
29
- Then (/^the nostalgic button can be clicked$/) do
30
- @button.click
31
- step %{the first success page appears}
32
- end
33
-
34
- Then (/^the book summary text field can be referenced$/) do
35
- @text_field.should be_instance_of Symbiont::WebObjects::TextField
36
- end
37
-
38
- Then (/^the book summary text field can be set to "([^"]*)"$/) do |text|
39
- @text_field = text
40
- end
41
-
42
- Then (/^the book summary should be "([^"]*)"$/) do |text|
43
- @text_field.should == text
44
- end
@@ -1,25 +0,0 @@
1
- When (/^on the landing page$/) do
2
- @page = LandingPage.new(@browser, true)
3
- end
4
-
5
- When (/^on the object test page$/) do
6
- @page = SimpleObjectPage.new(@browser, true)
7
- end
8
-
9
- When (/^on the events test page$/) do
10
- @page = SimpleEventsPage.new(@browser, true)
11
- end
12
-
13
- Then (/^the simple object page appears$/) do
14
- title_text = "Simple Object Page | Test Application"
15
- @page.wait_for(3, "title should have been #{title_text}") do
16
- @page.title == title_text
17
- end
18
- end
19
-
20
- Then (/^the first success page appears$/) do
21
- title_text = "Success 1 | Test Application"
22
- @page.wait_for(3, "title should have been #{title_text}") do
23
- @page.title == title_text
24
- end
25
- end
@@ -1,75 +0,0 @@
1
- When (/^warp core breach is not selected as the least favorite way to vaporize$/) do
2
- step %{on the object test page}
3
- end
4
-
5
- When (/^warp core breach is selected as the least favorite way to vaporize$/) do
6
- step %{on the object test page}
7
- @page.set_warpCoreBreach
8
- end
9
-
10
- When (/^the unstable phase shift radio on the object test page is selected by "([^"]*)"$/) do |locator|
11
- @page = SimpleObjectPage.new(@browser, true)
12
- @page.set_unstablePhaseShiftID if locator == "id"
13
- @page.set_unstablePhaseShiftName if locator == "name"
14
- @page.set_unstablePhaseShiftClass if locator == "class"
15
- @page.set_unstablePhaseShiftXPath if locator == "xpath"
16
- @page.set_unstablePhaseShiftIndex if locator == "index"
17
- end
18
-
19
- Then (/^the warp core breach radio should exist$/) do
20
- @page.warpCoreBreach_exists?.should == true
21
- @page.warpCoreBreach?.should == true
22
- end
23
-
24
- Then (/^the warp core breach radio should be visible$/) do
25
- @page.warpCoreBreach_visible?.should == true
26
- @page.warpCoreBreach_?.should == true
27
- end
28
-
29
- Then (/^the warp core breach radio should be enabled$/) do
30
- @page.warpCoreBreach_enabled?.should == true
31
- @page.warpCoreBreach!.should == true
32
- end
33
-
34
- Then (/^the warp core breach radio should be a radio object$/) do
35
- @object = @page.warpCoreBreach_radio
36
- @object.should be_instance_of Symbiont::WebObjects::Radio
37
- end
38
-
39
- Then (/^the warp core breach radio should not be set$/) do
40
- @page.warpCoreBreach_selected?.should == false
41
- end
42
-
43
- Then (/^the warp core breach radio should be set$/) do
44
- @page.warpCoreBreach_selected?.should == true
45
- end
46
-
47
- Then (/^the fake radio should not exist$/) do
48
- @page.fake_radio_exists?.should == false
49
- end
50
-
51
- Then (/^the fake radio should be a radio object$/) do
52
- @object = @page.fake_radio_object
53
- @object.should be_instance_of Symbiont::WebObjects::Radio
54
- end
55
-
56
- Then (/^the coronal mass ejection radio should exist$/) do
57
- @page.coronalMassEjection_exists?.should == true
58
- end
59
-
60
- Then (/^the coronal mass ejection radio should be visible$/) do
61
- @page.coronalMassEjection_visible?.should == true
62
- end
63
-
64
- Then (/^the coronal mass ejection radio should be a radio object$/) do
65
- @object = @page.coronalMassEjection_radio
66
- @object.should be_instance_of Symbiont::WebObjects::Radio
67
- end
68
-
69
- Then (/^the coronal mass ejection radio should not be enabled$/) do
70
- @page.coronalMassEjection_enabled?.should == false
71
- end
72
-
73
- Then (/^the unstable phase shift radio should be set$/) do
74
- @page.set_unstablePhaseShiftID
75
- end
@@ -1,106 +0,0 @@
1
- When (/^"([^"]*)" is selected from physics concepts on the object test page$/) do |text|
2
- step %{on the object test page}
3
- @page.physicsConceptsID = text
4
- end
5
-
6
- When (/^"(.*?)" is selected from the physics concepts list$/) do |text|
7
- step %{on the object test page}
8
- @page.physicsConceptsID_object.select_value(text)
9
- end
10
-
11
- When (/^"(.*?)" and "(.*?)" are selected from the subatomic particles select list$/) do |first, second|
12
- step %{on the object test page}
13
- @page.subatomicParticles_object.select(first)
14
- @page.subatomicParticles_object.select(second)
15
- end
16
-
17
- When (/^the select list is cleared$/) do
18
- @page.subatomicParticles_object.clear
19
- end
20
-
21
- When (/^the physics concepts on the object test page is selected by "([^"]*)"$/) do |locator|
22
- option = "Tachyonic Antitravel"
23
- @page = SimpleObjectPage.new(@browser, true)
24
- @page.physicsConceptsID = option if locator == "id"
25
- @page.physicsConceptsName = option if locator == "name"
26
- @page.physicsConceptsClass = option if locator == "class"
27
- @page.physicsConceptsXPath = option if locator == "xpath"
28
- @page.physicsConceptsIndex = option if locator == "index"
29
- end
30
-
31
- Then (/^the physics concepts select list should exist$/) do
32
- @page.physicsConceptsID_exists?.should == true
33
- @page.physicsConceptsID?.should == true
34
- end
35
-
36
- Then (/^the physics concepts select list should be visible$/) do
37
- @page.physicsConceptsID_visible?.should == true
38
- @page.physicsConceptsID?.should == true
39
- end
40
-
41
- Then (/^the physics concepts select list should be enabled$/) do
42
- @page.physicsConceptsID_enabled?.should == true
43
- @page.physicsConceptsID!.should == true
44
- end
45
-
46
- Then (/^the physics concepts select list should be a select list object$/) do
47
- @object = @page.physicsConceptsID_select_list
48
- @object.should be_instance_of Symbiont::WebObjects::SelectList
49
- end
50
-
51
- Then (/^the physics concepts select list should have the second option selected$/) do
52
- @page.physicsConceptsID_option?.should == "option2"
53
- end
54
-
55
- Then (/^the physics concepts select list should be displaying "([^"]*)"$/) do |text|
56
- @page.physicsConceptsID.should == text
57
- @page.physicsConceptsID_object.selected?(text)
58
- @page.physicsConceptsID_object.selected?(text).should be_true
59
- end
60
-
61
- Then (/^the fake select list should not exist$/) do
62
- @page.fake_select_list_exists?.should == false
63
- end
64
-
65
- Then (/^the fake select list should be a select list object$/) do
66
- @object = @page.fake_select_list_object
67
- @object.should be_instance_of Symbiont::WebObjects::SelectList
68
- end
69
-
70
- Then (/^the sith power select list should exist$/) do
71
- @page.sithPowerID_exists?.should == true
72
- end
73
-
74
- Then (/^the sith power select list should be visible$/) do
75
- @page.sithPowerID_visible?.should == true
76
- end
77
-
78
- Then (/^the sith power select list should be displaying "([^"]*)"$/) do |text|
79
- @page.sithPowerID.should == text
80
- end
81
-
82
- Then (/^the sith power select list object should be a select list object$/) do
83
- @object = @page.sithPowerID_object
84
- @object.should be_instance_of Symbiont::WebObjects::SelectList
85
- end
86
-
87
- Then (/^the sith power select list should not be enabled$/) do
88
- @page.sithPowerID_enabled?.should == false
89
- end
90
-
91
- Then (/^the physics concepts select list should include "(.*?)"$/) do |text|
92
- @page.physicsConceptsID_object.should include text
93
- @page.physicsConceptsID_object.include?(text)
94
- end
95
-
96
- Then (/^the selected option on the physics concepts select list should have a value of "(.*?)"$/) do |text|
97
- @page.physicsConceptsID_object.selected_values[0].should == text
98
- end
99
-
100
- Then (/^the subatomic particles list should be displaying "(.*?)" and "(.*?)"$/) do |first, second|
101
- @page.subatomicParticles_object.selected_options.should == [second, first]
102
- end
103
-
104
- Then (/^the select list should have no selected options$/) do
105
- @page.subatomicParticles_object.selected_options.should be_empty
106
- end
@@ -1,18 +0,0 @@
1
- Then (/^the span text should exist$/) do
2
- @page.spanTextID_exists?.should == true
3
- @page.spanTextID?.should == true
4
- end
5
-
6
- Then (/^the span text should be visible$/) do
7
- @page.spanTextID_visible?.should == true
8
- @page.spanTextID_?.should == true
9
- end
10
-
11
- Then (/^the span text should be a span object$/) do
12
- @object = @page.spanTextID_span
13
- @object.should be_instance_of Symbiont::WebObjects::Span
14
- end
15
-
16
- Then (/^the span text should be "([^"]*)"$/) do |text|
17
- @page.spanTextID.should == text
18
- end
@@ -1,82 +0,0 @@
1
- When (/^getting information from the atomic elements table$/) do
2
- step %{on the object test page}
3
- @object = @page.atomicTable_table
4
- end
5
-
6
- Then (/^the atomic elements table should exist$/) do
7
- @page.atomicTable_exists?.should == true
8
- @page.atomicTable?.should == true
9
- end
10
-
11
- Then (/^the atomic elements table should be visible$/) do
12
- @page.atomicTable_visible?.should == true
13
- @page.atomicTable_?.should == true
14
- end
15
-
16
- Then (/^the atomic elements table should be a table object$/) do
17
- @object = @page.atomicTable_table
18
- @object.should be_instance_of Symbiont::WebObjects::Table
19
- end
20
-
21
- Then (/^the savings value cell for January should exist$/) do
22
- @page.janSavings_exists?.should == true
23
- @page.janSavings?.should == true
24
- end
25
-
26
- Then (/^the savings value cell for January should be visible$/) do
27
- @page.janSavings_visible?.should == true
28
- @page.janSavings_?.should == true
29
- end
30
-
31
- Then (/^the savings value cell for January should be a table cell object$/) do
32
- @object = @page.janSavings_cell
33
- @object.should be_instance_of Symbiont::WebObjects::TableCell
34
- end
35
-
36
- Then (/^the savings value cell for January should be "([^"]*)"$/) do |text|
37
- @page.janSavings.should == text
38
- end
39
-
40
- Then (/^the savings value cell for February should be "([^"]*)"$/) do |text|
41
- @page.febSavings.should == text
42
- end
43
-
44
- Then (/^the data for row "([^"]*)" should be "([^"]*)", "([^"]*)", and "([^"]*)"$/) do |row, col1, col2, col3|
45
- row = (row.to_i - 1) if row.to_i > 0
46
- table_row = @object[row]
47
- table_row[0].text.should == col1
48
- table_row[1].text.should == col2
49
- table_row[2].text.should == col3
50
- end
51
-
52
- Then (/^the atomic elements table should have "([^\"]*)" rows$/) do |rows|
53
- @object.rows.should == rows.to_i
54
- end
55
-
56
- Then (/^row "([^\"]*)" should have "([^\"]*)" columns$/) do |row, cols|
57
- @object[row.to_i - 1].columns.should == cols.to_i
58
- end
59
-
60
- Then (/^the data for the first row should be "([^"]*)", "([^"]*)", and "([^"]*)"$/) do |col1, col2, col3|
61
- @object.first_row[0].text.should == col1
62
- @object.first_row[1].text.should == col2
63
- @object.first_row[2].text.should == col3
64
- end
65
-
66
- Then (/^the data for the last row should be "([^"]*)", "([^"]*)", and "([^"]*)"$/) do |col1, col2, col3|
67
- @object.last_row[0].text.should == col1
68
- @object.last_row[1].text.should == col2
69
- @object.last_row[2].text.should == col3
70
- end
71
-
72
- Then (/^the symbol for carbon should be "([^"]*)"$/) do |text|
73
- @page.atomicTable_object["Carbon"]["Symbol"].text.should == text
74
- end
75
-
76
- Then (/^the data for row "(.*?)" should be unavailable$/) do |row|
77
- @object[row].should be_nil
78
- end
79
-
80
- Then (/^the data for column "(.*?)" and row "(.*?)" should be unavailable$/) do |column, row|
81
- @object[row][column].should be_nil
82
- end
@@ -1,107 +0,0 @@
1
- When (/^the book title on the simple object test page is set to "([^"]*)"$/) do |text|
2
- step %{on the object test page}
3
- @page.bookTitleID = text
4
- end
5
-
6
- When (/^the book title text field on the object test page is set by "([^"]*)"$/) do |locator|
7
- title = "Revelation Space"
8
- @page = SimpleObjectPage.new(@browser, true)
9
- @page.bookTitleID = title if locator == "id"
10
- @page.bookTitleName = title if locator == "name"
11
- @page.bookTitleClass = title if locator == "class"
12
- @page.bookTitleXPath = title if locator == "xpath"
13
- @page.bookTitleIndex = title if locator == "index"
14
- end
15
-
16
- When (/^the book author on the simple object test page is set to "([^"]*)"$/) do |text|
17
- step %{on the object test page}
18
- @text_field = @page.text_field_object(id: "bookAuthorID")
19
- @text_field.value = text
20
- end
21
-
22
- When (/^the text "([^"]*)" is added to the book title$/) do |text|
23
- @page.bookTitleID_object.append text
24
- end
25
-
26
- Then (/^the book title text field should exist$/) do
27
- @page.bookTitleID_exists?.should == true
28
- @page.bookTitleID?.should == true
29
-
30
- @web_object = @page.bookTitleID_object
31
- @web_object.should exist
32
- end
33
-
34
- Then (/^the book title text field should be visible$/) do
35
- @page.bookTitleID_visible?.should == true
36
- @page.bookTitleID_?.should == true
37
-
38
- @web_object = @page.bookTitleID_object
39
- @web_object.should be_visible
40
- end
41
-
42
- Then (/^the book title text field should be enabled$/) do
43
- @page.bookTitleID_enabled?.should == true
44
- @page.bookTitleID!.should == true
45
-
46
- @web_object = @page.bookTitleID_object
47
- @web_object.should be_enabled
48
- end
49
-
50
- Then (/^the book title text field should be a text field object$/) do
51
- @object = @page.bookTitleID_object
52
- @object.should be_instance_of Symbiont::WebObjects::TextField
53
- end
54
-
55
- Then (/^the book title should be "([^"]*)"$/) do |text|
56
- @page.bookTitleID.should == text
57
- end
58
-
59
- Then (/^the book author should be "([^"]*)"$/) do |text|
60
- @text_field.value.should == text
61
- end
62
-
63
- Then (/^the fake text field should not exist$/) do
64
- @page.fake_text_field_exists?.should == false
65
-
66
- @web_object = @page.fake_text_field_object
67
- @web_object.should_not exist
68
- end
69
-
70
- Then (/^the fake text field should not be visible$/) do
71
- # This test cannot actually pass because an attempt to check for visibility
72
- # will result in an "unable to locate element" error. This throws an
73
- # UnknownObjectException.
74
-
75
- #@page.fake_text_field_visible?.should == false
76
- #@web_object = @page.fake_text_field_object
77
- #@web_object.should_not be_visible
78
- end
79
-
80
- Then (/^the fake text field should be a text field object$/) do
81
- @object = @page.fake_text_field_object
82
- @object.should be_instance_of Symbiont::WebObjects::TextField
83
- end
84
-
85
- Then (/^the book publisher ID text field should exist$/) do
86
- @page.bookPubID_exists?.should == true
87
- end
88
-
89
- Then (/^the book publisher ID text field should be visible$/) do
90
- @page.bookPubID_visible?.should == true
91
- end
92
-
93
- Then (/^the book publisher ID text field should not be enabled$/) do
94
- @page.bookPubID_enabled?.should == false
95
-
96
- @web_object = @page.bookPubID_object
97
- @web_object.should_not be_enabled
98
- end
99
-
100
- Then (/^the text of the book publisher ID text field should be "([^"]*)"$/) do |text|
101
- @page.bookPubID.should == text
102
- end
103
-
104
- Then (/^the book publisher ID text field object should be a text field object$/) do
105
- @object = @page.bookPubID_object
106
- @object.should be_instance_of Symbiont::WebObjects::TextField
107
- end