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,242 @@
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/env.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/env.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-env_rb.html">support/env.rb</a></td>
28
+ <td class='right_align'><tt>61</tt></td>
29
+ <td class='right_align'><tt>33</tt></td>
30
+ <td class="left_align"><div class="percent_graph_legend"><tt class=''>100.00%</tt></div>
31
+ <div class="percent_graph">
32
+ <div class="covered" style="width:100px"></div>
33
+ <div class="uncovered" style="width:0px"></div>
34
+ </div></td>
35
+ <td class="left_align"><div class="percent_graph_legend"><tt class=''>100.00%</tt></div>
36
+ <div class="percent_graph">
37
+ <div class="covered" style="width:100px"></div>
38
+ <div class="uncovered" style="width:0px"></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 : env.rb</pre></td>
58
+ </tr>
59
+ <tr class="inferred">
60
+ <td><pre><a name="line4">4</a> *Description : requires the important classes/modules for application execution</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="inferred">
78
+ <td><pre><a name="line10">10</a> # Code Coverage report</pre></td>
79
+ </tr>
80
+ <tr class="inferred">
81
+ <td><pre><a name="line11">11</a> # the cucumber run command should include the command line argument CODE_COVERAGE=yes (or true) in order to get code</pre></td>
82
+ </tr>
83
+ <tr class="inferred">
84
+ <td><pre><a name="line12">12</a> # coverage report, which is a html report that pictorizes script LOC (Lines of COde) execution coverage</pre></td>
85
+ </tr>
86
+ <tr class="marked">
87
+ <td><pre><a name="line13">13</a> if !ENV[&quot;CODE_COVERAGE&quot;].nil? &amp;&amp; ([&quot;yes&quot;, &quot;true&quot;].include?(ENV[&quot;CODE_COVERAGE&quot;].downcase))</pre></td>
88
+ </tr>
89
+ <tr class="marked">
90
+ <td><pre><a name="line14">14</a> require &quot;simplecov&quot;</pre></td>
91
+ </tr>
92
+ <tr class="marked">
93
+ <td><pre><a name="line15">15</a> require &quot;simplecov-json&quot;</pre></td>
94
+ </tr>
95
+ <tr class="marked">
96
+ <td><pre><a name="line16">16</a> require &quot;simplecov-rcov&quot;</pre></td>
97
+ </tr>
98
+ <tr class="marked">
99
+ <td><pre><a name="line17">17</a> SimpleCov.formatters = [</pre></td>
100
+ </tr>
101
+ <tr class="inferred">
102
+ <td><pre><a name="line18">18</a> SimpleCov::Formatter::RcovFormatter</pre></td>
103
+ </tr>
104
+ <tr class="inferred">
105
+ <td><pre><a name="line19">19</a> ]</pre></td>
106
+ </tr>
107
+ <tr class="inferred">
108
+ <td><pre><a name="line20">20</a> #SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::JSONFormatter</pre></td>
109
+ </tr>
110
+ <tr class="marked">
111
+ <td><pre><a name="line21">21</a> SimpleCov.start</pre></td>
112
+ </tr>
113
+ <tr class="inferred">
114
+ <td><pre><a name="line22">22</a> end</pre></td>
115
+ </tr>
116
+ <tr class="inferred">
117
+ <td><pre><a name="line23">23</a> </pre></td>
118
+ </tr>
119
+ <tr class="marked">
120
+ <td><pre><a name="line24">24</a> require &quot;rubygems&quot;</pre></td>
121
+ </tr>
122
+ <tr class="marked">
123
+ <td><pre><a name="line25">25</a> require &quot;page-object&quot;</pre></td>
124
+ </tr>
125
+ <tr class="marked">
126
+ <td><pre><a name="line26">26</a> require &quot;watir-webdriver&quot;</pre></td>
127
+ </tr>
128
+ <tr class="marked">
129
+ <td><pre><a name="line27">27</a> require &quot;yaml&quot;</pre></td>
130
+ </tr>
131
+ <tr class="marked">
132
+ <td><pre><a name="line28">28</a> require &quot;logger&quot;</pre></td>
133
+ </tr>
134
+ <tr class="marked">
135
+ <td><pre><a name="line29">29</a> require &quot;fileutils&quot;</pre></td>
136
+ </tr>
137
+ <tr class="marked">
138
+ <td><pre><a name="line30">30</a> require &quot;time_difference&quot;</pre></td>
139
+ </tr>
140
+ <tr class="marked">
141
+ <td><pre><a name="line31">31</a> require &quot;data_magic&quot;</pre></td>
142
+ </tr>
143
+ <tr class="marked">
144
+ <td><pre><a name="line32">32</a> require &quot;require_all&quot;</pre></td>
145
+ </tr>
146
+ <tr class="marked">
147
+ <td><pre><a name="line33">33</a> require &quot;nokogiri&quot;</pre></td>
148
+ </tr>
149
+ <tr class="marked">
150
+ <td><pre><a name="line34">34</a> require &quot;open3&quot; # for capturing STDOUT, STDERR messages</pre></td>
151
+ </tr>
152
+ <tr class="marked">
153
+ <td><pre><a name="line35">35</a> require &quot;json&quot; # for json file manipulation in performance report</pre></td>
154
+ </tr>
155
+ <tr class="marked">
156
+ <td><pre><a name="line36">36</a> require &quot;dbi&quot; if ENV[&quot;PLATFORM&quot;].downcase == &quot;desktop&quot; # for db Sybase - performance report data store</pre></td>
157
+ </tr>
158
+ <tr class="marked">
159
+ <td><pre><a name="line37">37</a> require &quot;appium_lib&quot; if ENV[&quot;PLATFORM&quot;].downcase == &quot;mobile&quot; # for mobile automation</pre></td>
160
+ </tr>
161
+ <tr class="inferred">
162
+ <td><pre><a name="line38">38</a> </pre></td>
163
+ </tr>
164
+ <tr class="marked">
165
+ <td><pre><a name="line39">39</a> require_all &quot;library&quot;</pre></td>
166
+ </tr>
167
+ <tr class="marked">
168
+ <td><pre><a name="line40">40</a> require_all &quot;object_repository&quot;</pre></td>
169
+ </tr>
170
+ <tr class="inferred">
171
+ <td><pre><a name="line41">41</a> </pre></td>
172
+ </tr>
173
+ <tr class="marked">
174
+ <td><pre><a name="line42">42</a> World(PageObject::PageFactory) # make PageObject available throughout the application</pre></td>
175
+ </tr>
176
+ <tr class="inferred">
177
+ <td><pre><a name="line43">43</a> </pre></td>
178
+ </tr>
179
+ <tr class="inferred">
180
+ <td><pre><a name="line44">44</a> # environment variables moved to constants that is available throughout the application</pre></td>
181
+ </tr>
182
+ <tr class="marked">
183
+ <td><pre><a name="line45">45</a> PLATFORM = ENV[&quot;PLATFORM&quot;] || nil # for platform if desktop/mobile</pre></td>
184
+ </tr>
185
+ <tr class="marked">
186
+ <td><pre><a name="line46">46</a> BROWSER = ENV[&quot;BROWSER&quot;] || nil # for browser if firefox/chrome/internet_explorer/safari/android</pre></td>
187
+ </tr>
188
+ <tr class="marked">
189
+ <td><pre><a name="line47">47</a> BOX = ENV[&quot;BOX&quot;] || nil # for box name having multiple profiles</pre></td>
190
+ </tr>
191
+ <tr class="marked">
192
+ <td><pre><a name="line48">48</a> DEVICE = ENV[&quot;DEVICE&quot;] || nil # for mobile device if it is attached to the machine</pre></td>
193
+ </tr>
194
+ <tr class="inferred">
195
+ <td><pre><a name="line49">49</a> </pre></td>
196
+ </tr>
197
+ <tr class="inferred">
198
+ <td><pre><a name="line50">50</a> # for resetting the profiles (in config.yml) the cucumber run command line argument should include RESET_CONFIG_VALUES=yes (or true)</pre></td>
199
+ </tr>
200
+ <tr class="inferred">
201
+ <td><pre><a name="line51">51</a> # which will reset all the profiles</pre></td>
202
+ </tr>
203
+ <tr class="marked">
204
+ <td><pre><a name="line52">52</a> RESET_CONFIG_VALUES = ENV[&quot;RESET_CONFIG_VALUES&quot;] || nil</pre></td>
205
+ </tr>
206
+ <tr class="inferred">
207
+ <td><pre><a name="line53">53</a> </pre></td>
208
+ </tr>
209
+ <tr class="marked">
210
+ <td><pre><a name="line54">54</a> $REPORT_FILE_NAME = &quot;report_#{$$}&quot; # name of the cucumber generated report file (appended with process id as unique value)</pre></td>
211
+ </tr>
212
+ <tr class="inferred">
213
+ <td><pre><a name="line55">55</a> </pre></td>
214
+ </tr>
215
+ <tr class="inferred">
216
+ <td><pre><a name="line56">56</a> # validating command environment variables</pre></td>
217
+ </tr>
218
+ <tr class="marked">
219
+ <td><pre><a name="line57">57</a> raise &quot;Command Line Exception : PLATFORM can not be nil&quot; if PLATFORM.nil?</pre></td>
220
+ </tr>
221
+ <tr class="marked">
222
+ <td><pre><a name="line58">58</a> raise &quot;Command Line Exception : BROWSER can not be nil&quot; if BROWSER.nil?</pre></td>
223
+ </tr>
224
+ <tr class="inferred">
225
+ <td><pre><a name="line59">59</a> </pre></td>
226
+ </tr>
227
+ <tr class="marked">
228
+ <td><pre><a name="line60">60</a> PageObject.javascript_framework = :jquery # for handling AJAX</pre></td>
229
+ </tr>
230
+ <tr class="inferred">
231
+ <td><pre><a name="line61">61</a> </pre></td>
232
+ </tr>
233
+ <tr class="marked">
234
+ <td><pre><a name="line62">62</a> World(CUKES::PageUtils) # make PageUtils methods global to entire TAF</pre></td>
235
+ </tr>
236
+ </tbody>
237
+ </table>
238
+
239
+ <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>
240
+
241
+ </body>
242
+ </html>
@@ -0,0 +1,878 @@
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/hooks.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/hooks.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-hooks_rb.html">support/hooks.rb</a></td>
28
+ <td class='right_align'><tt>273</tt></td>
29
+ <td class='right_align'><tt>129</tt></td>
30
+ <td class="left_align"><div class="percent_graph_legend"><tt class=''>89.74%</tt></div>
31
+ <div class="percent_graph">
32
+ <div class="covered" style="width:90px"></div>
33
+ <div class="uncovered" style="width:10px"></div>
34
+ </div></td>
35
+ <td class="left_align"><div class="percent_graph_legend"><tt class=''>78.29%</tt></div>
36
+ <div class="percent_graph">
37
+ <div class="covered" style="width:78px"></div>
38
+ <div class="uncovered" style="width:22px"></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 : hooks.rb</pre></td>
58
+ </tr>
59
+ <tr class="inferred">
60
+ <td><pre><a name="line4">4</a> *Description : hooks definition to perform task pre/post a scenario and/or step execution</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> $log = CUKES::CreateLog.new(&quot;app_env&quot;) # base log to hold the environment details</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> $obj_yml = CUKES::Read_From_YML.new(&quot;config/config.yml&quot;) # read the config file content</pre></td>
85
+ </tr>
86
+ <tr class="inferred">
87
+ <td><pre><a name="line13">13</a> </pre></td>
88
+ </tr>
89
+ <tr class="inferred">
90
+ <td><pre><a name="line14">14</a> # for resetting config values</pre></td>
91
+ </tr>
92
+ <tr class="marked">
93
+ <td><pre><a name="line15">15</a> if !RESET_CONFIG_VALUES.nil?</pre></td>
94
+ </tr>
95
+ <tr class="uncovered">
96
+ <td><pre><a name="line16">16</a> $obj_yml.set_value(&quot;environment/parallel_execution_count&quot;, 0) # reset parallel execution count</pre></td>
97
+ </tr>
98
+ <tr class="uncovered">
99
+ <td><pre><a name="line17">17</a> $obj_yml.release_all_profiles # release all unused profiles</pre></td>
100
+ </tr>
101
+ <tr class="inferred">
102
+ <td><pre><a name="line18">18</a> end</pre></td>
103
+ </tr>
104
+ <tr class="inferred">
105
+ <td><pre><a name="line19">19</a> </pre></td>
106
+ </tr>
107
+ <tr class="inferred">
108
+ <td><pre><a name="line20">20</a> # this global variable holds the number of parallel executions (also accounts for single execution)</pre></td>
109
+ </tr>
110
+ <tr class="inferred">
111
+ <td><pre><a name="line21">21</a> # and generates consolidated custom html report file(s)</pre></td>
112
+ </tr>
113
+ <tr class="marked">
114
+ <td><pre><a name="line22">22</a> $parallel_execution_count = $obj_yml.get_value(&quot;environment/parallel_execution_count&quot;)</pre></td>
115
+ </tr>
116
+ <tr class="inferred">
117
+ <td><pre><a name="line23">23</a> </pre></td>
118
+ </tr>
119
+ <tr class="inferred">
120
+ <td><pre><a name="line24">24</a> # set dynamic profile for a specific box or any free box</pre></td>
121
+ </tr>
122
+ <tr class="marked">
123
+ <td><pre><a name="line25">25</a> if ENV[&quot;PROFILE&quot;].downcase == &quot;development&quot;</pre></td>
124
+ </tr>
125
+ <tr class="marked">
126
+ <td><pre><a name="line26">26</a> if BOX.nil?</pre></td>
127
+ </tr>
128
+ <tr class="marked">
129
+ <td><pre><a name="line27">27</a> BOX, PROFILE = $obj_yml.get_any_profile(&quot;development&quot;)</pre></td>
130
+ </tr>
131
+ <tr class="inferred">
132
+ <td><pre><a name="line28">28</a> else</pre></td>
133
+ </tr>
134
+ <tr class="uncovered">
135
+ <td><pre><a name="line29">29</a> PROFILE = $obj_yml.get_specific_profile(&quot;development&quot;)</pre></td>
136
+ </tr>
137
+ <tr class="inferred">
138
+ <td><pre><a name="line30">30</a> end</pre></td>
139
+ </tr>
140
+ <tr class="inferred">
141
+ <td><pre><a name="line31">31</a> elsif ENV[&quot;PROFILE&quot;].downcase == &quot;test&quot;</pre></td>
142
+ </tr>
143
+ <tr class="uncovered">
144
+ <td><pre><a name="line32">32</a> if BOX.nil?</pre></td>
145
+ </tr>
146
+ <tr class="uncovered">
147
+ <td><pre><a name="line33">33</a> BOX, PROFILE = $obj_yml.get_any_profile(&quot;test&quot;)</pre></td>
148
+ </tr>
149
+ <tr class="inferred">
150
+ <td><pre><a name="line34">34</a> else</pre></td>
151
+ </tr>
152
+ <tr class="uncovered">
153
+ <td><pre><a name="line35">35</a> PROFILE = $obj_yml.get_specific_profile(&quot;test&quot;)</pre></td>
154
+ </tr>
155
+ <tr class="inferred">
156
+ <td><pre><a name="line36">36</a> end</pre></td>
157
+ </tr>
158
+ <tr class="inferred">
159
+ <td><pre><a name="line37">37</a> else</pre></td>
160
+ </tr>
161
+ <tr class="uncovered">
162
+ <td><pre><a name="line38">38</a> raise &quot;Invalid profile name : #{ENV[&quot;PROFILE&quot;]}&quot;</pre></td>
163
+ </tr>
164
+ <tr class="inferred">
165
+ <td><pre><a name="line39">39</a> end</pre></td>
166
+ </tr>
167
+ <tr class="inferred">
168
+ <td><pre><a name="line40">40</a> </pre></td>
169
+ </tr>
170
+ <tr class="marked">
171
+ <td><pre><a name="line41">41</a> GOOGLE_URL = $obj_yml.get_value(&quot;application/#{BOX}/#{PROFILE}/url/google&quot;) # get the google url to be launched</pre></td>
172
+ </tr>
173
+ <tr class="marked">
174
+ <td><pre><a name="line42">42</a> RUBYGEMS_URL = $obj_yml.get_value(&quot;application/#{BOX}/#{PROFILE}/url/rubygems&quot;) # get the rubygems url to be launched</pre></td>
175
+ </tr>
176
+ <tr class="inferred">
177
+ <td><pre><a name="line43">43</a> </pre></td>
178
+ </tr>
179
+ <tr class="inferred">
180
+ <td><pre><a name="line44">44</a> # Since I have used two different applications, I use two different urls, else this is not required and you can use</pre></td>
181
+ </tr>
182
+ <tr class="inferred">
183
+ <td><pre><a name="line45">45</a> # the url present in config.yml file (the environment argument APP is just for demonstration only)</pre></td>
184
+ </tr>
185
+ <tr class="inferred">
186
+ <td><pre><a name="line46">46</a> # For the present feature files, if you want to run rubygems feature, kindly add APP=GOOGLE in cucumber run command</pre></td>
187
+ </tr>
188
+ <tr class="inferred">
189
+ <td><pre><a name="line47">47</a> # and for google feature add APP=GOOGLE in cucumber run command</pre></td>
190
+ </tr>
191
+ <tr class="marked">
192
+ <td><pre><a name="line48">48</a> if ENV[&quot;APP&quot;].nil?</pre></td>
193
+ </tr>
194
+ <tr class="uncovered">
195
+ <td><pre><a name="line49">49</a> launch_url = GOOGLE_URL</pre></td>
196
+ </tr>
197
+ <tr class="inferred">
198
+ <td><pre><a name="line50">50</a> elsif ENV[&quot;APP&quot;].downcase.include? &quot;google&quot;</pre></td>
199
+ </tr>
200
+ <tr class="marked">
201
+ <td><pre><a name="line51">51</a> launch_url = GOOGLE_URL</pre></td>
202
+ </tr>
203
+ <tr class="inferred">
204
+ <td><pre><a name="line52">52</a> elsif ENV[&quot;APP&quot;].downcase.include? &quot;rubygems&quot;</pre></td>
205
+ </tr>
206
+ <tr class="uncovered">
207
+ <td><pre><a name="line53">53</a> launch_url = RUBYGEMS_URL</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> </pre></td>
214
+ </tr>
215
+ <tr class="inferred">
216
+ <td><pre><a name="line56">56</a> # Login credentials</pre></td>
217
+ </tr>
218
+ <tr class="marked">
219
+ <td><pre><a name="line57">57</a> USER_NAME = $obj_yml.get_value(&quot;application/#{BOX}/#{PROFILE}/login_credentials/user_name&quot;)</pre></td>
220
+ </tr>
221
+ <tr class="marked">
222
+ <td><pre><a name="line58">58</a> PASSWORD = $obj_yml.get_value(&quot;application/#{BOX}/#{PROFILE}/login_credentials/password&quot;)</pre></td>
223
+ </tr>
224
+ <tr class="inferred">
225
+ <td><pre><a name="line59">59</a> </pre></td>
226
+ </tr>
227
+ <tr class="inferred">
228
+ <td><pre><a name="line60">60</a> # Application framework setting details</pre></td>
229
+ </tr>
230
+ <tr class="marked">
231
+ <td><pre><a name="line61">61</a> LOGGER_LEVEL = $obj_yml.get_value(&quot;environment/logger_level&quot;) # get the Logger Level</pre></td>
232
+ </tr>
233
+ <tr class="marked">
234
+ <td><pre><a name="line62">62</a> DATETIME_FORMAT = $obj_yml.get_value(&quot;environment/datetime_pattern&quot;) # get the datetime format</pre></td>
235
+ </tr>
236
+ <tr class="marked">
237
+ <td><pre><a name="line63">63</a> FEATURE_ID_PREFIX = $obj_yml.get_value(&quot;environment/feature_id_prefix&quot;) # get the feature id prefix</pre></td>
238
+ </tr>
239
+ <tr class="marked">
240
+ <td><pre><a name="line64">64</a> SCENARIO_ID_PREFIX = $obj_yml.get_value(&quot;environment/scenario_id_prefix&quot;) # get the scenario id prefix</pre></td>
241
+ </tr>
242
+ <tr class="inferred">
243
+ <td><pre><a name="line65">65</a> </pre></td>
244
+ </tr>
245
+ <tr class="inferred">
246
+ <td><pre><a name="line66">66</a> # for consolidated html report</pre></td>
247
+ </tr>
248
+ <tr class="marked">
249
+ <td><pre><a name="line67">67</a> NO_OF_PARALLEL_THREADS = $obj_yml.get_value(&quot;environment/no_of_parallel_threads&quot;) # get the parallel threads count</pre></td>
250
+ </tr>
251
+ <tr class="marked">
252
+ <td><pre><a name="line68">68</a> DELAY_BETWEEN_PARALLEL_THREADS = $obj_yml.get_value(&quot;environment/delay_between_parallel_threads&quot;) # get the delay between parallel threads</pre></td>
253
+ </tr>
254
+ <tr class="inferred">
255
+ <td><pre><a name="line69">69</a> </pre></td>
256
+ </tr>
257
+ <tr class="inferred">
258
+ <td><pre><a name="line70">70</a> # Performance report</pre></td>
259
+ </tr>
260
+ <tr class="inferred">
261
+ <td><pre><a name="line71">71</a> # the cucumber execution details are extracted from report(s) generated and saved into Sybase database</pre></td>
262
+ </tr>
263
+ <tr class="inferred">
264
+ <td><pre><a name="line72">72</a> # below are the database details</pre></td>
265
+ </tr>
266
+ <tr class="marked">
267
+ <td><pre><a name="line73">73</a> PERFORMANCE_REPORT = $obj_yml.get_value(&quot;environment/performance_report&quot;)</pre></td>
268
+ </tr>
269
+ <tr class="marked">
270
+ <td><pre><a name="line74">74</a> if [&quot;yes&quot;, &quot;true&quot;].include?(PERFORMANCE_REPORT.to_s.downcase)</pre></td>
271
+ </tr>
272
+ <tr class="uncovered">
273
+ <td><pre><a name="line75">75</a> DB_SERVER = $obj_yml.get_value(&quot;environment/db_server&quot;)</pre></td>
274
+ </tr>
275
+ <tr class="uncovered">
276
+ <td><pre><a name="line76">76</a> DB_NAME = $obj_yml.get_value(&quot;environment/db_name&quot;)</pre></td>
277
+ </tr>
278
+ <tr class="uncovered">
279
+ <td><pre><a name="line77">77</a> DB_USER_NAME = $obj_yml.get_value(&quot;environment/db_user_name&quot;)</pre></td>
280
+ </tr>
281
+ <tr class="uncovered">
282
+ <td><pre><a name="line78">78</a> DB_PASSWORD = $obj_yml.get_value(&quot;environment/db_password&quot;)</pre></td>
283
+ </tr>
284
+ <tr class="inferred">
285
+ <td><pre><a name="line79">79</a> end</pre></td>
286
+ </tr>
287
+ <tr class="inferred">
288
+ <td><pre><a name="line80">80</a> </pre></td>
289
+ </tr>
290
+ <tr class="inferred">
291
+ <td><pre><a name="line81">81</a> # log test execution environment details</pre></td>
292
+ </tr>
293
+ <tr class="marked">
294
+ <td><pre><a name="line82">82</a> $log.info(&quot;__________________________________________________________&quot;)</pre></td>
295
+ </tr>
296
+ <tr class="marked">
297
+ <td><pre><a name="line83">83</a> $log.info(&quot;Test Machine : #{ENV[&quot;COMPUTERNAME&quot;]}(#{ENV[&#39;OS&#39;]})&quot;)</pre></td>
298
+ </tr>
299
+ <tr class="marked">
300
+ <td><pre><a name="line84">84</a> $log.info(&quot;Test Browser : #{BROWSER}&quot;)</pre></td>
301
+ </tr>
302
+ <tr class="marked">
303
+ <td><pre><a name="line85">85</a> $log.info(&quot;Test URL : #{launch_url}&quot;) # the actual url under test can be given here</pre></td>
304
+ </tr>
305
+ <tr class="marked">
306
+ <td><pre><a name="line86">86</a> $log.info(&quot;__________________________________________________________&quot;)</pre></td>
307
+ </tr>
308
+ <tr class="inferred">
309
+ <td><pre><a name="line87">87</a> </pre></td>
310
+ </tr>
311
+ <tr class="marked">
312
+ <td><pre><a name="line88">88</a> $current_log_dir = $log.get_current_log_dir # global variable to hold the base log directory name</pre></td>
313
+ </tr>
314
+ <tr class="inferred">
315
+ <td><pre><a name="line89">89</a> </pre></td>
316
+ </tr>
317
+ <tr class="marked">
318
+ <td><pre><a name="line90">90</a> $start_time = $log.get_current_datetime # start time of the execution</pre></td>
319
+ </tr>
320
+ <tr class="inferred">
321
+ <td><pre><a name="line91">91</a> </pre></td>
322
+ </tr>
323
+ <tr class="marked">
324
+ <td><pre><a name="line92">92</a> $log_env = $log # to hold base log file object for log entries after test execution</pre></td>
325
+ </tr>
326
+ <tr class="inferred">
327
+ <td><pre><a name="line93">93</a> </pre></td>
328
+ </tr>
329
+ <tr class="marked">
330
+ <td><pre><a name="line94">94</a> $current_log_file = nil # hold the current log file name</pre></td>
331
+ </tr>
332
+ <tr class="inferred">
333
+ <td><pre><a name="line95">95</a> </pre></td>
334
+ </tr>
335
+ <tr class="marked">
336
+ <td><pre><a name="line96">96</a> PageObject.default_element_wait = $obj_yml.get_value(&quot;environment/default_element_wait&quot;) # set default timeout for element wait</pre></td>
337
+ </tr>
338
+ <tr class="marked">
339
+ <td><pre><a name="line97">97</a> PageObject.default_page_wait = $obj_yml.get_value(&quot;environment/default_page_wait&quot;) # set default timeout for page wait</pre></td>
340
+ </tr>
341
+ <tr class="inferred">
342
+ <td><pre><a name="line98">98</a> </pre></td>
343
+ </tr>
344
+ <tr class="marked">
345
+ <td><pre><a name="line99">99</a> $browser = CUKES::BrowserSettings.browser_setup(BROWSER) # launches the browser</pre></td>
346
+ </tr>
347
+ <tr class="inferred">
348
+ <td><pre><a name="line100">100</a> </pre></td>
349
+ </tr>
350
+ <tr class="inferred">
351
+ <td><pre><a name="line101">101</a> # if you want to launch the URL only once (at the beginning), then you can use the below script</pre></td>
352
+ </tr>
353
+ <tr class="marked">
354
+ <td><pre><a name="line102">102</a> $browser.navigate.to(launch_url)</pre></td>
355
+ </tr>
356
+ <tr class="inferred">
357
+ <td><pre><a name="line103">103</a> </pre></td>
358
+ </tr>
359
+ <tr class="marked">
360
+ <td><pre><a name="line104">104</a> $scenario_count = 0 # holds scenario count for each feature file</pre></td>
361
+ </tr>
362
+ <tr class="inferred">
363
+ <td><pre><a name="line105">105</a> </pre></td>
364
+ </tr>
365
+ <tr class="inferred">
366
+ <td><pre><a name="line106">106</a> # Description : called before the execution of a scenario</pre></td>
367
+ </tr>
368
+ <tr class="inferred">
369
+ <td><pre><a name="line107">107</a> # Author : Chandra sekaran</pre></td>
370
+ </tr>
371
+ <tr class="inferred">
372
+ <td><pre><a name="line108">108</a> # Arguments :</pre></td>
373
+ </tr>
374
+ <tr class="inferred">
375
+ <td><pre><a name="line109">109</a> # scenario : scenario object</pre></td>
376
+ </tr>
377
+ <tr class="inferred">
378
+ <td><pre><a name="line110">110</a> #</pre></td>
379
+ </tr>
380
+ <tr class="marked">
381
+ <td><pre><a name="line111">111</a> Before do |scenario|</pre></td>
382
+ </tr>
383
+ <tr class="marked">
384
+ <td><pre><a name="line112">112</a> @step_count = nil # step counter used in AfterStep to get current step name</pre></td>
385
+ </tr>
386
+ <tr class="inferred">
387
+ <td><pre><a name="line113">113</a> </pre></td>
388
+ </tr>
389
+ <tr class="marked">
390
+ <td><pre><a name="line114">114</a> @scenario_start_time = $log.get_current_datetime # scenario execution start time</pre></td>
391
+ </tr>
392
+ <tr class="inferred">
393
+ <td><pre><a name="line115">115</a> </pre></td>
394
+ </tr>
395
+ <tr class="marked">
396
+ <td><pre><a name="line116">116</a> @browser = $browser # passes the browser object to the page class constructor (implicitly)</pre></td>
397
+ </tr>
398
+ <tr class="marked">
399
+ <td><pre><a name="line117">117</a> @browser.manage.timeouts.implicit_wait = 3 # set 3s implicit wait time</pre></td>
400
+ </tr>
401
+ <tr class="marked">
402
+ <td><pre><a name="line118">118</a> $browser_version = @browser.capabilities[:version] # current browser version</pre></td>
403
+ </tr>
404
+ <tr class="inferred">
405
+ <td><pre><a name="line119">119</a> </pre></td>
406
+ </tr>
407
+ <tr class="marked">
408
+ <td><pre><a name="line120">120</a> $world = self # for overriding puts method to print the argument into html file and in console as well </pre></td>
409
+ </tr>
410
+ <tr class="inferred">
411
+ <td><pre><a name="line121">121</a> </pre></td>
412
+ </tr>
413
+ <tr class="marked">
414
+ <td><pre><a name="line122">122</a> $str_feature_file_path = scenario.file # absolute path of current feature file</pre></td>
415
+ </tr>
416
+ <tr class="inferred">
417
+ <td><pre><a name="line123">123</a> </pre></td>
418
+ </tr>
419
+ <tr class="marked">
420
+ <td><pre><a name="line124">124</a> @str_feature_module_name = $log.get_feature_module_name($str_feature_file_path) # extracts module (and/or submodule) name from str_file_path</pre></td>
421
+ </tr>
422
+ <tr class="marked">
423
+ <td><pre><a name="line125">125</a> if $current_log_file.nil? || !($current_log_file.include? @str_feature_module_name)</pre></td>
424
+ </tr>
425
+ <tr class="marked">
426
+ <td><pre><a name="line126">126</a> $log = CUKES::CreateLog.new(@str_feature_module_name) # creates a new log file with the module ame</pre></td>
427
+ </tr>
428
+ <tr class="marked">
429
+ <td><pre><a name="line127">127</a> $current_log_file = $log.get_current_log_file</pre></td>
430
+ </tr>
431
+ <tr class="inferred">
432
+ <td><pre><a name="line128">128</a> end</pre></td>
433
+ </tr>
434
+ <tr class="inferred">
435
+ <td><pre><a name="line129">129</a> </pre></td>
436
+ </tr>
437
+ <tr class="marked">
438
+ <td><pre><a name="line130">130</a> $log.info(&quot;__________________________________________________________&quot;)</pre></td>
439
+ </tr>
440
+ <tr class="inferred">
441
+ <td><pre><a name="line131">131</a> </pre></td>
442
+ </tr>
443
+ <tr class="inferred">
444
+ <td><pre><a name="line132">132</a> # feature name</pre></td>
445
+ </tr>
446
+ <tr class="marked">
447
+ <td><pre><a name="line133">133</a> case scenario</pre></td>
448
+ </tr>
449
+ <tr class="inferred">
450
+ <td><pre><a name="line134">134</a> when Cucumber::Ast::Scenario</pre></td>
451
+ </tr>
452
+ <tr class="marked">
453
+ <td><pre><a name="line135">135</a> @feature_name = scenario.feature.name</pre></td>
454
+ </tr>
455
+ <tr class="inferred">
456
+ <td><pre><a name="line136">136</a> when Cucumber::Ast::OutlineTable::ExampleRow</pre></td>
457
+ </tr>
458
+ <tr class="uncovered">
459
+ <td><pre><a name="line137">137</a> @feature_name = scenario.scenario_outline.feature.name</pre></td>
460
+ </tr>
461
+ <tr class="inferred">
462
+ <td><pre><a name="line138">138</a> end</pre></td>
463
+ </tr>
464
+ <tr class="marked">
465
+ <td><pre><a name="line139">139</a> $log.info(&quot;Test Feature : &quot; + @feature_name)</pre></td>
466
+ </tr>
467
+ <tr class="inferred">
468
+ <td><pre><a name="line140">140</a> </pre></td>
469
+ </tr>
470
+ <tr class="inferred">
471
+ <td><pre><a name="line141">141</a> # check for a new feature and set $scenario_count accordingly</pre></td>
472
+ </tr>
473
+ <tr class="marked">
474
+ <td><pre><a name="line142">142</a> if $feature_name_old != @feature_name</pre></td>
475
+ </tr>
476
+ <tr class="marked">
477
+ <td><pre><a name="line143">143</a> $scenario_count = 0</pre></td>
478
+ </tr>
479
+ <tr class="marked">
480
+ <td><pre><a name="line144">144</a> $feature_name_old = @feature_name</pre></td>
481
+ </tr>
482
+ <tr class="inferred">
483
+ <td><pre><a name="line145">145</a> end</pre></td>
484
+ </tr>
485
+ <tr class="inferred">
486
+ <td><pre><a name="line146">146</a> </pre></td>
487
+ </tr>
488
+ <tr class="inferred">
489
+ <td><pre><a name="line147">147</a> # scenario name</pre></td>
490
+ </tr>
491
+ <tr class="marked">
492
+ <td><pre><a name="line148">148</a> case scenario</pre></td>
493
+ </tr>
494
+ <tr class="inferred">
495
+ <td><pre><a name="line149">149</a> when Cucumber::Ast::Scenario</pre></td>
496
+ </tr>
497
+ <tr class="marked">
498
+ <td><pre><a name="line150">150</a> @scenario_name = scenario.name</pre></td>
499
+ </tr>
500
+ <tr class="inferred">
501
+ <td><pre><a name="line151">151</a> when Cucumber::Ast::OutlineTable::ExampleRow</pre></td>
502
+ </tr>
503
+ <tr class="uncovered">
504
+ <td><pre><a name="line152">152</a> @scenario_name = scenario.scenario_outline.name</pre></td>
505
+ </tr>
506
+ <tr class="inferred">
507
+ <td><pre><a name="line153">153</a> end</pre></td>
508
+ </tr>
509
+ <tr class="marked">
510
+ <td><pre><a name="line154">154</a> $log.info(&quot;Test Scenario : &quot; + @scenario_name)</pre></td>
511
+ </tr>
512
+ <tr class="marked">
513
+ <td><pre><a name="line155">155</a> Kernel.puts(&quot;\n [#{Time.now.strftime(DATETIME_FORMAT)}] Currently running scenario : \n #{@scenario_name.to_s}&quot;) # for logging in console</pre></td>
514
+ </tr>
515
+ <tr class="inferred">
516
+ <td><pre><a name="line156">156</a> </pre></td>
517
+ </tr>
518
+ <tr class="inferred">
519
+ <td><pre><a name="line157">157</a> # tags name</pre></td>
520
+ </tr>
521
+ <tr class="marked">
522
+ <td><pre><a name="line158">158</a> $scenario_tags = scenario.source_tag_names</pre></td>
523
+ </tr>
524
+ <tr class="marked">
525
+ <td><pre><a name="line159">159</a> $log.info(&quot;Test tag(s) : &quot; + $scenario_tags.to_s)</pre></td>
526
+ </tr>
527
+ <tr class="marked">
528
+ <td><pre><a name="line160">160</a> Kernel.puts(&quot;\n \tWith tag(s) : #{$scenario_tags.to_s}&quot;) # for logging in console</pre></td>
529
+ </tr>
530
+ <tr class="inferred">
531
+ <td><pre><a name="line161">161</a> </pre></td>
532
+ </tr>
533
+ <tr class="inferred">
534
+ <td><pre><a name="line162">162</a> # get first step name of first scenario</pre></td>
535
+ </tr>
536
+ <tr class="marked">
537
+ <td><pre><a name="line163">163</a> @current_feature = if scenario.respond_to?(&#39;scenario_outline&#39;)</pre></td>
538
+ </tr>
539
+ <tr class="inferred">
540
+ <td><pre><a name="line164">164</a> # execute the following code only for scenarios outline (starting from the second example)</pre></td>
541
+ </tr>
542
+ <tr class="uncovered">
543
+ <td><pre><a name="line165">165</a> scenario.scenario_outline.feature</pre></td>
544
+ </tr>
545
+ <tr class="inferred">
546
+ <td><pre><a name="line166">166</a> else</pre></td>
547
+ </tr>
548
+ <tr class="inferred">
549
+ <td><pre><a name="line167">167</a> # execute the following code only for a scenario and a scenario outline (the first example only)</pre></td>
550
+ </tr>
551
+ <tr class="marked">
552
+ <td><pre><a name="line168">168</a> scenario.feature</pre></td>
553
+ </tr>
554
+ <tr class="inferred">
555
+ <td><pre><a name="line169">169</a> end</pre></td>
556
+ </tr>
557
+ <tr class="marked">
558
+ <td><pre><a name="line170">170</a> $log.info(&quot;__________________________________________________________&quot;)</pre></td>
559
+ </tr>
560
+ <tr class="marked">
561
+ <td><pre><a name="line171">171</a> @arr_steps = []</pre></td>
562
+ </tr>
563
+ <tr class="marked">
564
+ <td><pre><a name="line172">172</a> @arr_steps = get_steps(@current_feature) # get all steps under the current scenario</pre></td>
565
+ </tr>
566
+ <tr class="inferred">
567
+ <td><pre><a name="line173">173</a> end</pre></td>
568
+ </tr>
569
+ <tr class="inferred">
570
+ <td><pre><a name="line174">174</a> </pre></td>
571
+ </tr>
572
+ <tr class="inferred">
573
+ <td><pre><a name="line175">175</a> # Description : called after the execution of a step</pre></td>
574
+ </tr>
575
+ <tr class="inferred">
576
+ <td><pre><a name="line176">176</a> # Author : Chandra sekaran</pre></td>
577
+ </tr>
578
+ <tr class="inferred">
579
+ <td><pre><a name="line177">177</a> # Arguments :</pre></td>
580
+ </tr>
581
+ <tr class="inferred">
582
+ <td><pre><a name="line178">178</a> # scenario : scenario object</pre></td>
583
+ </tr>
584
+ <tr class="inferred">
585
+ <td><pre><a name="line179">179</a> #</pre></td>
586
+ </tr>
587
+ <tr class="marked">
588
+ <td><pre><a name="line180">180</a> AfterStep do |scenario|</pre></td>
589
+ </tr>
590
+ <tr class="marked">
591
+ <td><pre><a name="line181">181</a> sleep 1</pre></td>
592
+ </tr>
593
+ <tr class="marked">
594
+ <td><pre><a name="line182">182</a> @step_count = 0 if @step_count.nil? # @step_count ||= 0</pre></td>
595
+ </tr>
596
+ <tr class="inferred">
597
+ <td><pre><a name="line183">183</a> </pre></td>
598
+ </tr>
599
+ <tr class="marked">
600
+ <td><pre><a name="line184">184</a> begin</pre></td>
601
+ </tr>
602
+ <tr class="marked">
603
+ <td><pre><a name="line185">185</a> $log.info(&quot;Test Step (#{scenario.failed? ? &#39;failed&#39; : &#39;success&#39;}) : &quot; + @arr_steps[@step_count])</pre></td>
604
+ </tr>
605
+ <tr class="inferred">
606
+ <td><pre><a name="line186">186</a> rescue Exception =&gt; e</pre></td>
607
+ </tr>
608
+ <tr class="uncovered">
609
+ <td><pre><a name="line187">187</a> $log.error(&quot;Error in AfterStep hook for step_count (#{@step_count}): #{e}&quot;)</pre></td>
610
+ </tr>
611
+ <tr class="uncovered">
612
+ <td><pre><a name="line188">188</a> $log.info(&quot;Test Step (#{scenario.failed? ? &#39;failed&#39; : &#39;success&#39;}) : &quot; + @arr_steps[@step_count-1]) rescue Exception</pre></td>
613
+ </tr>
614
+ <tr class="inferred">
615
+ <td><pre><a name="line189">189</a> end</pre></td>
616
+ </tr>
617
+ <tr class="marked">
618
+ <td><pre><a name="line190">190</a> Kernel.puts(&quot;\n \t\t[#{Time.now.strftime(DATETIME_FORMAT)}] #{@arr_steps[@step_count].to_s}&quot;) rescue Exception # for logging in console</pre></td>
619
+ </tr>
620
+ <tr class="inferred">
621
+ <td><pre><a name="line191">191</a> </pre></td>
622
+ </tr>
623
+ <tr class="marked">
624
+ <td><pre><a name="line192">192</a> @step_count += 1 # increase step counter</pre></td>
625
+ </tr>
626
+ <tr class="inferred">
627
+ <td><pre><a name="line193">193</a> end</pre></td>
628
+ </tr>
629
+ <tr class="inferred">
630
+ <td><pre><a name="line194">194</a> </pre></td>
631
+ </tr>
632
+ <tr class="inferred">
633
+ <td><pre><a name="line195">195</a> # Description : called after support has been loaded but before features are loaded</pre></td>
634
+ </tr>
635
+ <tr class="inferred">
636
+ <td><pre><a name="line196">196</a> # Author : Chandra sekaran</pre></td>
637
+ </tr>
638
+ <tr class="inferred">
639
+ <td><pre><a name="line197">197</a> # Arguments :</pre></td>
640
+ </tr>
641
+ <tr class="inferred">
642
+ <td><pre><a name="line198">198</a> # config : config object</pre></td>
643
+ </tr>
644
+ <tr class="inferred">
645
+ <td><pre><a name="line199">199</a> #</pre></td>
646
+ </tr>
647
+ <tr class="marked">
648
+ <td><pre><a name="line200">200</a> AfterConfiguration do |config|</pre></td>
649
+ </tr>
650
+ <tr class="inferred">
651
+ <td><pre><a name="line201">201</a> </pre></td>
652
+ </tr>
653
+ <tr class="inferred">
654
+ <td><pre><a name="line202">202</a> end</pre></td>
655
+ </tr>
656
+ <tr class="inferred">
657
+ <td><pre><a name="line203">203</a> </pre></td>
658
+ </tr>
659
+ <tr class="inferred">
660
+ <td><pre><a name="line204">204</a> # Description : called after the execution of a scenario</pre></td>
661
+ </tr>
662
+ <tr class="inferred">
663
+ <td><pre><a name="line205">205</a> # Author : Chandra sekaran</pre></td>
664
+ </tr>
665
+ <tr class="inferred">
666
+ <td><pre><a name="line206">206</a> # Arguments :</pre></td>
667
+ </tr>
668
+ <tr class="inferred">
669
+ <td><pre><a name="line207">207</a> # scenario : scenario object</pre></td>
670
+ </tr>
671
+ <tr class="inferred">
672
+ <td><pre><a name="line208">208</a> #</pre></td>
673
+ </tr>
674
+ <tr class="marked">
675
+ <td><pre><a name="line209">209</a> After do |scenario|</pre></td>
676
+ </tr>
677
+ <tr class="marked">
678
+ <td><pre><a name="line210">210</a> @step_count = 0 if @step_count.nil?</pre></td>
679
+ </tr>
680
+ <tr class="marked">
681
+ <td><pre><a name="line211">211</a> @scenario_end_time = $log.get_current_datetime # scenario execution finish time</pre></td>
682
+ </tr>
683
+ <tr class="inferred">
684
+ <td><pre><a name="line212">212</a> </pre></td>
685
+ </tr>
686
+ <tr class="marked">
687
+ <td><pre><a name="line213">213</a> if scenario.failed?</pre></td>
688
+ </tr>
689
+ <tr class="uncovered">
690
+ <td><pre><a name="line214">214</a> begin</pre></td>
691
+ </tr>
692
+ <tr class="uncovered">
693
+ <td><pre><a name="line215">215</a> $log.info(&quot;Test Step (failed) : &quot; + @arr_steps[@step_count])</pre></td>
694
+ </tr>
695
+ <tr class="inferred">
696
+ <td><pre><a name="line216">216</a> rescue Exception =&gt; e</pre></td>
697
+ </tr>
698
+ <tr class="uncovered">
699
+ <td><pre><a name="line217">217</a> $log.error(&quot;Error in After hook for step_count (#{@step_count}): #{e}&quot;)</pre></td>
700
+ </tr>
701
+ <tr class="uncovered">
702
+ <td><pre><a name="line218">218</a> $log.info(&quot;Test Step (failed) : &quot; + @arr_steps[@step_count-1]) rescue Exception</pre></td>
703
+ </tr>
704
+ <tr class="inferred">
705
+ <td><pre><a name="line219">219</a> end</pre></td>
706
+ </tr>
707
+ <tr class="uncovered">
708
+ <td><pre><a name="line220">220</a> str_img_path = CUKES::BrowserSettings.capture_screenshot(@str_feature_module_name) # takes the screenshot of webpage</pre></td>
709
+ </tr>
710
+ <tr class="inferred">
711
+ <td><pre><a name="line221">221</a> </pre></td>
712
+ </tr>
713
+ <tr class="inferred">
714
+ <td><pre><a name="line222">222</a> # attaches a link to html page, on click of which shows the image in the web page</pre></td>
715
+ </tr>
716
+ <tr class="uncovered">
717
+ <td><pre><a name="line223">223</a> embed(str_img_path, &quot;image/png&quot;, &quot;Click to view screenshot&quot;) rescue Exception</pre></td>
718
+ </tr>
719
+ <tr class="inferred">
720
+ <td><pre><a name="line224">224</a> end</pre></td>
721
+ </tr>
722
+ <tr class="inferred">
723
+ <td><pre><a name="line225">225</a> </pre></td>
724
+ </tr>
725
+ <tr class="marked">
726
+ <td><pre><a name="line226">226</a> $scenario_count += 1 # increment scenario count by 1</pre></td>
727
+ </tr>
728
+ <tr class="inferred">
729
+ <td><pre><a name="line227">227</a> </pre></td>
730
+ </tr>
731
+ <tr class="marked">
732
+ <td><pre><a name="line228">228</a> $log.info(&quot;__________________________________________________________&quot;)</pre></td>
733
+ </tr>
734
+ <tr class="marked">
735
+ <td><pre><a name="line229">229</a> $log.info(&quot;Scenario start time : &quot; + $log.get_formatted_datetime(@scenario_start_time))</pre></td>
736
+ </tr>
737
+ <tr class="marked">
738
+ <td><pre><a name="line230">230</a> $log.info(&quot;Scenario end time : &quot; + $log.get_formatted_datetime(@scenario_end_time))</pre></td>
739
+ </tr>
740
+ <tr class="marked">
741
+ <td><pre><a name="line231">231</a> $log.info(&quot;Total elapsed time : &quot; + $log.get_datetime_diff(@scenario_start_time, @scenario_end_time))</pre></td>
742
+ </tr>
743
+ <tr class="marked">
744
+ <td><pre><a name="line232">232</a> $log.info(&quot;__________________________________________________________&quot;)</pre></td>
745
+ </tr>
746
+ <tr class="inferred">
747
+ <td><pre><a name="line233">233</a> end</pre></td>
748
+ </tr>
749
+ <tr class="inferred">
750
+ <td><pre><a name="line234">234</a> </pre></td>
751
+ </tr>
752
+ <tr class="inferred">
753
+ <td><pre><a name="line235">235</a> # Description : called after the execution of all features</pre></td>
754
+ </tr>
755
+ <tr class="inferred">
756
+ <td><pre><a name="line236">236</a> # Author : Chandra sekaran</pre></td>
757
+ </tr>
758
+ <tr class="inferred">
759
+ <td><pre><a name="line237">237</a> #</pre></td>
760
+ </tr>
761
+ <tr class="marked">
762
+ <td><pre><a name="line238">238</a> at_exit do</pre></td>
763
+ </tr>
764
+ <tr class="marked">
765
+ <td><pre><a name="line239">239</a> $obj_yml.set_value(&quot;application/#{BOX}/#{PROFILE}/in_use&quot;, &quot;no&quot;) # releases the current profile</pre></td>
766
+ </tr>
767
+ <tr class="inferred">
768
+ <td><pre><a name="line240">240</a> </pre></td>
769
+ </tr>
770
+ <tr class="marked">
771
+ <td><pre><a name="line241">241</a> $obj_yml.change_execution_count(&quot;environment/parallel_execution_count&quot;, $obj_yml.get_value(&quot;application/#{BOX}/#{PROFILE}/in_use&quot;))</pre></td>
772
+ </tr>
773
+ <tr class="inferred">
774
+ <td><pre><a name="line242">242</a> </pre></td>
775
+ </tr>
776
+ <tr class="marked">
777
+ <td><pre><a name="line243">243</a> $end_time = $log_env.get_current_datetime</pre></td>
778
+ </tr>
779
+ <tr class="inferred">
780
+ <td><pre><a name="line244">244</a> </pre></td>
781
+ </tr>
782
+ <tr class="inferred">
783
+ <td><pre><a name="line245">245</a> # logs into the base log file created with the name &#39;app_env.log&#39;</pre></td>
784
+ </tr>
785
+ <tr class="marked">
786
+ <td><pre><a name="line246">246</a> $log_env.info(&quot;__________________________________________________________&quot;)</pre></td>
787
+ </tr>
788
+ <tr class="marked">
789
+ <td><pre><a name="line247">247</a> $log_env.info(&quot;Execution start time : &quot; + $log_env.get_formatted_datetime($start_time))</pre></td>
790
+ </tr>
791
+ <tr class="marked">
792
+ <td><pre><a name="line248">248</a> $log_env.info(&quot;Execution end time : &quot; + $log_env.get_formatted_datetime($end_time))</pre></td>
793
+ </tr>
794
+ <tr class="marked">
795
+ <td><pre><a name="line249">249</a> $log_env.info(&quot;Total elapsed time : &quot; + $log_env.get_datetime_diff($start_time, $end_time).to_s)</pre></td>
796
+ </tr>
797
+ <tr class="marked">
798
+ <td><pre><a name="line250">250</a> $log_env.info(&quot;__________________________________________________________&quot;)</pre></td>
799
+ </tr>
800
+ <tr class="inferred">
801
+ <td><pre><a name="line251">251</a> </pre></td>
802
+ </tr>
803
+ <tr class="inferred">
804
+ <td><pre><a name="line252">252</a> # rename the html report file and move it to respective log report directory</pre></td>
805
+ </tr>
806
+ <tr class="marked">
807
+ <td><pre><a name="line253">253</a> $log_env.create_html_report</pre></td>
808
+ </tr>
809
+ <tr class="inferred">
810
+ <td><pre><a name="line254">254</a> </pre></td>
811
+ </tr>
812
+ <tr class="inferred">
813
+ <td><pre><a name="line255">255</a> # creates a new custom HTML report based on cucumber report(s) generated only after complete (single or parallel) execution</pre></td>
814
+ </tr>
815
+ <tr class="marked">
816
+ <td><pre><a name="line256">256</a> if $parallel_execution_count == 0</pre></td>
817
+ </tr>
818
+ <tr class="inferred">
819
+ <td><pre><a name="line257">257</a> # get the html report files of current execution</pre></td>
820
+ </tr>
821
+ <tr class="marked">
822
+ <td><pre><a name="line258">258</a> arr_report_file = $log_env.get_files_absolute_path(&quot;test_result&quot;, &quot;html&quot;, $start_time - $world.get_execution_delay_time.seconds)</pre></td>
823
+ </tr>
824
+ <tr class="marked">
825
+ <td><pre><a name="line259">259</a> $log.info(&quot;Report directory names (html): #{arr_report_file.to_s}&quot;)</pre></td>
826
+ </tr>
827
+ <tr class="inferred">
828
+ <td><pre><a name="line260">260</a> </pre></td>
829
+ </tr>
830
+ <tr class="marked">
831
+ <td><pre><a name="line261">261</a> obj = CUKES::CustomHtmlReport.new(arr_report_file)</pre></td>
832
+ </tr>
833
+ <tr class="marked">
834
+ <td><pre><a name="line262">262</a> obj.create_custom_report</pre></td>
835
+ </tr>
836
+ <tr class="inferred">
837
+ <td><pre><a name="line263">263</a> </pre></td>
838
+ </tr>
839
+ <tr class="marked">
840
+ <td><pre><a name="line264">264</a> if [&quot;yes&quot;, &quot;true&quot;].include?(PERFORMANCE_REPORT.to_s.downcase)</pre></td>
841
+ </tr>
842
+ <tr class="inferred">
843
+ <td><pre><a name="line265">265</a> # get the json report files of current execution</pre></td>
844
+ </tr>
845
+ <tr class="uncovered">
846
+ <td><pre><a name="line266">266</a> arr_report_file = $log_env.get_files_absolute_path(&quot;test_result&quot;, &quot;json&quot;, $start_time - $world.get_execution_delay_time.seconds)</pre></td>
847
+ </tr>
848
+ <tr class="uncovered">
849
+ <td><pre><a name="line267">267</a> $log.info(&quot;Report directory names (json): #{arr_report_file.to_s}&quot;)</pre></td>
850
+ </tr>
851
+ <tr class="inferred">
852
+ <td><pre><a name="line268">268</a> </pre></td>
853
+ </tr>
854
+ <tr class="uncovered">
855
+ <td><pre><a name="line269">269</a> obj = CUKES::PerformanceReport.new(arr_report_file)</pre></td>
856
+ </tr>
857
+ <tr class="uncovered">
858
+ <td><pre><a name="line270">270</a> obj.create_performance_report</pre></td>
859
+ </tr>
860
+ <tr class="inferred">
861
+ <td><pre><a name="line271">271</a> end</pre></td>
862
+ </tr>
863
+ <tr class="inferred">
864
+ <td><pre><a name="line272">272</a> end</pre></td>
865
+ </tr>
866
+ <tr class="marked">
867
+ <td><pre><a name="line273">273</a> CUKES::BrowserSettings.quit_browser # closes the current browser</pre></td>
868
+ </tr>
869
+ <tr class="inferred">
870
+ <td><pre><a name="line274">274</a> end</pre></td>
871
+ </tr>
872
+ </tbody>
873
+ </table>
874
+
875
+ <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>
876
+
877
+ </body>
878
+ </html>