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,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: db6ddae9ea54195c4c6260b03be4c51060a78467
4
+ data.tar.gz: b1e83e6e9d7e4c213087e1c5a67d66a423f6e44f
5
+ SHA512:
6
+ metadata.gz: 9ec23fbd6531448bd92be3197e511b3cf335dfcaf497369be3e6f07111dd3ac7a4b96c1ef4dc525a791f3d6b730b38eac9c571c8ad5aa5e4dafe91ef64abbf11
7
+ data.tar.gz: 29e5270ecd67d4cdd371d5a6a0f8bd378c11b6fefd82c6ab611df29a1192930f8af997e1d503e9f88c6275bf91d8ad11c7a07be449c78d22e9653ffd2184e070
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
@@ -0,0 +1,235 @@
1
+ # Framework components detailed description
2
+
3
+ ## 1. config
4
+
5
+ #### a. config.yml
6
+
7
+ - holds the various users profiles and global environment values used in run
8
+ - the dynamic profiles include both test and development
9
+ - only the free profile (having in_use: ‘no’) will be used during run
10
+ - we can have multiple parallel execution with these profiles by specifying the profile (i.e., box) name and we can have any number of profiles under each node
11
+
12
+ Ex: as given in cucumber.yml
13
+
14
+ desktop_dev_chrome – will take any free profile under any developmentx node (where x is the node number)
15
+ desktop_devboxx_chrome – will take any free profile only under dev_boxx
16
+
17
+ - If you wish to run cukes in multiple parallel machines, then for each execution have different devboxX profiles and in each machine parallel execution can be made with the same profile
18
+
19
+ - the number of parallel threads = number of profiles, if you are running cukes in dev environment in 3 parallel threads, then there should be atleast 3 profiles under devboxX node
20
+
21
+ config.yml node descriptions :
22
+
23
+ environment: node holds the execution level data used throughout the cukes run
24
+ logger_level: DEBUG - custom logger level
25
+ default_page_wait: 60 - explicit page load wait time in seconds
26
+ default_element_wait: 60 - explicit element load wait time in seconds
27
+ datetime_pattern: '%d_%m_%Y-%H_%M_%S‘ - default datetime format
28
+ feature_id_prefix: '@rq_‘ - prefix for unique feature level tag name
29
+ scenario_id_prefix: '@tc_‘ - prefix for unique scenario level tag name
30
+ parallel_execution_count: 0 - used internally for parallel executions count
31
+ no_of_parallel_threads: 1 - no of parallel executions
32
+ delay_between_parallel_threads: 60 seconds - delay between each parallel execution
33
+ performance_report: 'no‘ - flag for including performance report
34
+ db_server: EHR2Aspire - DB server which holds DB where execution performance data are stored
35
+ db_name: PerformanceReport - DB that holds relations for storing performance data
36
+ db_user_name: dba - user name for DB access
37
+ db_password: sql - password for DB access
38
+
39
+ #### b. cucumber.yml
40
+
41
+ - holds the cucumber run profiles with custom settings
42
+ - The default: profile is for desktop (app) - test (node) – chrome (browser)
43
+ - The profiles denote the profile type (from config.yml), application type (desktop or mobile) and the browser (Chrome, IE or Firefox)
44
+ - You can n number profiles provided you have the equivalent boxes in config.yml
45
+ - Each profile includes node for custom reporting – the cucumber html report files uses the custom formatter (present in support/html_formatter.rb)
46
+
47
+ ## 2. features
48
+
49
+ ### a. desktop
50
+
51
+ - holds the desktop web feature files
52
+ - The feature files can be placed under any directory level under desktop
53
+ - Each feature should have an unique feature tag name starting with the prefix given in environment/ feature_id_prefix node in config.yml
54
+
55
+ Ex: @rq_desktop_search
56
+
57
+ - Each scenario should have an unique scenario tag name starting with the prefix given in environment/ scenario_id_prefix node in config.yml
58
+
59
+ Ex: @tc_01
60
+
61
+ - The custom report log file created by cukes will have the name with the relative path of the feature file directory that is executed
62
+
63
+ ### b. mobile
64
+
65
+ - holds the mobile web feature files
66
+ - The feature files can be placed under any directory level under mobile
67
+ - Rest of the things are the same for mobile as well
68
+
69
+ ## 3. library
70
+
71
+ ### a. app_init
72
+
73
+ #### app_driver.rb
74
+
75
+ - Requires the cukes support directory files for globalizing PageObjects under library
76
+
77
+ ### b. app_utils
78
+
79
+ #### data_file_names.rb
80
+
81
+ - contains constants with value of the test data (yml) file names and these constants can be used throughout the cukes without including or requiring
82
+
83
+ #### page_utils.rb
84
+
85
+ - contains generic methods that defines page objects related manipulations, which can be used for both desktop and mobile app automation
86
+
87
+ ### c. generic
88
+
89
+ #### app_logo_1.png
90
+
91
+ - logo of cukes, that will be added in custom html report files
92
+
93
+ #### create_log.rb
94
+
95
+ - contains custom logger class methods
96
+ - creates two or more log files – app_env.log holds the execution environment and run duration details and other log files are created with the name as relative path of the current running feature file directory and holds logging of the feature, scenarios and their steps with scenariosrun duration details
97
+
98
+ #### custom_html_report.rb
99
+
100
+ - contains custom html report class methods
101
+ - the custom report is extracted from the cucumber generated reports (html and json files). The custom html report will be placed in custom_report under current report directory under test_result directory
102
+ - The report also merges html reports generated during parallel executions. If there are 3 parallel executions, then 3 report directories will be created and the custom_report (holding the report for all 3 executions) will be present only in one of the report directory
103
+ - The report_home.html holds the execution summary, which includes the pass-fail count of features, scenarios and steps. On click on the feature link opens another html page that holds the pass-fail count of the scenarios and steps with cukes logs
104
+
105
+ #### datetime_library.rb
106
+
107
+ - contains generic module methods for date-time manipulation
108
+
109
+ #### file_library.rb
110
+
111
+ - contains generic module methods for file related manipulations
112
+
113
+ #### performance_report.rb
114
+
115
+ - contains generic class methods for creating data for performance report
116
+ - The execution duration details are extracted from the json report file and saved into Sybase database (with credentials from config.yml) as relations
117
+ - SqlAnywhere is used as DB, the server and database name are provided in config.yml
118
+ - the json report file holds the execution duration in nano seconds only at step level and hence the steps are iterated for scenario, feature and build level
119
+ - each build is marked unique and holds reference to its corresponding features, scenarios and steps, which includes the counts of pass, fail, skip and net result
120
+ - these data can be populated as a report for application performance analysis
121
+
122
+ #### read_from_yml.rb
123
+
124
+ - contains generic class methods for yml file manipulation
125
+ - the methods includes all kinds of yml data node traversal
126
+ - cukes uses yml file for test data storage
127
+
128
+ ## 4. object_repository
129
+
130
+ ### a. desktop
131
+
132
+ - all desktop web page-object class files are placed under object_repository directory
133
+ - all the library classes and modules are visible to page class files
134
+ - you can also have multiple repository files
135
+
136
+ ### b. mobile
137
+
138
+ - all mobile web page-object class files are placed under object_repository directory
139
+ - all the library classes and modules are visible to page class files
140
+ - you can also have multiple repository files
141
+
142
+ ## 5. page_objects
143
+
144
+ ### a. desktop
145
+
146
+ - holds generic page object class methods that defines the actual script action (with the objects from object_repository) on desktop web browser
147
+ - all library class methods and object_repository modules are visible to the page object classes defined here
148
+
149
+ ### b. desktop
150
+
151
+ - holds generic page object class methods that defines the actual script action (with the objects from object_repository) on mobile web browser
152
+ - all library class methods and object_repository modules are visible to page object classes defined here
153
+
154
+ ## 6. step_definitions
155
+
156
+ ### a. desktop
157
+
158
+ - holds the step definition files for the features under desktop directory
159
+ - the step definition files can be grouped under directories under desktop directory
160
+
161
+ ### b. mobile
162
+
163
+ - holds the step definition files for the features under mobile directory
164
+ - the step definition files can be grouped under directories under desktop directory
165
+
166
+ ## 7. support
167
+
168
+ #### browser_settings.rb
169
+
170
+ - contains generic module methods for browser related manipulations
171
+ - holds browser object profiles for desktop browsers like chrome, internet explorer and firefox and mobile browsers like chrome (Android) and safari (IOS)
172
+
173
+ #### env.rb
174
+
175
+ - holds require statements for including ruby library classes and modules and requires library and object_repository of cukes (for making cukes library files available to the entire framework)
176
+ - contains constants definitions holding cucumber run command line arguments (environment) values
177
+ - all global class and module declarations can be made here (using World)
178
+
179
+ #### hooks.rb
180
+
181
+ - holds the scenario hooks definitions that defines the feature/scenario/step pre and post actions
182
+ - all profile values used by cukes are defined as constants
183
+ - major stuffs like log file creation, browser/application launching, scenarios/steps pre and post action setup, custom and performance reports creation are done in this file
184
+
185
+ #### html_formatter.rb
186
+
187
+ - contains generic class methods for custom html report formatter
188
+ - holds method definitions for embedding image, text, link or a file
189
+
190
+ ## 8. test_result
191
+
192
+ for each execution an unique test report directory will be created with the name ‘test_report_<timestamp>’ under which by default the following exists
193
+
194
+ #### app_env.log
195
+
196
+ – holds the log for execution environment and duration details
197
+
198
+ #### feature based custom log file
199
+
200
+ – holds the log based on the currently running feature – there can n number of feature log files
201
+
202
+ #### report_timestamp.html
203
+
204
+ – cucumber generated html report file that holds the log for features, scenarios and steps
205
+
206
+ #### report_timestamp.json
207
+
208
+ – cucumber generated json report file that holds the log for features, scenarios and steps and the step level durations in nano seconds
209
+
210
+ #### custom_report
211
+
212
+ - custom_report – the directory holds custom html report files
213
+ - report_home.html – holds the summary report of the execution
214
+
215
+ ## 9. Gemfile
216
+
217
+ - holds the gem names with version used in cukes
218
+ - if you wish to add/remove/update any gem or its version, then those changes can be made in this file and run bundle install to install the gems in your machine
219
+ - for IDE (like RubyMine) no need to do bundle install, as it automatically does it when any change is made to this file
220
+ - When bundle install is successful a file named Gemfile.lock will be created which holds the gems and its dependencies (kindly avoid updating gemfile.lock, make changes only to Gemfile)
221
+
222
+ ## 10. Rakefile.rb
223
+
224
+ - all the rake tasks can be defined here
225
+ - instead of typing a lengthy cucumber run command, it can be given as a rake task and can be invoked by rake <task_name>
226
+ - the pre and post conditions can also be set here
227
+
228
+ ## 11. Code coverage
229
+
230
+ - Cukes uses simplecov for code coverage
231
+ - if you want to include code coverage into cukes, then add CODE_COVERAGE=yes or true in cucumber run command
232
+ - like, cucumber –p desktop_dev_chrome -t @tc_01 APP=GOOGLE CODE_COVERAGE=yes
233
+ - it will create a directory coverage under cukes under which rcov/index.html report file holds the code coverage metric details, which covers all the files under cukes
234
+ - it also creates json report files in the name .last_run.json – holds total coverage percent and resultset.json – holds individual files code coverage percent
235
+ - the json report file will be used in code coverage integration with Jenkins
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "bundler"
4
+ gem "cucumber", "1.3.15"
5
+ gem "page-object", "1.0.2"
6
+ gem "watir-webdriver", "0.6.10"
7
+ gem "selenium-webdriver", ">= 2.43.0"
8
+ gem "time_difference", "0.3.2"
9
+ gem "data_magic", "0.19"
10
+ gem "require_all", "1.3.2"
11
+ gem "nokogiri", "1.6.3.1"
12
+ gem "simplecov", "0.9.2"
13
+ gem "dbi", "0.4.5"
14
+ gem "dbd-sqlanywhere", "1.0.1"
15
+ gem "appium_lib", "4.1.0"
16
+ gem "rspec", "3.0.0"
17
+ gem "rake", ">= 0.9.6"
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 TODO: Write your name
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,108 @@
1
+ # Friendly-Cukes
2
+ friendly-cukes is user friendly cucumber test automation framework created by tester for tester.
3
+ It is a ruby-cucumber based generic automation framework for desktop and mobile web automation. It is built using Cucumber (1.3.15), page-object (1.0.2) and appium_lib (4.1.0). All you need is to install the gem and that's it, you have set with cucumber automation.
4
+
5
+ #### Gem requirements
6
+ The gem requires [Ruby (2.0.0)](https://www.ruby-lang.org/en/downloads/), [ChromeDriver.exe (v2.10.267521)](http://chromedriver.storage.googleapis.com/index.html), [IEDriverServer.exe (2.45.0.0)](http://selenium-release.storage.googleapis.com/index.html) and [Appium (1.3.4.1)](http://appium.io/downloads.html). As of now the framework is designed to work with the proposed software setup and tested only on Windows machine.
7
+
8
+ 1. Install friendly-cukes gem
9
+
10
+ gem install friendly-cukes
11
+
12
+ 2. Install generic cucumber framework
13
+
14
+ friendly-cukes --new test_app_name
15
+ where `test_app_name` is the test application name
16
+ This will install the generic cukes framework under `test_app_name` directory (type `friendly-cukes` for more options)
17
+
18
+ 3. Then type `cd test_app_name` and start with the cucumber automation.
19
+ By default the framework has some feature files for demo purpose.
20
+ The cucumber run command for the default feature files is created as rake task, Type `rake -T` and it will list three tasks. Run any of the task, like `rake desktop_google_search` and it will start the cucumber execution
21
+
22
+ 4. The cucumber run command will look like
23
+
24
+ $cucumber -p profile_name --tags tag1[,tag2,...] APP=app_name
25
+
26
+ where
27
+ * `profile_name` - is the cucumber profile name present in `cucumber.yml`
28
+ * `tags` - is the tag name for feature/scenario to be executed
29
+ * `app_name` - key name of the application (as of now I have used two different app;Google and Rubygems for demo purpose)
30
+
31
+ Example:
32
+
33
+ $cucumber -p desktop_dev_ff -t @tc_02 APP=RUBYGEMS
34
+
35
+ the above command runs scenario tag `@tc_02` (from `gem_search.feature`) with `desktop_dev_ff profile` (from `cucumber.yml`)
36
+
37
+ 5. For releasing unused profiles add `RESET_CONFIG_VALUES=yes` or `true` in the cucumber run command and it will release all the no-longer used profiles
38
+
39
+ 6. For adding code coverage report, add `CODE_COVERAGE=yes` or `true` in cucumber run command and it will create a `coverage` directory holding the code-coverage report files
40
+
41
+ 7. For mobile automation, use the profile (in `cucumber.yml`) prefixed with `mobile_`
42
+
43
+ Example:
44
+
45
+ $cucumber -p mobile_dev_chrome_device -t @tc_02 APP=RUBYGEMS
46
+
47
+ the above command will execute scenario with tag `@tc_02` in chrome in the device attached to the machine, provided the android and appium settings are correct and the `appium server` is up and running
48
+
49
+ # TAF Features
50
+ ## Object Repository
51
+ 1. all web page-objects (web elements) are grouped into modules and are placed under `object_repository` directory
52
+
53
+ 2. the `page-object` repository modules can be encapsulated with any `PageObject` class files
54
+
55
+ 3. there can be multiple repository files
56
+
57
+ 4. the `page_objects` directory holds generic page object class methods that defines the actual script action (with the objects from `object_repository`) on web browser
58
+
59
+ ## Test data handling
60
+ YML files are used as test data files for faster data access and these files are stored under `test_data` directory under feature file directory. The test data handling is done at two levels
61
+
62
+ 1. local :
63
+ the scenario specific test data file should be placed under the respective feature file directory and with the file name suffixed with the scenario ID
64
+
65
+ 2. global :
66
+ the global test data files should be placed under test_data directory under the root feature (`desktop` or `mobile`) directory and if no local test data file is present, then it takes the global data file as default
67
+
68
+ ## Dynamic profile and Parallel execution
69
+
70
+ ### 1. Dynamic profiles
71
+ * the profile allocation for each execution ( on single or multiple machines) is done dynamically during the execution
72
+
73
+ * based on the profile tags given in `cucumber.yml`, the free profiles are auto-assigned to the currently running execution
74
+
75
+ * the profiles are configured in such a way that there can be `n` nodes and each node can have `m` profiles and hence the profile sample space is `n x m`
76
+
77
+ ### 2. Parallel execution
78
+ * the parallel execution parameters are given in `config.yml` based on which the merging of custom html report files will be done
79
+
80
+ * the profiles for each parallel execution is taken from `config.yml` dynamically
81
+
82
+ ## Custom Execution report
83
+
84
+ for each execution an unique test report directory will be created with the name `test_report_<timestamp>` under which by default the following exists
85
+
86
+ * `app_env.log` –> holds the log for execution environment and duration details
87
+
88
+ * `feature based custom log file` –> holds the log based on the currently running feature – there can `n` number of feature log files
89
+
90
+ * `report_<timestamp>.html` –> cucumber generated html report file that holds the log for features, scenarios and steps
91
+
92
+ * `report_<timestamp>.json` –> cucumber generated json report file that holds the log for features, scenarios and steps and the step level durations in nano seconds
93
+
94
+ * `custom_report` –> the directory holds merged custom html report files
95
+
96
+ * `report_home.html` –> holds the summary report of the execution
97
+
98
+ ## Performance Report
99
+
100
+ * the performance report component extracts the build details from cucumber generated json report files and stores in into `Syabse` database
101
+
102
+ * the complete execution data for each build will be stored in the DB, which can be interpreted and populated as a performance report
103
+
104
+ * the performance report can included or excluded based on the property value of performance_report in `config.yml`
105
+
106
+ * this component is also available as a standalone application bundled with the `friendly-cukes` gem, type `build-extractor` and follow the commands
107
+
108
+ * this will work only if `Syabse` database is configured in TAF and tables are created with TAF defined relationships
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env ruby
2
+ require 'optparse'
3
+ require 'open-uri'
4
+ require 'irb'
5
+ require 'uri'
6
+ require 'rubygems'
7
+ require 'friendly/cukes'
8
+ require 'friendly/build_extractor'
9
+
10
+ hash_args = {}
11
+
12
+ opts = OptionParser.new do |opts|
13
+ opts.banner = "Build-Extractor : a ruby-cucumber based exe that extracts cucumber execution data from json report files and stores them into Sybase DB"
14
+ opts.define_head "Usage : build-extractor <uri|path> [options]"
15
+ opts.separator ""
16
+ opts.separator "Examples :"
17
+ opts.separator " build-extractor http://www.ruby-lang.org/"
18
+ opts.separator ""
19
+ opts.separator "The DataBase tables have to be created before running the below command. Refer gem documentation for DB setup and schema"
20
+ opts.separator "Syntax : build-extractor --generate --file '<json files directory>' --url '<DB connection url>' --host '<primary-key of HostData table>'"
21
+ opts.separator ""
22
+ opts.separator "Options :"
23
+
24
+ opts.on_tail("-v", "--version", "Show version") do
25
+ puts Friendly::Cukes::VersionInfo.new.version
26
+ exit
27
+ end
28
+
29
+ opts.on_tail("-?", "--help", "Show this message") do
30
+ puts opts
31
+ exit
32
+ end
33
+
34
+ opts.on_tail("-f", "--file FILE", "Directory path of json file(s), used along with --generate") do |file|
35
+ hash_args[:file] = file
36
+ end
37
+
38
+ opts.on_tail("-u", "--url URL", "Connection url for DataBase, used along with --generate") do |url|
39
+ hash_args[:url] = url
40
+ end
41
+
42
+ opts.on_tail("-h", "--host HOST", "Primary-Key (HostDataID) of HostData table; machine where the build is run, used along with --generate") do |host|
43
+ hash_args[:host] = host
44
+ end
45
+
46
+ opts.on_tail("-g", "--generate", "Generates the build data and saves into Sybase DataBase") do
47
+ puts "Extracts build data from cucumber generated json report files and save these data into Sybase database"
48
+ puts "provided the database tables are already created with internal mappings."
49
+ puts "Refer gem documentation for database setup and tables schema"
50
+ end
51
+ end
52
+ opts.parse!
53
+
54
+ if !hash_args.empty?
55
+ err_msg = "Please provide all required command line options\nSyntax : build-extractor --generate --file '<json files directory path>' --url '<DB connection url>' --host '<primary-key of HostData table>'"
56
+ if !(hash_args.has_key?(:file)) || !(hash_args.has_key?(:url)) || !(hash_args.has_key?(:host))
57
+ raise err_msg
58
+ elsif (hash_args[:file].nil? || hash_args[:file].empty?) && (hash_args[:url].nil? || hash_args[:url].empty?) && (hash_args[:host].nil? || hash_args[:host].empty?)
59
+ raise err_msg
60
+ else
61
+ BuildExtractor.new(hash_args[:url], hash_args[:file], hash_args[:host]).save_build_data
62
+ end
63
+ else
64
+ uri = ARGV.shift
65
+ if uri.to_s.strip.empty? && $stdin.tty?
66
+ puts opts
67
+ exit 1
68
+ end
69
+ end