kaya 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +26 -0
  3. data/CHANGELOG +52 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/NOTAS +19 -0
  7. data/README.md +279 -0
  8. data/Rakefile +1 -0
  9. data/bin/kaya +4 -0
  10. data/documentation/api.md +47 -0
  11. data/documentation/api_execution_data.md +47 -0
  12. data/documentation/configuration.md +13 -0
  13. data/documentation/custom_parameters.md +117 -0
  14. data/documentation/document_kaya.md +122 -0
  15. data/documentation/link.md +12 -0
  16. data/documentation/results.md +119 -0
  17. data/documentation/start.md +19 -0
  18. data/documentation/suites.md +60 -0
  19. data/documentation/test_suite_information.md +9 -0
  20. data/kaya.gemspec +42 -0
  21. data/lib/generators/task_rack.rb +160 -0
  22. data/lib/generators/templates/Gemfile.tt +2 -0
  23. data/lib/generators/templates/config.ru.tt +2 -0
  24. data/lib/generators/templates/kaya_conf.tt +49 -0
  25. data/lib/generators/templates/kaya_log.tt +0 -0
  26. data/lib/generators/templates/sidekiq_log.tt +0 -0
  27. data/lib/generators/templates/tasks.kaya.tt +10 -0
  28. data/lib/generators/templates/unicorn.rb.tt +21 -0
  29. data/lib/kaya/API/error.rb +17 -0
  30. data/lib/kaya/API/execution.rb +141 -0
  31. data/lib/kaya/API/result.rb +49 -0
  32. data/lib/kaya/API/results.rb +31 -0
  33. data/lib/kaya/API/suite.rb +42 -0
  34. data/lib/kaya/API/suites.rb +36 -0
  35. data/lib/kaya/background_jobs/sidekiq.rb +35 -0
  36. data/lib/kaya/background_jobs/workers/execution_checker.rb +20 -0
  37. data/lib/kaya/background_jobs/workers/garbage_cleaner.rb +31 -0
  38. data/lib/kaya/commands/bye.rb +12 -0
  39. data/lib/kaya/commands/help.rb +13 -0
  40. data/lib/kaya/commands/install.rb +27 -0
  41. data/lib/kaya/commands/reset.rb +39 -0
  42. data/lib/kaya/commands/reset_suites.rb +40 -0
  43. data/lib/kaya/commands/restart.rb +9 -0
  44. data/lib/kaya/commands/start.rb +104 -0
  45. data/lib/kaya/commands/stop.rb +53 -0
  46. data/lib/kaya/cuba.rb +287 -0
  47. data/lib/kaya/cucumber/features.rb +15 -0
  48. data/lib/kaya/cucumber/task.rb +64 -0
  49. data/lib/kaya/custom/execution_data.rb +50 -0
  50. data/lib/kaya/custom/params.rb +34 -0
  51. data/lib/kaya/database/mongo_connector.rb +285 -0
  52. data/lib/kaya/error/errors.rb +55 -0
  53. data/lib/kaya/execution.rb +57 -0
  54. data/lib/kaya/results/result.rb +493 -0
  55. data/lib/kaya/results/results.rb +47 -0
  56. data/lib/kaya/suites/custom/params.rb +151 -0
  57. data/lib/kaya/suites/suite.rb +177 -0
  58. data/lib/kaya/suites/suites.rb +130 -0
  59. data/lib/kaya/support/clean.rb +12 -0
  60. data/lib/kaya/support/configuration.rb +254 -0
  61. data/lib/kaya/support/console.rb +11 -0
  62. data/lib/kaya/support/documentation.rb +34 -0
  63. data/lib/kaya/support/error_handler_helper.rb +24 -0
  64. data/lib/kaya/support/files_cleanner.rb +136 -0
  65. data/lib/kaya/support/git.rb +161 -0
  66. data/lib/kaya/support/if_config.rb +14 -0
  67. data/lib/kaya/support/logo.rb +23 -0
  68. data/lib/kaya/support/logs.rb +37 -0
  69. data/lib/kaya/support/notification.rb +127 -0
  70. data/lib/kaya/support/processes.rb +96 -0
  71. data/lib/kaya/support/query_string.rb +22 -0
  72. data/lib/kaya/support/request.rb +32 -0
  73. data/lib/kaya/support/risk.rb +9 -0
  74. data/lib/kaya/support/time_helper.rb +11 -0
  75. data/lib/kaya/support/update.rb +65 -0
  76. data/lib/kaya/version.rb +3 -0
  77. data/lib/kaya/view/body.mote +60 -0
  78. data/lib/kaya/view/custom/params/select_list.mote +14 -0
  79. data/lib/kaya/view/custom/params/text.mote +9 -0
  80. data/lib/kaya/view/custom/params.mote +9 -0
  81. data/lib/kaya/view/error_handler.mote +40 -0
  82. data/lib/kaya/view/features/feature.mote +14 -0
  83. data/lib/kaya/view/features/features_list.mote +10 -0
  84. data/lib/kaya/view/features.mote +57 -0
  85. data/lib/kaya/view/footer.mote +10 -0
  86. data/lib/kaya/view/git_information.mote +21 -0
  87. data/lib/kaya/view/help/main.mote +21 -0
  88. data/lib/kaya/view/help/page.mote +2 -0
  89. data/lib/kaya/view/help/search_result.mote +29 -0
  90. data/lib/kaya/view/help.mote +72 -0
  91. data/lib/kaya/view/javascript.mote +96 -0
  92. data/lib/kaya/view/logs/log.mote +3 -0
  93. data/lib/kaya/view/modals.mote +31 -0
  94. data/lib/kaya/view/navigation_bar.mote +48 -0
  95. data/lib/kaya/view/not_found.mote +40 -0
  96. data/lib/kaya/view/parser.rb +79 -0
  97. data/lib/kaya/view/results/all.mote +59 -0
  98. data/lib/kaya/view/results/console.mote +106 -0
  99. data/lib/kaya/view/results/detailed_info.mote +112 -0
  100. data/lib/kaya/view/results/report.mote +1 -0
  101. data/lib/kaya/view/results/result.mote +23 -0
  102. data/lib/kaya/view/results/results.mote +52 -0
  103. data/lib/kaya/view/screenshot.mote +42 -0
  104. data/lib/kaya/view/sections.rb +25 -0
  105. data/lib/kaya/view/styles.mote +58 -0
  106. data/lib/kaya/view/suites/suite.mote +73 -0
  107. data/lib/kaya/view/suites/suites.mote +9 -0
  108. data/lib/kaya/view/view.rb +72 -0
  109. data/lib/kaya.rb +175 -0
  110. data/test/features/install.feature +18 -0
  111. data/test/features/support/env.rb +3 -0
  112. metadata +395 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 38856c4608568642c6b5e4885d96b96c7a209cbe
4
+ data.tar.gz: 219449b3fc96ffcb8801a5fd36de867dfd47e2ff
5
+ SHA512:
6
+ metadata.gz: 62291a41d43b9ac9e22d7af98645ced0edde730c62bdd896eb77fae7aa1a171ef57503edf2389732bbb7340f85e88dd35a76e6eaee50e4a522e8f602508505e4
7
+ data.tar.gz: 935100afcd4585e704a0293f20aa0215005abfc7ed57c86a3bfaae3e67c41520b15a7774745151df7ea64e250148a7f73e715d5faa9521afb0643b089933a74a
data/.gitignore ADDED
@@ -0,0 +1,26 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .idea/
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
19
+ kaya.sublime-project
20
+ kaya.sublime-workspace
21
+ *.kaya
22
+ kaya_conf
23
+ *.html
24
+ unicorn.rb
25
+ config.ru
26
+
data/CHANGELOG ADDED
@@ -0,0 +1,52 @@
1
+ CHANGELOG
2
+
3
+ Bueno, alguna vez había que hacerlo no?
4
+
5
+
6
+ # v 0.0.10
7
+ - Se agregó (y arregló) el uso de Sidekiq para los jobs en background en el chequeo constante de la ejecución para guardar la salida por consola en el resultado y finalizar el mismo como así también pasar al estado Ready a la suite asociada.
8
+
9
+ - Se agregó chequeo de existencia de Redis en el sistema en el comando Prepare para que no siga adelante si es que no está instalado. Redis se ha convertido en un requisito.
10
+
11
+ - Se agregó la actualización de la documentación de help en el comando Start para que si se actualiza la gema, esta actualice la base con la nueva info de Help automaticamente.
12
+
13
+ - Se agregó un chequeo del archivo de configuración para agregar los valores por defectos que puedan llegar a faltar en la actualización de Kaya.
14
+
15
+ - Cuando quedaba en estado finished no llevava a la ventana de log
16
+
17
+ - Arreglo en respuesta de error de API
18
+
19
+ - Extraccion de operaciones de sidekiq en un modulo aparte
20
+
21
+ - Configuración de base de datos separada, se agregó el puerto, y el tipo. La idea es en un futuro soportar distintos tipos de BBDD como Cassandra por ejemplo.
22
+
23
+ - No se usa mas selección de branch. Ahora cuando se usa el comando prepare se ofrece la posibilidad de seleccionar el branch sobre el cual trabajará kaya siempre.
24
+
25
+ - Se agregó el comando restart que llama a stop y luego a start
26
+
27
+ - Se agregó un worker GarbageCleaner que limpia los archivos que pueden quedar como basura
28
+
29
+ - Se eliminaron archivos deprecados
30
+
31
+ - Separación de los comandos en nuevo modulo Commands
32
+
33
+ - Se agregó logo en consola
34
+
35
+ - Acceso a los logs desde la app. No está explicito en la aplicación sino que se accede a través de la url con /kaya/logs donde se listan los logs disponibles y /kaya/logs/logfile_name que muestra su contenido
36
+
37
+ - Log de traza de kaya (kaya_log)
38
+
39
+ - Se reemplazo el comand prepare por install. Hace lo mismo, solo que ahora se llama install :)
40
+
41
+ - Dinamic custom parama (select list) Ahora un valor de una lista de selección permite que al ser seleccionado se muestre un campo adicional que solo funcionará con dicha selección
42
+
43
+ - Ahora desee una ejecucíón de test se puede utilizar la clase Kaya::Custom::Params para obtener los custom params facilmente sin tener que acceder a ENV y discriminar entre todso los valores que viajan en el.
44
+
45
+ - Arreglos visuales en la sección de resultados
46
+
47
+ - Se creó una clase Console para la ejecución de comandos de system
48
+
49
+ - Cuando se hace un pull ahrao se hace un reset --hard previamente
50
+
51
+ -
52
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in kaya.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Roman Rodriguez
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.
data/NOTAS ADDED
@@ -0,0 +1,19 @@
1
+ Prerequisites
2
+
3
+ To use Kaya you have to have installed on your system Redis and mongoDB
4
+
5
+ TO INSTALL LASTEST VERSION OF REDIS
6
+
7
+ $ sudo apt-get install -y python-software-properties
8
+ $ sudo add-apt-repository -y ppa:rwky/redis
9
+ $ sudo apt-get update
10
+ $ sudo apt-get install -y redis-server
11
+
12
+
13
+ source => http://tosbourn.com/install-latest-version-redis-ubuntu/
14
+
15
+ =====================================================================================
16
+
17
+ TO INSTALL MONGODB
18
+
19
+ follow instruction http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
data/README.md ADDED
@@ -0,0 +1,279 @@
1
+ Kaya
2
+ ==============
3
+
4
+
5
+ #### *This gem was created in order to expose tests easily so anybody is allowed to execute them.*
6
+
7
+
8
+
9
+ ONLY FOR UBUNTU (By Now)
10
+
11
+ Before installing Kaya you should have installed:
12
+
13
+ - MongoDb (version >= 2.6) See http://www.mongodb.org/downloads
14
+
15
+ $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
16
+ $ sudo apt-get update
17
+ $ sudo apt-get install mongodb-org
18
+ $ sudo service mongodb start
19
+
20
+ - Redis (http://tosbourn.com/install-latest-version-redis-ubuntu/)
21
+
22
+ $ sudo apt-get install -y python-software-properties
23
+ $ sudo add-apt-repository -y ppa:rwky/redis
24
+ $ sudo apt-get update
25
+ $ sudo apt-get install -y redis-server
26
+
27
+ - xvfb (if you want to run WebDriver in headless mode.)
28
+ $sudo apt-get intall xvfb
29
+
30
+
31
+
32
+ ## Kaya Installation
33
+
34
+ $ gem install kaya
35
+
36
+ ## Usage
37
+
38
+ Go to your project folder and run install command to use kaya over your project
39
+
40
+ $ kaya install
41
+
42
+ Then bundle it
43
+
44
+ $ bundle install
45
+
46
+ Configure a JSON file called kaya_conf with the values you need
47
+
48
+ /kaya_conf
49
+
50
+ Start Kaya and follow instructions
51
+
52
+ $ kaya start
53
+
54
+
55
+
56
+
57
+
58
+ How it works
59
+ ---------------------
60
+
61
+ When you run `kaya install` command, kaya will do:
62
+
63
+ - Update your Gemfile if it exist, else will create it. Also will define gem 'kaya' on it, of course.
64
+
65
+ - Creates a folder on your root project folder with some files on it. Those files are used by kaya to work.
66
+
67
+ The file called kaya_conf has some configuration that you can/must modify ( or see at least). You should only use kaya_conf and some logs files (kaya_log & sidekiq_log)
68
+
69
+ The file config.ru has the needed code to start the service (DO NOT MODIFY IT)
70
+
71
+ After configuring kaya_conf file you are able to run `kaya start`
72
+
73
+ After starting Kaya you can go to Help section and see all what you need to know to work with kaya regarding to set up test suites, custom parameters and so.
74
+
75
+ Enjoy it!
76
+
77
+ Take it easy!
78
+
79
+
80
+ Reference about configuration
81
+
82
+ kaya/kaya_conf file reference:
83
+
84
+ {
85
+
86
+ "USE_GIT" : true,
87
+
88
+ "HOSTNAME" : "your-host-name",
89
+
90
+ "APP_PORT" : 8080,
91
+
92
+ "DATABASE" : {
93
+
94
+ "TYPE" : "mongodb",
95
+ "HOST" :"localhost",
96
+ "PORT" : 27017,
97
+ "USERNAME" : null,
98
+ "PASSWORD" : null},
99
+
100
+ "PROJECT_NAME" : "Awesome Project",
101
+
102
+ "PROJECT_URL" : "http://your.project.url",
103
+
104
+ "INACTIVITY_TIMEOUT" : 60,
105
+
106
+ "KILL_INACTIVE_EXECUTIONS_AFTER" : 300,
107
+
108
+ "FORMAT_DATETIME" : "%d/%m/%Y %H:%M:%S",
109
+
110
+ "REFRESH_TIME" : 10,
111
+
112
+ "NOTIFICATION" : {
113
+ "USE_GMAIL" : false,
114
+ "USERNAME" : null,
115
+ "PASSWORD" : null,
116
+ "RECIPIENTS" : "your@email.com",
117
+ "ATTACH_REPORT" : false
118
+ },
119
+
120
+ "FOOTER" : "Tests by a great and funny team",
121
+
122
+ "AUTO_EXECUTION_ID" : {
123
+ "datetime" : true,
124
+ "format" : "%d%^b%y-%H%M",
125
+ "default" : null
126
+ },
127
+
128
+ "HEADLESS" : {
129
+ "active" : false,
130
+ "resolution" : "1024x768",
131
+ "size":"24"}
132
+ }
133
+
134
+
135
+
136
+
137
+
138
+ This file is where you can configure:
139
+
140
+ "USE_GIT": (Boolean) set as true if you are using git
141
+
142
+ "MONGO_HOST" : (String) The host where mongodb is running
143
+
144
+ "APP_PORT" : (Fixnum/Int) The http port that Kaya will be listening
145
+
146
+ "PROJECT_NAME" : (String) The name of your Cucumber project
147
+
148
+ "PROJECT_URL" : (String) The url of your project (basically the url of the repository)
149
+
150
+ "INACTIVITY_TIMEOUT" : (Fixnum/Int) The time in seconds to consider an execution as inactive. This will show you the option to reset an inactive execution
151
+
152
+ "KILL_INACTIVE_EXECUTIONS_AFTER" : (Fixnum/Int) The time in seconds to wait for killing automatically those inactive executions
153
+
154
+ "FORMAT_DATETIME" : "%d/%m/%Y %H:%M:%S"
155
+
156
+ "REFRESH_TIME" : (Fixnum/Int) The time in seconds to refresh result window in console view
157
+
158
+ "NOTIFICATION" : (Boolean) This is a flag to use notifications through gmail service. You should have a gmail account to use it.
159
+
160
+ "FOOTER" : (String) A text you want to see at the footer like "Tests by a great team (team_name@domain.com"
161
+
162
+ "AUTO_EXECUTION_ID" : (JSON) If you want to use a simple execution id given by the actual time you can set the value of "datetime" to true (Boolean), with this option you can use a strftime format and it will put the execution id automatically.
163
+ If you set "datetime" to false (Boolean) you can use "default" value. Setting "datetime" as false and "default" as null you will have to (if you need it) set the execution id manually each time you run a suite.
164
+
165
+ "HEADLESS" (JSON) : Set active as true to use headless mode
166
+
167
+
168
+
169
+
170
+
171
+
172
+ Available Commands
173
+ ---------------------
174
+
175
+ - To adapt your project to use kaya
176
+
177
+ $ kaya install
178
+
179
+ - To start kaya service
180
+
181
+ $ kaya start
182
+
183
+ - To clear all suites and results collection. To erase all data from database
184
+
185
+ $ kaya reset
186
+
187
+ - To clear all suites collection only. To erase all suites data from database
188
+
189
+ $ kaya reset_suites
190
+
191
+ - to shut down kaya
192
+
193
+ $ kaya stop
194
+
195
+ - to restart kaya
196
+
197
+ $ kaya restart
198
+
199
+
200
+
201
+
202
+ Get (what you need!)
203
+ ---------------------
204
+
205
+ - /kaya/suites
206
+
207
+ - /kaya/suites/`<suite_name>`/run
208
+
209
+ - /kaya/results
210
+
211
+ - /kaya/results/`<suite_name>`
212
+
213
+ - /kaya/results/`<result_id>`/log
214
+
215
+ - /kaya/results/`<result_id>`
216
+
217
+ - /kaya/help
218
+
219
+
220
+
221
+
222
+ Tip
223
+ ---------------------
224
+
225
+ If you shutdown kaya and then you want to get it up and the port you are using is already in use you could use the following commands (Ubunutu OS):
226
+
227
+ $sudo netstat -tapen | grep ":8080 "
228
+
229
+ In this example we use the port 8080. This command will give you the app that is using the port. Then you could kill it getting its PID previously.
230
+
231
+
232
+ API
233
+ =======
234
+
235
+ Returns the list of suites
236
+
237
+ kaya/api/suites
238
+
239
+ Returns the list of suites that are running
240
+
241
+ kaya/api/suites/running
242
+
243
+ Returns the status of the given suite id
244
+
245
+ kaya/api/suites/<suite_id>/status
246
+
247
+ Returns the suite structure for the given suite id
248
+
249
+ kaya/api/suites/<suite_id>
250
+
251
+ Returns all existing results
252
+
253
+ kaya/api/results
254
+
255
+ Returns the result for a given result id
256
+
257
+ kaya/api/results/<result_id>
258
+
259
+
260
+
261
+
262
+
263
+ Kaya
264
+ ---------------------
265
+
266
+ [listen](https://www.youtube.com/watch?v=Zgww4QtntnQ "Kaya")
267
+
268
+ [listen](https://www.youtube.com/watch?v=4t7ghwxuUVo "Kaya")
269
+
270
+
271
+
272
+ Contributing
273
+ ---------------------
274
+
275
+ 1. Fork it (http://github.com/`<my-github-username>`/kaya/fork)
276
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
277
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
278
+ 4. Push to the branch (`git push origin my-new-feature`)
279
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/kaya ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'kaya'
3
+
4
+ Kaya::Base.start(ARGV)
@@ -0,0 +1,47 @@
1
+ How do i use the api?
2
+ ==============
3
+
4
+
5
+ Well, we want to do things as simple as possible, so we are using only GET requests. Everyone has a browser, so everyone has the possiblility to use Kaya.
6
+
7
+ Returns the list of suites
8
+
9
+ kaya/api/suites
10
+
11
+ Returns the list of suites that are running
12
+
13
+ kaya/api/suites/running
14
+
15
+ Returns the status of the given suite id
16
+
17
+ kaya/api/suites/<suite_id>/status
18
+
19
+ Returns the suite structure for the given suite id
20
+
21
+ kaya/api/suites/<suite_id>
22
+
23
+ Returns all existing results
24
+
25
+ kaya/api/results
26
+
27
+ Returns the result for a given result id
28
+
29
+ kaya/api/results/<result_id>
30
+
31
+ Starts an execution
32
+
33
+ Perform get to:
34
+
35
+ kaya/api/suites/<suite_me>/run
36
+
37
+ # pass custom parameters as query string like vkaya/api/suites/:suite/run?environment=RC&foo=bar
38
+
39
+ # and if you want identify the execution, you can pass execution_name=your_execution_identification' as query string too.
40
+
41
+ If execution starts succesfully, it will return a result id
42
+
43
+
44
+ Returns the execution data for a given result id
45
+
46
+ kaya/api/results/<result_id>/data
47
+
@@ -0,0 +1,47 @@
1
+ api Execution Data
2
+ ============================
3
+
4
+
5
+ With Kaya you can add data to the execution. Then you can find that data through the API by using
6
+
7
+ /kaya/api/results/<result id>/data
8
+
9
+ This will give you the JSON (a part of the result) with the data you setted while your execution was running.
10
+
11
+ ---------------------------------------
12
+
13
+ How to add execution data
14
+ ============================
15
+
16
+ Basically you have to add kaya gem to your project
17
+
18
+ require 'kaya'
19
+
20
+ Before, you have to add it to your Gemfile
21
+
22
+ # Gemfile
23
+ gem 'kaya'
24
+
25
+
26
+ After adding the gem to your project, you can do:
27
+
28
+ Kaya::Custom::ExecutionData.add("my_data_key", "some value for data key")
29
+
30
+
31
+ Once the execution it is finished, you can see the values through:
32
+
33
+ http::/host:port/kaya/api/results/<result_id>/data
34
+
35
+ And you'll see something like:
36
+
37
+ {
38
+ type: "result",
39
+ _id: 1427901370053,
40
+ status: "stopped (Inactivity Timeout reached)",
41
+ execution_data: {
42
+ my_data_key: "some value for data key"
43
+ }
44
+ }
45
+
46
+
47
+ Think about this for integration tests.
@@ -0,0 +1,13 @@
1
+ How to configure Kaya?
2
+ ==============
3
+
4
+ Kaya retrieve information from profiles file called cucumber.yml allocated on project root folder.
5
+ You have to have this file into your project to work with Kaya.
6
+
7
+ Kaya will show only those suites marked as runnable as test suites. To do this you only have to add a flag to each cucumber profile you want to expose as follows:
8
+ Supose you have a profile called regression on cucumber.yml file
9
+
10
+ #cucumber.yml
11
+ regression: -t @regression runnable=true
12
+
13
+ The flag `runnable=true` indicates to Kaya to expose the profile to be executed as a test suite.
@@ -0,0 +1,117 @@
1
+ How to pass parameters to a test suite execution?
2
+ ==============
3
+
4
+ As Kaya retrieve information from suite's file called cucumber.yml allocated on projet root folder.
5
+
6
+ You can send parameters to a test suite execution and your tests can take that data to run in a certain way you need or want.
7
+
8
+ To ask for parameters into a test suite you have to set them up in cucumber.yml file.
9
+
10
+ There are basically two types of fields you can show in test suites (text field and select list).
11
+
12
+ This fields can be setted as required values and or with a default value.
13
+
14
+ All custom parameters must be defined on each test suite you need by using the custom parameter:
15
+
16
+ #cucumber.yml
17
+
18
+ regression: -t @regression runnable=true custom=[]
19
+
20
+ Text field
21
+ ---------------------
22
+
23
+ To show a text field as a custom parameter you just have to define the name of the param
24
+
25
+ regression: -t @regression runnable=true custom=[my_param]
26
+
27
+ <form>
28
+ <label class="col-sm-2 control-label" for="formGroupInputSmall">my_param</label><input type="text" name="my_param" value="" placeholder="" style="height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px;">
29
+ </form>
30
+
31
+ ---------------------------------------
32
+
33
+ If you want to define a default value just define the value like:
34
+
35
+ regression: -t @regression runnable=true custom=[my_param:a_value]
36
+
37
+ <form>
38
+ <label class="col-sm-2 control-label" for="formGroupInputSmall">my_param</label><input type="text" name="my_param" value="a_value" placeholder="" style="height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px;">
39
+ </form>
40
+
41
+ ---------------------------------------
42
+
43
+ You can define the parameter as a required value by using \*
44
+
45
+ regression: -t @regression runnable=true custom=[my_param:*]
46
+
47
+ <form>
48
+ <label class="col-sm-2 control-label" for="formGroupInputSmall">my_param</label><input type="text" name="my_param" value="" placeholder="" style="height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px;">*
49
+ </form>
50
+
51
+ ---------------------------------------
52
+
53
+ You can also define the parameter as required and with a default value by using:
54
+
55
+ regression: -t @regression runnable=true custom=[my_param:a_value:*]
56
+
57
+ <form>
58
+ <label class="col-sm-2 control-label" for="formGroupInputSmall">my_param</label><input type="text" name="my_param" value="a_value" placeholder="" style="height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px;">*
59
+ </form>
60
+
61
+ Select List
62
+ ---------------------
63
+
64
+ To provide a certain set of possible values that a test suite can use, you can provide a custom parameter as a select list
65
+ It is like a text field but just use () to provide the possible values separated by | (pipe char).
66
+
67
+ regression: -t @regression runnable=true custom=[environment:(RC|IC|BETA|PROD)]
68
+
69
+ <form>
70
+ <label class="col-sm-2 control-label" for="formGroupInputSmall">environment</label><select id="environment" name="environment" style="height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px;"> <option value="RC">RC</option> <option value="IC">IC</option> <option value="BETA">BETA</option> <option value="PROD">PROD</option> </select>
71
+ </form>
72
+
73
+ ---------------------------------------
74
+
75
+ The first value on the list will be used as a default value if user does not select any other value from the list
76
+ With this type of parameter you will ensure that the execution will expect a correct value to run. This is used to make a parameter required with a list of possible values
77
+ ---------------------------------------
78
+ But if you do not want to make a select list mandatory, you can use as a first value none to indicate the there is a null value. It is aimed to mimic that user does not select a value
79
+
80
+ regression: -t @regression runnable=true custom=[environment:(none|RC|IC|BETA|PROD)]
81
+
82
+ # none will be interpreted as an empty option, by using it at the first place on the list, you are setting this parameter as optional.
83
+
84
+ <form>
85
+ <label class="col-sm-2 control-label" for="formGroupInputSmall">environment</label><select id="environment" name="environment" style="height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px;"> <option value=""></option> <option value="RC">RC</option> <option value="IC">IC</option> <option value="BETA">BETA</option> <option value="PROD">PROD</option></select>
86
+ </form>
87
+
88
+ ---------------------------------------
89
+
90
+
91
+
92
+
93
+
94
+ How to get custom parameters
95
+ ==============
96
+
97
+ Once Kaya has got the custom parameters from cucumber.yml, you can get them whenever and wherever you want inside your code.
98
+ You'll can do it by creating an instance of Kaya::Custom::Params
99
+
100
+ For example
101
+ If you have defined a custom parameter like that: custom=[environment:(RC|PROD)]
102
+
103
+ So you will be able to get this parameter by the following way:
104
+
105
+ $CUSTOM = Kaya::Custom::Params.get
106
+
107
+ $CUSTOM.environment
108
+ # => will return the selected choice of environment param by the user.
109
+
110
+ If you want to get all custom params in a hash you can use:
111
+
112
+ $CUSTOM.all_params
113
+ # will return a hash with all params and values {}
114
+
115
+ $CUSTOM.raw
116
+ # Same as .all_params
117
+