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,9 +0,0 @@
1
- require 'data_mapper'
2
-
3
- require_relative '../models/product'
4
- require_relative '../models/study'
5
- require_relative '../models/plan'
6
- require_relative '../models/user'
7
-
8
- DataMapper::setup(:default, "sqlite3://#{Dir.pwd}/app.db")
9
- DataMapper.finalize.auto_upgrade!
data/app/models/plan.rb DELETED
@@ -1,10 +0,0 @@
1
- class Plan
2
- include DataMapper::Resource
3
-
4
- property :id, Serial
5
- property :study, String
6
- property :plan_name, String
7
- property :plan_description, String
8
- property :created_at, DateTime, :default => DateTime.now
9
- property :updated_at, DateTime
10
- end
@@ -1,10 +0,0 @@
1
- class Product
2
- include DataMapper::Resource
3
-
4
- property :id, Serial
5
- property :product_id, String
6
- property :name, String
7
- property :description, Text
8
- property :created_at, DateTime, default: DateTime.now
9
- property :updated_at, DateTime
10
- end
data/app/models/study.rb DELETED
@@ -1,11 +0,0 @@
1
- class Study
2
- include DataMapper::Resource
3
-
4
- property :id, Serial
5
- property :study_name, String
6
- property :protocol, String
7
- property :product, String
8
- property :phase, String
9
- property :created_at, DateTime, default: DateTime.now
10
- property :updated_at, DateTime
11
- end
data/app/models/user.rb DELETED
@@ -1,13 +0,0 @@
1
- class User
2
- include DataMapper::Resource
3
-
4
- property :id, Serial
5
- property :loginname, String
6
- property :firstname, String
7
- property :lastname, String
8
- property :level, String
9
- property :role, String
10
- property :password, String
11
- property :created_at, DateTime, default: DateTime.now
12
- property :updated_at, DateTime
13
- end
@@ -1,138 +0,0 @@
1
- header {
2
- text-align: center;
3
- background: #ccc;
4
- border: 1px solid;
5
- }
6
-
7
- header h1 {
8
- font: 42px normal Georgia, "Times New Roman", Times, serif;
9
- }
10
-
11
- header h1 a {
12
- color: #0B610B;
13
- text-decoration: none;
14
- }
15
-
16
- header h2 {
17
- color: #38610B;
18
- font-style: italic;
19
- }
20
-
21
- footer {
22
- clear: both;
23
- text-align: center;
24
- }
25
-
26
- .indent {
27
- margin: 10px 0 40px 25px;
28
- }
29
-
30
- .group {
31
- padding: 10px;
32
- margin: 10px 0 40px 25px;
33
- border: 1px solid;
34
- background-color: #E6E6E6;
35
- }
36
-
37
- #navigate {
38
- float: right;
39
- margin-right: 50px;
40
- }
41
-
42
- input:focus {
43
- border:5px solid yellow;
44
- }
45
-
46
- .notice {
47
- color: green;
48
- }
49
-
50
- .error {
51
- color: red;
52
- }
53
-
54
- table.entity {
55
- margin: 20px;
56
- color: #666;
57
- font-size: 12px;
58
- font-family: Arial, Helvetica, sans-serif;
59
- background: #eaebec;
60
- border: #ccc 1px solid;
61
- border-radius: 3px;
62
- box-shadow: 0 1px 2px #d1d1d1;
63
- text-shadow: 1px 1px 0px #fff;
64
- -moz-border-radius: 3px;
65
- -moz-box-shadow: 0 1px 2px #d1d1d1;
66
- -webkit-border-radius: 3px;
67
- -webkit-box-shadow: 0 1px 2px #d1d1d1;
68
- }
69
-
70
- table.entity caption {
71
- font-size: 16px;
72
- }
73
-
74
- table.entity th {
75
- padding: 21px 25px 22px 25px;
76
- border-bottom: 1px solid #e0e0e0;
77
- border-top: 1px solid #fafafa;
78
- background: #ededed;
79
- background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#ebebeb));
80
- background: -moz-linear-gradient(top, #ededed, #ebebeb);
81
- }
82
-
83
- table.entity th:first-child {
84
- padding-left: 20px;
85
- text-align: left;
86
- }
87
-
88
- table.entity tr {
89
- padding-left: 20px;
90
- text-align: center;
91
- }
92
-
93
- table.entity tr:first-child th:first-child {
94
- -moz-border-radius-topleft: 3px;
95
- -webkit-border-top-left-radius: 3px;
96
- border-top-left-radius: 3px;
97
- }
98
-
99
- table.entity tr:first-child th:last-child {
100
- -moz-border-radius-topright: 3px;
101
- -webkit-border-top-right-radius: 3px;
102
- border-top-right-radius: 3px;
103
- }
104
-
105
- table.entity tr:last-child td { border-bottom: 0 }
106
-
107
- table.entity tr:last-child td:first-child {
108
- -moz-border-radius-bottomleft: 3px;
109
- -webkit-border-bottom-left-radius: 3px;
110
- border-bottom-left-radius: 3px;
111
- }
112
-
113
- table.entity tr:last-child td:last-child {
114
- -moz-border-radius-bottomright: 3px;
115
- -webkit-border-bottom-right-radius: 3px;
116
- border-bottom-right-radius: 3px;
117
- }
118
-
119
- table.entity tr:hover td {
120
- background: #f2f2f2;
121
- background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0));
122
- background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0);
123
- }
124
-
125
- table.entity tr td {
126
- padding: 18px;
127
- border-bottom: 1px solid #e0e0e0; border-left: 1px solid #e0e0e0; border-top: 1px solid #ffffff;
128
- background: #fafafa;
129
- background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa));
130
- background: -moz-linear-gradient(top, #fbfbfb, #fafafa);
131
- }
132
-
133
- table.entity tr td:first-child {
134
- padding-left: 20px;
135
- border-left: 0;
136
- text-align: left;
137
- }
138
-
@@ -1,21 +0,0 @@
1
- <section id="create_plan">
2
- <p><span id="navigate"><a href="entity_list">Back to List</a> | <a href="test_database">Logout</a></span></p>
3
- <form id="planFormID" class="planFormClass" name="planFormName" method="post" action="/create_plan">
4
- <p><label id="lbl_planName" class="Fld" for="planName">Plan Name:</label><br />
5
- <input id="planName" name="planName" class="Fld" size="40" type="text"/></p>
6
-
7
- <p><label id="lbl_planStudy" class="Fld" for="planStudy">Study:</label><br />
8
- <select id="planStudy" name="planStudy">
9
- <option value="blank"></option>
10
- <% @studies = Study.all %>
11
- <% @studies.each do |study| %>
12
- <option value="<%= study.study_name %>"><%= study.study_name %></option>
13
- <% end %>
14
- </select>
15
-
16
- <p><label id="lbl_planDescription" class="Fld" for="planDescription">Description:</label><br />
17
- <input id="planDescription" name="planDescription" class="Fld" size="40" type="text"/></p>
18
-
19
- <p><input id="btnSubmit" name="btnSubmit" class="btn" type="submit" value="Create Plan"></p>
20
- </form>
21
- </section>
@@ -1,15 +0,0 @@
1
- <section id="create_product">
2
- <span id="navigate"><a href="entity_list">Back to List</a> | <a href="test_database">Logout</a></span></p>
3
- <form id="productFormID" class="productFormClass" name="productFormName" method="post" action="/create_product">
4
- <p><label id="lbl_productId" class="Fld" for="productId">Product ID:</label><br />
5
- <input id="productId" name="productId" class="Fld" size="40" type="text"/></p>
6
-
7
- <p><label id="lbl_productName" class="Fld" for="productName">Name:</label><br />
8
- <input id="productName" name="productName" class="Fld" size="40" type="text"/></p>
9
-
10
- <p><label id="lbl_productDescription" class="Fld" for="productDescription">Description:</label><br />
11
- <input id="productDescription" name="productDescription" class="Fld" size="40" type="text"/></p>
12
-
13
- <p><input id="btnSubmit" name="btnSubmit" class="btn" type="submit" value="Create Product"></p>
14
- </form>
15
- </section>
@@ -1,24 +0,0 @@
1
- <section id="create_study">
2
- <span id="navigate"><a href="entity_list">Back to List</a> | <a href="test_database">Logout</a></span></p>
3
- <form id="studyFormID" clas="studyFormClass" name="studyFormName" method="post" action="/create_study">
4
- <p><label id="lbl_studyName" class="Fld" for="studyName">Study Name:</label><br />
5
- <input id="studyName" name="studyName" class="Fld" size="40" type="text"/></p>
6
-
7
- <p><label id="lbl_studyProtocol" class="Fld" for="studyProtocol">Protocol:</label><br />
8
- <input id="studyProtocol" name="studyProtocol" class="Fld" size="40" type="text"/></p>
9
-
10
- <p><label id="lbl_studyProduct" class="Fld" for="studyProduct">Product:</label><br />
11
- <select id="studyProduct" name="studyProduct">
12
- <option value="blank"></option>
13
- <% @products = Product.all %>
14
- <% @products.each do |product| %>
15
- <option value="<%= product.name %>"><%= product.name %></option>
16
- <% end %>
17
- </select>
18
-
19
- <p><label id="lbl_studyPhase" class="Fld" for="studyPhase">Phase:</label><br />
20
- <input id="studyPhase" name="studyPhase" class="Fld" size="40" type="text"/></p>
21
-
22
- <p><input id="btnSubmit" name="btnSubmit" class="btn" type="submit" value="Create Study"></p>
23
- </form>
24
- </section>
@@ -1,60 +0,0 @@
1
- <script>
2
- function showPasswordFields() {
3
- document.getElementById('password_area').style.display = '';
4
- document.getElementById('SetPasswordLink').style.display = 'none';
5
- }
6
-
7
- function showCapabilities() {
8
- document.getElementById('capabilities_area').style.display = '';
9
- document.getElementById('RevealCapabilities').style.display = 'none';
10
- }
11
- </script>
12
-
13
- <section id="create_user">
14
- <span id="navigate"><a href="entity_list">Back to List</a> | <a href="test_database">Logout</a></span></p>
15
- <form id="userFormID" class="userFormClass" name="userFormName" method="post" action="/create_user">
16
- <p><label id="lbl_loginName" class="Fld" for="loginName">Login Name:</label><br />
17
- <input id="loginName" name="loginName" class="Fld" size="40" type="text"/></p>
18
-
19
- <p><label id="lbl_firstName" class="Fld" for="firstName">First Name:</label><br />
20
- <input id="firstName" name="firstName" class="Fld" size="40" type="text"/></p>
21
-
22
- <p><label id="lbl_lastName" class="Fld" for="lastName">Last Name:</label><br />
23
- <input id="lastName" name="lastName" class="Fld" size="40" type="text"/></p>
24
-
25
- <p><label id="lbl_level" class="Fld" for="level">Maximum Level:</label><br />
26
- <select name="level" id="level" class="sel_list_class">
27
- <option value="option1">Expert</option>
28
- <option value="option2">Advanced</option>
29
- <option value="option3">Basic</option>
30
- </select>
31
-
32
- <p id="SetPasswordLink"><a href="#" onclick="showPasswordFields();">Set Password</a></p>
33
-
34
- <div id="password_area" style="display:none;">
35
- <p><label id="lbl_password" class="Fld" for="password">Password:</label><br />
36
- <input id="password" name="password" class="Fld" size="40" type="password"/></p>
37
- <p><label id="lbl_confirmPassword" class="Fld" for="confirmPassword">Confirm Password:</label><br />
38
- <input id="confirmPassword" name="confirmPassword" class="Fld" size="40" type="password"/></p>
39
- </div>
40
-
41
- <p id="RevealCapabilities"><a href="#" onclick="showCapabilities();">Save Current Information</a></p>
42
-
43
- <div id="capabilities_area" style="display:none;">
44
- <p><label id="lbl_role" class="Fld" for="role">Role:</label><br />
45
- <select name="role" id="role" class="sel_list_class">
46
- <option value="option1">Administrator</option>
47
- <option value="option2">Clinical Administrator</option>
48
- <option value="option3">Project Sponsor</option>
49
- </select>
50
-
51
- <p><strong>Additional Capabilities:</strong></p>
52
- <input id="can_edit" name="can_edit" class="cb_class" type="checkbox" value="1"/> Can Edit Reports<br />
53
- <input id="can_export" name="can_export" class="cb_class" type="checkbox" value="2"/> Can Export Report Data<br />
54
- <input id="can_access_api" name="can_access_api" class="cb_class" type="checkbox" value="3"/> Can Access Web Services<br />
55
- <input id="can_administrate" name="can_administrate" class="cb_class" type="checkbox" value="4"/> Can Administrate
56
- </div>
57
-
58
- <p><input id="btnSubmit" name="btnSubmit" class="btn" type="submit" value="Create User"></p>
59
- </form>
60
- </section>
@@ -1,31 +0,0 @@
1
- <section id="plans">
2
-
3
- <p><a href="create_plan">Add New Plan</a> <span id="navigate"><a href="entity_list">Back to List</a> | <a href="test_database">Logout</a></span></p>
4
-
5
- <hr/>
6
-
7
- <% if @plans.count > 0 %>
8
- <table class="entity">
9
- <caption>
10
- <strong>Current Plans</strong>
11
- </caption>
12
- <thead>
13
- <th id="planName">Plan Name</th>
14
- <th id="planStudy">Associated Study</th>
15
- <th id="planDescription">Plan Description</th>
16
- </thead>
17
- <tbody>
18
- <% @plans.each do |plan| %>
19
- <tr>
20
- <td headers="planName"><%= plan.plan_name %></td>
21
- <td headers="planStudy"><%= plan.study %></td>
22
- <td headers="planDescription"><%= plan.plan_description %></td>
23
- </tr>
24
- <% end %>
25
- </tbody>
26
- </table>
27
- <% else %>
28
- <p>No plans in database.</p>
29
- <% end %>
30
-
31
- </section>
@@ -1,29 +0,0 @@
1
- <section id="products">
2
- <p><a href="create_product">Add New Product</a> <span id="navigate"><a href="entity_list">Back to List</a> | <a href="test_database">Logout</a></span></p>
3
-
4
- <hr/>
5
-
6
- <% if @products.length > 0 %>
7
- <table class="entity">
8
- <caption>
9
- <strong>Current Products</strong>
10
- </caption>
11
- <thead>
12
- <th id="productID">Product ID</th>
13
- <th id="productName">Product Name</th>
14
- <th id="productDescription">Product Description</th>
15
- </thead>
16
- <tbody>
17
- <% @products.each do |product| %>
18
- <tr>
19
- <td headers="productID"><%= product.product_id %></td>
20
- <td headers="productName"><%= product.name %></td>
21
- <td headers="productDescription"><%= product.description %></td>
22
- </tr>
23
- <% end %>
24
- </tbody>
25
- </table>
26
- <% else %>
27
- <p>No products in database.</p>
28
- <% end %>
29
- </section>
@@ -1,33 +0,0 @@
1
- <section id="studies">
2
-
3
- <p><a href="create_study">Add New Study</a> <span id="navigate"><a href="entity_list">Back to List</a> | <a href="test_database">Logout</a></span></p>
4
-
5
- <hr/>
6
-
7
- <% if @studies.length > 0 %>
8
- <table class="entity">
9
- <caption>
10
- <strong>Current Studies</strong>
11
- </caption>
12
- <thead>
13
- <th id="studyName">Study Name</th>
14
- <th id="studyProduct">Associated Product</th>
15
- <th id="studyPhase">Study Phase</th>
16
- <th id="studyProtocol">Study Protocol</th>
17
- </thead>
18
- <tbody>
19
- <% @studies.each do |study| %>
20
- <tr>
21
- <td headers="studyName"><%= study.study_name %></td>
22
- <td headers="studyProduct"><%= study.product %></td>
23
- <td headers="studyPhase"><%= study.phase %></td>
24
- <td headers="studyProtocol"><%= study.protocol %></td>
25
- </tr>
26
- <% end %>
27
- </tbody>
28
- </table>
29
- <% else %>
30
- <p>No studies in database.</p>
31
- <% end %>
32
-
33
- </section>
@@ -1,23 +0,0 @@
1
- <section id="users">
2
- <p><a href="create_user">Add New User</a> <span id="navigate"><a href="entity_list">Back to List</a> | <a href="test_database">Logout</a></span></p>
3
-
4
- <hr />
5
-
6
- <% if @users.count > 0 %>
7
- <table class="entity">
8
- <thead>
9
- <th>Current Users</th>
10
- </thead>
11
- <tbody>
12
- <% @users.each do |user| %>
13
- <tr>
14
- <td><%= user.firstname + " " + user.lastname %></td>
15
- <td><%= user.loginname %></td>
16
- </tr>
17
- <% end %>
18
- </tbody>
19
- </table>
20
- <% else %>
21
- <p>No users in database.</p>
22
- <% end %>
23
- </section>