friendly-cukes 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/DETAILED_DESCRIPTION.md +235 -0
  4. data/Gemfile +17 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +108 -0
  7. data/Rakefile +2 -0
  8. data/bin/build-extractor +69 -0
  9. data/bin/friendly-cukes +48 -0
  10. data/friendly-cukes.gemspec +41 -0
  11. data/lib/friendly/build_extractor.rb +647 -0
  12. data/lib/friendly/cukes.rb +29 -0
  13. data/lib/friendly/cukes/framework/Gemfile +16 -0
  14. data/lib/friendly/cukes/framework/Gemfile.lock +113 -0
  15. data/lib/friendly/cukes/framework/Rakefile.rb +19 -0
  16. data/lib/friendly/cukes/framework/config/config.yml +87 -0
  17. data/lib/friendly/cukes/framework/config/cucumber.yml +49 -0
  18. data/lib/friendly/cukes/framework/coverage/.last_run.json +5 -0
  19. data/lib/friendly/cukes/framework/coverage/.resultset.json +3519 -0
  20. data/lib/friendly/cukes/framework/coverage/.resultset.json.lock +0 -0
  21. data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/jquery-1.3.2.min.js +19 -0
  22. data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/jquery.tablesorter.min.js +15 -0
  23. data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/print.css +12 -0
  24. data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/rcov.js +42 -0
  25. data/lib/friendly/cukes/framework/coverage/rcov/assets/0.2.3/screen.css +270 -0
  26. data/lib/friendly/cukes/framework/coverage/rcov/index.html +392 -0
  27. data/lib/friendly/cukes/framework/coverage/rcov/library-app_init-app_driver_rb.html +98 -0
  28. data/lib/friendly/cukes/framework/coverage/rcov/library-app_utils-data_file_names_rb.html +65 -0
  29. data/lib/friendly/cukes/framework/coverage/rcov/library-app_utils-page_utils_rb.html +533 -0
  30. data/lib/friendly/cukes/framework/coverage/rcov/library-generic-create_log_rb.html +521 -0
  31. data/lib/friendly/cukes/framework/coverage/rcov/library-generic-custom_html_report_rb.html +2522 -0
  32. data/lib/friendly/cukes/framework/coverage/rcov/library-generic-datetime_library_rb.html +296 -0
  33. data/lib/friendly/cukes/framework/coverage/rcov/library-generic-file_library_rb.html +995 -0
  34. data/lib/friendly/cukes/framework/coverage/rcov/library-generic-performance_report_rb.html +1613 -0
  35. data/lib/friendly/cukes/framework/coverage/rcov/library-generic-read_from_yml_rb.html +944 -0
  36. data/lib/friendly/cukes/framework/coverage/rcov/object_repository-desktop-gem_search_rb.html +773 -0
  37. data/lib/friendly/cukes/framework/coverage/rcov/object_repository-desktop-google_search_rb.html +230 -0
  38. data/lib/friendly/cukes/framework/coverage/rcov/object_repository-mobile-mobile_google_search_rb.html +230 -0
  39. data/lib/friendly/cukes/framework/coverage/rcov/step_definitions-desktop-gem_search_rb.html +188 -0
  40. data/lib/friendly/cukes/framework/coverage/rcov/step_definitions-desktop-google_search_steps_rb.html +167 -0
  41. data/lib/friendly/cukes/framework/coverage/rcov/step_definitions-mobile-mobile_google_search_steps_rb.html +167 -0
  42. data/lib/friendly/cukes/framework/coverage/rcov/support-browser_settings_rb.html +851 -0
  43. data/lib/friendly/cukes/framework/coverage/rcov/support-env_rb.html +242 -0
  44. data/lib/friendly/cukes/framework/coverage/rcov/support-hooks_rb.html +878 -0
  45. data/lib/friendly/cukes/framework/coverage/rcov/support-html_formatter_rb.html +230 -0
  46. data/lib/friendly/cukes/framework/features/desktop/google_search/google_search.feature +19 -0
  47. data/lib/friendly/cukes/framework/features/desktop/rubygems_search/gem_name_tc_04.yml +2 -0
  48. data/lib/friendly/cukes/framework/features/desktop/rubygems_search/gem_search.feature +37 -0
  49. data/lib/friendly/cukes/framework/features/desktop/test_data/gem_name.yml +2 -0
  50. data/lib/friendly/cukes/framework/features/mobile/google_search/mobile_google_search.feature +19 -0
  51. data/lib/friendly/cukes/framework/library/app_init/app_init.rb +13 -0
  52. data/lib/friendly/cukes/framework/library/app_utils/data_file_names.rb +2 -0
  53. data/lib/friendly/cukes/framework/library/app_utils/page_utils.rb +157 -0
  54. data/lib/friendly/cukes/framework/library/generic/app_logo_1.png +0 -0
  55. data/lib/friendly/cukes/framework/library/generic/create_log.rb +154 -0
  56. data/lib/friendly/cukes/framework/library/generic/custom_html_report.rb +852 -0
  57. data/lib/friendly/cukes/framework/library/generic/datetime_library.rb +79 -0
  58. data/lib/friendly/cukes/framework/library/generic/file_library.rb +311 -0
  59. data/lib/friendly/cukes/framework/library/generic/performance_report.rb +518 -0
  60. data/lib/friendly/cukes/framework/library/generic/read_from_yml.rb +294 -0
  61. data/lib/friendly/cukes/framework/object_repository/desktop/desktop_web_object_repo.rb +50 -0
  62. data/lib/friendly/cukes/framework/object_repository/mobile/mobile_web_object_repo.rb +22 -0
  63. data/lib/friendly/cukes/framework/page_objects/desktop/gem_search.rb +213 -0
  64. data/lib/friendly/cukes/framework/page_objects/desktop/google_search.rb +53 -0
  65. data/lib/friendly/cukes/framework/page_objects/mobile/mobile_google_search.rb +53 -0
  66. data/lib/friendly/cukes/framework/step_definitions/desktop/gem_search.rb +43 -0
  67. data/lib/friendly/cukes/framework/step_definitions/desktop/google_search_steps.rb +36 -0
  68. data/lib/friendly/cukes/framework/step_definitions/mobile/mobile_google_search_steps.rb +36 -0
  69. data/lib/friendly/cukes/framework/support/browser_settings.rb +264 -0
  70. data/lib/friendly/cukes/framework/support/env.rb +65 -0
  71. data/lib/friendly/cukes/framework/support/hooks.rb +274 -0
  72. data/lib/friendly/cukes/framework/support/html_formatter.rb +57 -0
  73. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/app_env.log +15 -0
  74. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/detailed_report/app_logo_1.png +0 -0
  75. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/detailed_report/desktop_gem_search.html +647 -0
  76. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/detailed_report/desktop_google_search.html +590 -0
  77. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/custom_report/report_home.html +593 -0
  78. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/desktop_rubygems_search.log +84 -0
  79. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/report_21_05_2015-11_04_54.html +472 -0
  80. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_33/report_21_05_2015-11_04_54.json +299 -0
  81. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/app_env.log +15 -0
  82. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/desktop_google_search.log +22 -0
  83. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/report_21_05_2015-11_03_49.html +472 -0
  84. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-11_03_37/report_21_05_2015-11_03_49.json +155 -0
  85. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/app_env.log +15 -0
  86. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/mobile_google_search.log +22 -0
  87. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/report_21_05_2015-17_29_26.html +472 -0
  88. data/lib/friendly/cukes/framework/test_result/test_report_21_05_2015-17_28_10/report_21_05_2015-17_29_26.json +143 -0
  89. data/lib/friendly/cukes/version.rb +61 -0
  90. metadata +309 -0
@@ -0,0 +1,230 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <title>support/html_formatter.rb</title>
5
+ <link href="./assets/0.2.3/screen.css" media="all" rel="stylesheet" type="text/css" />
6
+ <link href="./assets/0.2.3/print.css" media="print" rel="stylesheet" type="text/css" />
7
+ <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
8
+ <script type="text/javascript" src="./assets/0.2.3/rcov.js"></script>
9
+ </head>
10
+ <body>
11
+ <h1>Cukes C0 Coverage Information - Simploco - RCov</h1>
12
+ <h2>support/html_formatter.rb</h2>
13
+
14
+ <div class="report_table_wrapper">
15
+ <table class='report' id='report_table'>
16
+ <thead>
17
+ <tr>
18
+ <th class="left_align">Name</th>
19
+ <th class="right_align">Total Lines</th>
20
+ <th class="right_align">Lines of Code</th>
21
+ <th class="left_align">Total Coverage</th>
22
+ <th class="left_align">Code Coverage</th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td class="left_align"><a href="support-html_formatter_rb.html">support/html_formatter.rb</a></td>
28
+ <td class='right_align'><tt>57</tt></td>
29
+ <td class='right_align'><tt>14</tt></td>
30
+ <td class="left_align"><div class="percent_graph_legend"><tt class=''>85.96%</tt></div>
31
+ <div class="percent_graph">
32
+ <div class="covered" style="width:86px"></div>
33
+ <div class="uncovered" style="width:14px"></div>
34
+ </div></td>
35
+ <td class="left_align"><div class="percent_graph_legend"><tt class=''>42.86%</tt></div>
36
+ <div class="percent_graph">
37
+ <div class="covered" style="width:43px"></div>
38
+ <div class="uncovered" style="width:57px"></div>
39
+ </div></td>
40
+ </tr>
41
+ </tbody>
42
+ </table>
43
+ </div>
44
+
45
+ <h3>Key</h3>
46
+
47
+ <div class="key"><pre><span class='marked'>Code reported as executed by Ruby looks like this...</span><span class='marked1'>and this: this line is also marked as covered.</span><span class='inferred'>Lines considered as run by rcov, but not reported by Ruby, look like this,</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).</span><span class='uncovered'>Finally, here's a line marked as not executed.</span></pre></div>
48
+
49
+ <h3>Coverage Details</h3>
50
+
51
+ <table class="details">
52
+ <tbody>
53
+ <tr class="inferred">
54
+ <td><pre><a name="line2">2</a> =begin</pre></td>
55
+ </tr>
56
+ <tr class="inferred">
57
+ <td><pre><a name="line3">3</a> *Name : HtmlFormatter</pre></td>
58
+ </tr>
59
+ <tr class="inferred">
60
+ <td><pre><a name="line4">4</a> *Description : class that defines wrapper methods for Cucumber generated report</pre></td>
61
+ </tr>
62
+ <tr class="inferred">
63
+ <td><pre><a name="line5">5</a> *Author : Chandra sekaran</pre></td>
64
+ </tr>
65
+ <tr class="inferred">
66
+ <td><pre><a name="line6">6</a> *Creation Date : 24/04/2015</pre></td>
67
+ </tr>
68
+ <tr class="inferred">
69
+ <td><pre><a name="line7">7</a> *Updation Date :</pre></td>
70
+ </tr>
71
+ <tr class="inferred">
72
+ <td><pre><a name="line8">8</a> =end</pre></td>
73
+ </tr>
74
+ <tr class="inferred">
75
+ <td><pre><a name="line9">9</a> </pre></td>
76
+ </tr>
77
+ <tr class="marked">
78
+ <td><pre><a name="line10">10</a> require &#39;cucumber/formatter/html&#39;</pre></td>
79
+ </tr>
80
+ <tr class="inferred">
81
+ <td><pre><a name="line11">11</a> </pre></td>
82
+ </tr>
83
+ <tr class="marked">
84
+ <td><pre><a name="line12">12</a> module Formatter</pre></td>
85
+ </tr>
86
+ <tr class="marked">
87
+ <td><pre><a name="line13">13</a> class HtmlFormatter &lt; Cucumber::Formatter::Html # for uaing @builder object</pre></td>
88
+ </tr>
89
+ <tr class="inferred">
90
+ <td><pre><a name="line14">14</a> </pre></td>
91
+ </tr>
92
+ <tr class="inferred">
93
+ <td><pre><a name="line15">15</a> # Description : embeds the given input file type to cucumber report</pre></td>
94
+ </tr>
95
+ <tr class="inferred">
96
+ <td><pre><a name="line16">16</a> # Author : Chandra sekaran</pre></td>
97
+ </tr>
98
+ <tr class="inferred">
99
+ <td><pre><a name="line17">17</a> # Arguments :</pre></td>
100
+ </tr>
101
+ <tr class="inferred">
102
+ <td><pre><a name="line18">18</a> # str_src : relative path of the file</pre></td>
103
+ </tr>
104
+ <tr class="inferred">
105
+ <td><pre><a name="line19">19</a> # str_mime_type : type of file</pre></td>
106
+ </tr>
107
+ <tr class="inferred">
108
+ <td><pre><a name="line20">20</a> # str_label : link text on click of click of which shows the embedded file</pre></td>
109
+ </tr>
110
+ <tr class="inferred">
111
+ <td><pre><a name="line21">21</a> #</pre></td>
112
+ </tr>
113
+ <tr class="marked">
114
+ <td><pre><a name="line22">22</a> def embed(str_src, str_mime_type, str_label)</pre></td>
115
+ </tr>
116
+ <tr class="uncovered">
117
+ <td><pre><a name="line23">23</a> case str_mime_type</pre></td>
118
+ </tr>
119
+ <tr class="inferred">
120
+ <td><pre><a name="line24">24</a> when /^image\/(png|gif|jpg|jpeg)/</pre></td>
121
+ </tr>
122
+ <tr class="uncovered">
123
+ <td><pre><a name="line25">25</a> embed_image(str_src, str_label)</pre></td>
124
+ </tr>
125
+ <tr class="inferred">
126
+ <td><pre><a name="line26">26</a> when /^text\/plain/</pre></td>
127
+ </tr>
128
+ <tr class="uncovered">
129
+ <td><pre><a name="line27">27</a> embed_file(str_src, str_label)</pre></td>
130
+ </tr>
131
+ <tr class="inferred">
132
+ <td><pre><a name="line28">28</a> end</pre></td>
133
+ </tr>
134
+ <tr class="inferred">
135
+ <td><pre><a name="line29">29</a> end</pre></td>
136
+ </tr>
137
+ <tr class="inferred">
138
+ <td><pre><a name="line30">30</a> </pre></td>
139
+ </tr>
140
+ <tr class="inferred">
141
+ <td><pre><a name="line31">31</a> # Description : embeds a link with the given input string</pre></td>
142
+ </tr>
143
+ <tr class="inferred">
144
+ <td><pre><a name="line32">32</a> # Author : Chandra sekaran</pre></td>
145
+ </tr>
146
+ <tr class="inferred">
147
+ <td><pre><a name="line33">33</a> # Arguments :</pre></td>
148
+ </tr>
149
+ <tr class="inferred">
150
+ <td><pre><a name="line34">34</a> # str_src : relative path of the file</pre></td>
151
+ </tr>
152
+ <tr class="inferred">
153
+ <td><pre><a name="line35">35</a> # str_label : link text</pre></td>
154
+ </tr>
155
+ <tr class="inferred">
156
+ <td><pre><a name="line36">36</a> #</pre></td>
157
+ </tr>
158
+ <tr class="marked">
159
+ <td><pre><a name="line37">37</a> def embed_link(str_src, str_label)</pre></td>
160
+ </tr>
161
+ <tr class="uncovered">
162
+ <td><pre><a name="line38">38</a> @builder.span(:class =&gt; &#39;embed&#39;) do |pre|</pre></td>
163
+ </tr>
164
+ <tr class="uncovered">
165
+ <td><pre><a name="line39">39</a> pre &lt;&lt; %{&lt;a href=&quot;#{str_src}&quot; target=&quot;_blank&quot;&gt;&quot;#{str_label}&quot;&lt;/a&gt; }</pre></td>
166
+ </tr>
167
+ <tr class="inferred">
168
+ <td><pre><a name="line40">40</a> end</pre></td>
169
+ </tr>
170
+ <tr class="inferred">
171
+ <td><pre><a name="line41">41</a> end</pre></td>
172
+ </tr>
173
+ <tr class="inferred">
174
+ <td><pre><a name="line42">42</a> </pre></td>
175
+ </tr>
176
+ <tr class="inferred">
177
+ <td><pre><a name="line43">43</a> # Description : embeds the given input file type to cucumber report</pre></td>
178
+ </tr>
179
+ <tr class="inferred">
180
+ <td><pre><a name="line44">44</a> # Author : Chandra sekaran</pre></td>
181
+ </tr>
182
+ <tr class="inferred">
183
+ <td><pre><a name="line45">45</a> # Arguments :</pre></td>
184
+ </tr>
185
+ <tr class="inferred">
186
+ <td><pre><a name="line46">46</a> # str_src : relative path of the file</pre></td>
187
+ </tr>
188
+ <tr class="inferred">
189
+ <td><pre><a name="line47">47</a> # str_label : link text on click of click of which shows the embedded file</pre></td>
190
+ </tr>
191
+ <tr class="inferred">
192
+ <td><pre><a name="line48">48</a> #</pre></td>
193
+ </tr>
194
+ <tr class="marked">
195
+ <td><pre><a name="line49">49</a> def embed_file(str_src, str_label = &quot;Click to view embedded file&quot;)</pre></td>
196
+ </tr>
197
+ <tr class="uncovered">
198
+ <td><pre><a name="line50">50</a> id = &quot;object_#{Time.now.strftime(&quot;%y%m%d%H%M%S&quot;)}&quot;</pre></td>
199
+ </tr>
200
+ <tr class="uncovered">
201
+ <td><pre><a name="line51">51</a> @builder.span(:class =&gt; &#39;embed&#39;) do |pre|</pre></td>
202
+ </tr>
203
+ <tr class="inferred">
204
+ <td><pre><a name="line52">52</a> pre &lt;&lt; %{&lt;a href=&quot;&quot; onclick=&quot;o=document.getElementById(&#39;#{id}&#39;); o.style.display = (o.style.display == &#39;none&#39; ? &#39;block&#39; : &#39;none&#39;);return false&quot;&gt;#{str_label}&lt;/a&gt;&lt;br&gt;&amp;nbsp;</pre></td>
205
+ </tr>
206
+ <tr class="uncovered">
207
+ <td><pre><a name="line53">53</a> &lt;object id=&quot;#{id}&quot; data=&quot;#{str_src}&quot; type=&quot;text/plain&quot; width=&quot;100%&quot; style=&quot;height: 10em;display: none&quot;&gt;&lt;/object&gt;}</pre></td>
208
+ </tr>
209
+ <tr class="inferred">
210
+ <td><pre><a name="line54">54</a> end</pre></td>
211
+ </tr>
212
+ <tr class="inferred">
213
+ <td><pre><a name="line55">55</a> end</pre></td>
214
+ </tr>
215
+ <tr class="inferred">
216
+ <td><pre><a name="line56">56</a> </pre></td>
217
+ </tr>
218
+ <tr class="inferred">
219
+ <td><pre><a name="line57">57</a> end</pre></td>
220
+ </tr>
221
+ <tr class="inferred">
222
+ <td><pre><a name="line58">58</a> end</pre></td>
223
+ </tr>
224
+ </tbody>
225
+ </table>
226
+
227
+ <p>Generated on 2015-05-08 10:40:30 +0530 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
228
+
229
+ </body>
230
+ </html>
@@ -0,0 +1,19 @@
1
+ # Name : Google Search
2
+ # Description : covers scenarios under Google search
3
+ # Author : Chandra sekaran
4
+
5
+ # Important Note : To run this feature add APP=GOOGLE in cucumber run command
6
+ # Cucumber run cmd : cucumber -p desktop_dev_chrome -t @rq_desktop_google APP=GOOGLE
7
+ # : you can use any desktop browser profile in -p
8
+ # Rake run cmd : rake desktop_google_search
9
+
10
+ @rq_desktop_google
11
+ Feature: Google for a given input string
12
+
13
+ @tc_01
14
+ Scenario: Search for "bet365" in google and open "bet365.com" website
15
+ Given the user is on the Google home page
16
+ When the user enters "bet365" in the search textbox and clicks the search button
17
+ Then the user should be shown the search results
18
+ When the user clicks the link for bet365
19
+ Then the user should be redirected to the bet365.com website
@@ -0,0 +1,37 @@
1
+ # Name : Gem Search
2
+ # Description : covers scenarios under RubyGem search
3
+ # Author : Chandra sekaran
4
+
5
+ # Important Note : To run this feature add APP=RUBYGEMS in cucumber run command
6
+ # Cucumber run cmd : cucumber -p desktop_dev_chrome -t @rq_rubygems APP=RUBYGEMS
7
+ # : you can use any desktop browser profile in -p
8
+ # Rake run cmd : rake desktop_rubygems_search
9
+
10
+ @rq_rubygems
11
+ Feature: Fetch the details of a gem from rubygems.org having the maximum downloads
12
+
13
+ Background: Login to rubygems.org website
14
+ Given the user is on the rubygems.org home page
15
+ And the user is signed in
16
+
17
+ @tc_02
18
+ Scenario: Find a given static gem name in rubygems.org web site
19
+ When the user enters "watir" in search textbox and press enter
20
+ Then the user should be redirected to gem list page of "watir" gem
21
+ When the user selects the gem having the maximum downloads
22
+ Then the user should be shown the gem description page
23
+ And the user is signed out
24
+
25
+ @tc_03
26
+ Scenario: Find a given gem from global test data file in rubygems.org web site
27
+ When the user searches for a gem name from test data
28
+ And the user selects the gem having the maximum downloads
29
+ Then the user should be shown the gem description page
30
+ And the user is signed out
31
+
32
+ @tc_04
33
+ Scenario: Find a given gem from local test data file in rubygems.org web site
34
+ When the user searches for a gem name from test data
35
+ And the user selects the gem having the maximum downloads
36
+ Then the user should be shown the gem description page
37
+ And the user is signed out
@@ -0,0 +1,2 @@
1
+ gems:
2
+ gem_name: "ironruby"
@@ -0,0 +1,19 @@
1
+ # Name : Google Search
2
+ # Description : covers scenarios under Google search on mobile
3
+ # Author : Chandra sekaran
4
+
5
+ # Important Note : To run this feature add APP=GOOGLE in cucumber run command
6
+ # Cucumber run cmd : cucumber -p mobile_dev_chrome_device -t @rq_mobile_google APP=GOOGLE
7
+ # : you can use any mobile browser profile in -p
8
+ # Rake run cmd : rake mobile_google_search
9
+
10
+ @rq_mobile_google
11
+ Feature: Google for a given input string
12
+
13
+ @tc_05
14
+ Scenario: Search for "rubygems" in google and open "rubygems.org" website
15
+ Given the user is on the mobile Google home page
16
+ When the user searches for "rubygems"
17
+ Then the user should be shown search results
18
+ When the user clicks the link for mobile rubygems
19
+ Then the user should be redirected to the mobile rubygems.org website
@@ -0,0 +1,13 @@
1
+ =begin
2
+ *Name : app_driver
3
+ *Description : module to set env global to files under library directory
4
+ *Author : Chandra sekaran
5
+ *Creation Date : 28/08/2014
6
+ *Updation Date :
7
+ =end
8
+
9
+ require './support/env'
10
+
11
+ module CUKES
12
+ include PageObject
13
+ end
@@ -0,0 +1,2 @@
1
+ # Test data yml files mentioned in the name of constants
2
+ GEM_NAME = "gem_name.yml"
@@ -0,0 +1,157 @@
1
+ =begin
2
+ *Name : PageUtils
3
+ *Description : module that define methods for commonly used page-object related manipulations
4
+ *Author : Chandra sekaran
5
+ *Creation Date : 24/04/2015
6
+ *Updation Date :
7
+ =end
8
+
9
+ module CUKES
10
+ module PageUtils
11
+ include PageObject
12
+
13
+ # Description : waits until the web element is visible
14
+ # Author : Chandra sekaran
15
+ # Arguments :
16
+ # element : page object element
17
+ # str_error_message : error message to be displayed if web element is not visible within the timeout
18
+ # num_wait_time : number of seconds to wait
19
+ #
20
+ def wait_for_object(element, str_error_message = "Failure in finding the element", num_wait_time = PageObject.default_element_wait)
21
+ wait_until(num_wait_time, str_error_message) { element.visible? }
22
+ end
23
+
24
+ # Description : waits until the web page title is visible
25
+ # Author : Chandra sekaran
26
+ # Arguments :
27
+ # str_error_message : error message to be displayed if web page title is not within the timeout
28
+ # num_wait_time : number of seconds to wait
29
+ #
30
+ def wait_for_page_load(str_error_message = "Failure in page load", num_wait_time = PageObject.default_page_wait)
31
+ wait_until(num_wait_time, str_error_message) { title != '' }
32
+ end
33
+
34
+ # Description : compares two strings and throws error if the strings are unequal
35
+ # Author : Chandra sekaran
36
+ # Arguments :
37
+ # str_actual : actual string value
38
+ # str_expected : expected string value
39
+ #
40
+ def compare_string(str_actual, str_expected)
41
+ raise "The expected string is '#{str_expected}' but the actual string value is '#{str_actual}'" if str_actual != str_expected
42
+ end
43
+
44
+ # Description : waits until the web page is loading and ajax requests are completed
45
+ # Author : Gomathi
46
+ #
47
+ def wait_ajax_for_loading
48
+ wait_for_ajax(PageObject.default_element_wait) # waits until ajax request is complete
49
+ end
50
+
51
+ # Description : clicks on the given web element
52
+ # Author : Chandra sekaran
53
+ # Arguments :
54
+ # clickable_element: element object
55
+ # Return argument : a boolean value
56
+ #
57
+ def click_on(clickable_element)
58
+ wait_until(PageObject.default_element_wait) { element.visible? } rescue Exception
59
+ clickable_element.scroll_into_view rescue Exception
60
+ #if clickable_element.enabled?
61
+ clickable_element.focus rescue Exception
62
+ clickable_element.click
63
+ wait_for_page_load
64
+ #end
65
+ return true
66
+ rescue Exception => ex
67
+ clickable_element.fire_event("click") rescue Exception
68
+ $log.error("Error in clicking web element : #{ex}")
69
+ return false
70
+ end
71
+
72
+ # Description : checks if the given text is present in the current page or iframe
73
+ # Author : Chandra sekaran
74
+ # Arguments :
75
+ # page_object : page object
76
+ # str_text : string text
77
+ # num_wait : time out value
78
+ # Return argument : a boolean value
79
+ #
80
+ def is_text_present(page_object, str_text, num_wait = PageObject.default_element_wait)
81
+ wait_for_loading
82
+ page_object.wait_until(num_wait, "Failure in finding text '#{str_text}' in the page #{page_object}") do
83
+ page_object.text.include? str_text
84
+ end
85
+ return true
86
+ rescue Exception => ex
87
+ return false
88
+ end
89
+
90
+ # Description : refresh the current web page
91
+ # Author : Chandra sekaran
92
+ # Arguments :
93
+ # page_object : page object
94
+ #
95
+ def refresh_page(page_object)
96
+ page_object.refresh
97
+ wait_for_page_load
98
+ end
99
+
100
+ # Description : function for moving to newly opened browser window
101
+ # Author : Chandra sekaran
102
+ #
103
+ def switch_to_next_window
104
+ raise "Number of windows should be two" if @browser.window_handles.size != 2
105
+ window_to_switch = @browser.window_handles.find { |window| window != @browser.window_handle }
106
+ @browser.switch_to.window window_to_switch
107
+ end
108
+
109
+ # Description : closes other browser windows and switches to application main window
110
+ # Author : Chandra sekaran
111
+ #
112
+ def switch_to_application_window
113
+ if @browser.window_handles.size > 1
114
+ window_to_close = @browser.window_handle
115
+ parent_window = @browser.window_handles.find_all { |window| window != @browser.window_handle }
116
+ @browser.switch_to.window window_to_close
117
+ puts("Closing window " + @browser.title)
118
+ @browser.close
119
+ parent_window.each do |window|
120
+ @browser.switch_to.window window
121
+ end
122
+ end
123
+ end
124
+
125
+ # Description : function for getting all steps under the current running scenario
126
+ # Author : Chandra sekaran
127
+ # Argument :
128
+ # feature : feature object of current running feature file
129
+ # Return argument :
130
+ # arr_steps : array of steps
131
+ #
132
+ def get_steps(feature)
133
+ arr_steps = []
134
+ feature.feature_elements[$scenario_count].steps.each do |step|
135
+ arr_steps << step.name
136
+ end
137
+ arr_steps
138
+ end
139
+
140
+ # Description : function for getting the delay (in seconds) between the parallel executions
141
+ # Author : Chandra sekaran
142
+ # Return argument : delay in seconds
143
+ #
144
+ def get_execution_delay_time
145
+ num_seconds = 0
146
+ if DELAY_BETWEEN_PARALLEL_THREADS.downcase.include? "second"
147
+ num_seconds = DELAY_BETWEEN_PARALLEL_THREADS.scan(/\d/).join('').to_i
148
+ elsif DELAY_BETWEEN_PARALLEL_THREADS.downcase.include? "minute"
149
+ num_seconds = DELAY_BETWEEN_PARALLEL_THREADS.scan(/\d/).join('').to_i * 60
150
+ elsif DELAY_BETWEEN_PARALLEL_THREADS.downcase.include? "hour"
151
+ num_seconds = DELAY_BETWEEN_PARALLEL_THREADS.scan(/\d/).join('').to_i * 60 * 60
152
+ end
153
+ [0, 1].include?(NO_OF_PARALLEL_THREADS.to_i) ? 0 : NO_OF_PARALLEL_THREADS.to_i * num_seconds
154
+ end
155
+
156
+ end
157
+ end