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
@@ -0,0 +1,65 @@
1
+ module Kaya
2
+ module Support
3
+ class Update
4
+
5
+ @gem_folder = File.expand_path("../../../../", __FILE__) + "/lib/generators/templates/"
6
+ @project_folder = @main_folder = "#{Dir.pwd}/kaya/"
7
+
8
+ # Returns the most updated version of kaya_conf file, and updates the file if neded
9
+ def self.kaya_conf
10
+ update_json_file "kaya_conf"
11
+ end
12
+
13
+ # Returns the updated version of a json file, and writes it in the disk
14
+ #
15
+ # It updates a file located in kaya folder inside the project, with all new keys and sub-keys in of it's template file
16
+
17
+ # It also removes all keys not longer present in the template file.
18
+
19
+ def self.update_json_file name
20
+ file = JSON.parse(IO.read(@project_folder + name))
21
+ template = JSON.parse(IO.read(@gem_folder + name + ".tt"))
22
+
23
+ modified = false
24
+
25
+ deprecated_keys = file.keys - template.keys
26
+ if deprecated_keys.any?
27
+ deprecated_keys.each { |key| file.delete key }
28
+ modified = true
29
+ puts "The following keys: #{deprecated_keys} are deprecated and are going to be removed from your #{name} file.".colorize(:green)
30
+ end
31
+
32
+ if file.keys.sort != template.keys.sort
33
+ puts "The following keys: #{template.keys - file.keys} are new and are going to be added to your #{name} file.".colorize(:green)
34
+ modified = true
35
+ file.merge! template
36
+ end
37
+
38
+ file.keys.each do |key|
39
+ if file[key].class == Hash
40
+ deprecated_sub_keys = file[key].keys - template[key].keys
41
+ if deprecated_sub_keys.any?
42
+ deprecated_sub_keys.each{ |sub_key| file[key].delete sub_key }
43
+ modified = true
44
+ puts "The following sub keys: #{deprecated_sub_keys} from #{key} key are deprecated and are going to be removed from your #{name} file.".colorize(:green)
45
+ end
46
+ if file[key].keys.sort != template[key].keys.sort
47
+ puts "The following sub keys: #{template[key].keys - file[key].keys} from #{key} key are new and are going to be added to your #{name} file.".colorize(:green)
48
+ modified = true
49
+ file[key].merge! template[key]
50
+ end
51
+ end
52
+ end
53
+
54
+ if modified
55
+ File.write(@project_folder + name, JSON.pretty_generate(file))
56
+ puts "Done.".colorize(:green)
57
+ end
58
+
59
+ return file
60
+
61
+ end
62
+ end
63
+ end
64
+ end
65
+
@@ -0,0 +1,3 @@
1
+ module Kaya
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,60 @@
1
+
2
+
3
+ % message = query_string.msg ? " onload=\"javascript:my_alert('Attention!','#{query_string.msg}');\"" : nil
4
+
5
+ % title = h1 = section.split.map{|w| w.capitalize}.join " "
6
+
7
+
8
+ <!--partials -->
9
+
10
+ % javascript = Mote.parse(File.read("#{Kaya::View.path}/javascript.mote"), self, []).call()
11
+
12
+ % styles = Mote.parse(File.read("#{Kaya::View.path}/styles.mote"), self, []).call()
13
+
14
+ % modals = Mote.parse(File.read("#{Kaya::View.path}/modals.mote"), self, []).call()
15
+
16
+
17
+ % git_information = Mote.parse(File.read("#{Kaya::View.path}/git_information.mote"), self, [:section]).call(section:section)
18
+
19
+ % footer = Mote.parse(File.read("#{Kaya::View.path}/footer.mote"), self, []).call()
20
+
21
+ % template_file_path = File.read("#{Kaya::View.path}/#{Kaya::View::Sections.path_for(section)}.mote")
22
+
23
+ % content = Mote.parse(template_file_path, self, [:query_string, :suite_name, :log_name]).call(query_string:query_string, suite_name:suite_name, log_name:log_name)
24
+
25
+ % section = section.gsub(" ","_").downcase
26
+
27
+ % navigation_bar = Mote.parse(File.read("#{Kaya::View.path}/navigation_bar.mote"), self, [:section]).call(section:section)
28
+
29
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns ="http://www.w3.org/1999/xhtml"><head><meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>'
30
+ <head>
31
+ <title>{{Kaya::Support::Configuration.project_name}} through Kaya - {{title}}</title>
32
+
33
+ <meta content='text/html;charset=utf-8' http-equiv='Content-Type'/>
34
+ <meta name='viewport' content='width=device-width, initial-scale=1.0'>
35
+ <link rel='shortcut icon' href='/favicon'>
36
+ <link href='https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css' rel='stylesheet'>
37
+
38
+ {{javascript}}
39
+
40
+ {{styles}}
41
+
42
+ </head>
43
+ <body class='padding-top: 50px;' {{message}}>
44
+
45
+ {{modals}}
46
+
47
+ {{navigation_bar}}
48
+
49
+ <div class='container'>
50
+ <br>
51
+ {{git_information}}
52
+
53
+ <p>{{content}}</p>
54
+
55
+ {{footer}}
56
+
57
+ </div>
58
+ </div>
59
+ </body>
60
+ </html>
@@ -0,0 +1,14 @@
1
+ <div class='form-group-sm'>
2
+ <label class='col-sm-2 control-label' for='formGroupInputSmall'>{{param["name"]}}</label>
3
+ <select id='{{param["name"]}}' name='{{param["name"]}}' class='customParam' 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; font-weight:normal;'>
4
+ % param["options"].each do |value|
5
+ % value = nil if value.downcase == "none"
6
+ <option value='{{value}}'>{{value}}</option>
7
+ % end
8
+ </select>
9
+ % param["options"].each do |value|
10
+ % if param["plus_options"].keys.include? value
11
+ <input type='text' id='{{param["plus_options"][value]+$suites_counter.to_s}}' name='{{param["plus_options"][value]}}' value='Enter {{param["plus_options"][value]}}' onfocus='if (this.value=="Enter {{param["plus_options"][value]}}") this.value="";' placeholder='' style='display: none; 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;'>
12
+ % end
13
+ % end
14
+ </div>
@@ -0,0 +1,9 @@
1
+ <div class='form-group-sm'>
2
+ <label class='col-sm-2 control-label' for='formGroupInputSmall'>
3
+ {{param['name']}}
4
+ </label>
5
+ <textarea class='customParam' {{"required title='#{param['name']} is Required!'" if param["required"]}} type='text' name='{{param['name']}}' placeholder='{{"Enter value here" if param["required"]}}' 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; max-width: 70%; max-height: 500px; min-height: 34px; min-width: 212px; font-weight:normal;' />{{"#{param["options"]}"}}</textarea>
6
+ % if param["required"]
7
+ *
8
+ % end
9
+ </div>
@@ -0,0 +1,9 @@
1
+ <h4 title='This parameters will be passed to the test suite execution'>&nbsp;&nbsp;&nbsp;Custom Parameters</h4>
2
+ <div class='container' style='width: inherit'>
3
+ <li class='list-group-item' style='position:relative; with=100%'>
4
+ % custom_params.each do |custom_param|
5
+ % custom = Mote.parse(File.read("#{Kaya::View.path}/custom/params/#{custom_param["type"]}.mote"), self, [:param])
6
+ {{custom.call(param:custom_param)}}
7
+ % end
8
+ </li>
9
+ </div>
@@ -0,0 +1,40 @@
1
+ % javascript = Mote.parse(File.read("#{Kaya::View.path}/javascript.mote"), self, []).call()
2
+
3
+ % styles = Mote.parse(File.read("#{Kaya::View.path}/styles.mote"), self, []).call()
4
+
5
+ % navigation_bar = Mote.parse(File.read("#{Kaya::View.path}/navigation_bar.mote"), self, [:section]).call(section:"help")
6
+
7
+
8
+ % error_title , error_msg = Kaya::Support::ErrorHandlerHelper.evaluate exception
9
+
10
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
11
+ <html xmlns ="http://www.w3.org/1999/xhtml">
12
+
13
+ <head>
14
+ <title>{{Kaya::Support::Configuration.project_name}} through Kaya - Error</title>
15
+
16
+ <meta content='text/html;charset=utf-8' http-equiv='Content-Type'/>
17
+ <meta name='viewport' content='width=device-width, initial-scale=1.0'>
18
+ <link rel='shortcut icon' href='/favicon'>
19
+ <link href='https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css' rel='stylesheet'>
20
+
21
+ {{javascript}}
22
+
23
+ {{styles}}
24
+
25
+ </head>
26
+ <body class='padding-top: 50px;'>
27
+
28
+ {{navigation_bar}}
29
+
30
+ <div class='container'>
31
+ <br>
32
+ <div class='container'>
33
+ <div class='alert alert-danger' role='alert'>
34
+ <h1>{{error_title}}</h1>
35
+ <p>{{error_msg}}</p>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </body>
40
+ </html>
@@ -0,0 +1,14 @@
1
+ % feature_path.gsub!(" ","/")
2
+ % unless (feature_path.start_with? "features")
3
+ <h3>Could not find the requestes feature file</h3>
4
+ % else
5
+ % name = feature_path.split("/").last.split(".").first.capitalize.gsub("_"," ")
6
+ % content = IO.read("#{Dir.pwd}/#{feature_path}").gsub("\n\n\n","======#=====")
7
+ <div class="well">
8
+ % content.each_line do |line|
9
+ <div class="small">{{line.gsub("<","&lt").gsub(">","&gt").gsub('"',"&quot;").gsub("&lt","&lt<strong>").gsub("&gt","</strong>&gt").gsub(" ","&nbsp;").gsub("======#=====","<br><br>")}}</div>
10
+ % end
11
+ </pre>
12
+ % end
13
+
14
+ <!-- % content = IO.read("#{Dir.pwd}/#{feature_path}").each_line{|line| line.gsub("<","%LT&").gsub(">","%GT&").gsub("'","").gsub('"',"").gsub("\n","<br>")} -->
@@ -0,0 +1,10 @@
1
+ % features_files_list = Kaya::Cucumber::Features.feature_files_names
2
+ <table class='table table-hover'>
3
+ % features_files_list.each do |file_name|
4
+ <tr>
5
+ <td>
6
+ <a aria-hidden='true' href='/{{Kaya::Support::Configuration.hostname}}/kaya/features/file?path={{file_name.gsub("/"," ")}}'>{{file_name}}</a>
7
+ </td>
8
+ </tr>
9
+ % end
10
+ </table>
@@ -0,0 +1,57 @@
1
+ % title = h1 = section = "features"
2
+
3
+ <!--partials -->
4
+
5
+ % feature_path = query_string.path
6
+
7
+ % javascript = Mote.parse(File.read("#{Kaya::View.path}/javascript.mote"), self, []).call()
8
+
9
+ % styles = Mote.parse(File.read("#{Kaya::View.path}/styles.mote"), self, []).call()
10
+
11
+ % modals = Mote.parse(File.read("#{Kaya::View.path}/modals.mote"), self, []).call()
12
+
13
+ % git_information = Mote.parse(File.read("#{Kaya::View.path}/git_information.mote"), self, [:section]).call(section:section)
14
+
15
+ % footer = Mote.parse(File.read("#{Kaya::View.path}/footer.mote"), self, []).call()
16
+
17
+ % if feature_path
18
+ % content = Mote.parse(File.read("#{Kaya::View.path}/features/feature.mote"), self, [:feature_path]).call(feature_path:feature_path)
19
+ % else
20
+ % content = Mote.parse(File.read("#{Kaya::View.path}/features/features_list.mote"), self, []).call()
21
+ % end
22
+ % section = section.gsub(" ","_").downcase
23
+
24
+ % navigation_bar = Mote.parse(File.read("#{Kaya::View.path}/navigation_bar.mote"), self, [:section]).call(section:section)
25
+
26
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns ="http://www.w3.org/1999/xhtml"><head><meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>'
27
+ <head>
28
+ <title>{{Kaya::Support::Configuration.project_name}} through Kaya - {{title.capitalize}}</title>
29
+
30
+ <meta content='text/html;charset=utf-8' http-equiv='Content-Type'/>
31
+ <meta name='viewport' content='width=device-width, initial-scale=1.0'>
32
+ <link rel='shortcut icon' href='/favicon'>
33
+ <link href='https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css' rel='stylesheet'>
34
+
35
+ {{javascript}}
36
+
37
+ {{styles}}
38
+
39
+ </head>
40
+ <body class='padding-top: 50px;'>
41
+
42
+ {{modals}}
43
+
44
+ {{navigation_bar}}
45
+
46
+ <div class='container'>
47
+ <br>
48
+ {{git_information}}
49
+
50
+ <p>{{content}}</p>
51
+
52
+ {{footer}}
53
+
54
+ </div>
55
+ </div>
56
+ </body>
57
+ </html>
@@ -0,0 +1,10 @@
1
+ <footer>
2
+ <div style='width: 100%; display: table;'>
3
+ <div style='display: table-row'>
4
+ <div style='width: 600px; display: table-cell;'>{{Kaya::Support::Configuration.company}}</div>
5
+ <div align='right' style='display: table-cell;'>
6
+ <p>Kaya {{Kaya::VERSION}}</p>
7
+ </div>
8
+ </div>
9
+ </div>
10
+ </footer>
@@ -0,0 +1,21 @@
1
+ <div class='well'>
2
+ % if Kaya::Support::Configuration.use_git?
3
+ <h4>
4
+ Working on branch <strong>{{Kaya::Support::Git.branch}}</strong>
5
+ </h4>
6
+ <h4>
7
+ <small>
8
+ <span title='{{Kaya::Support::Git.log_last_commit}}'>Commit ID:{{Kaya::Support::Git.get_last_commit_id}}</span>
9
+ </small>
10
+ % end
11
+ % unless ["help","logs", "features"].include? section.downcase
12
+ <div class='btn-group pull-right' role='group'>
13
+ <button type='button' class='btn btn-default' aria-label='Left Align' title='Toggle collapse' onclick="auto_collapse()" title='collapse all panels'>
14
+ <div id='collapse_icon'>
15
+ <span class='glyphicon glyphicon-minus' aria-hidden='true' style='font-size:18px;'></span>
16
+ </div>
17
+ </button>
18
+ </div>
19
+ </h4>
20
+ % end
21
+ </div>
@@ -0,0 +1,21 @@
1
+ % documents = Kaya::Database::MongoConnector.get_all_documentation
2
+ Here you will find information about Kaya. What it is and how it works.
3
+ </div></div>
4
+ <div class='container-fluid'>
5
+ % if documents
6
+ <table class="table">
7
+ <tbody>
8
+ % documents.each do |document|
9
+ % next if document["title"]=="README"
10
+ <tr>
11
+ <th style="width:130px;"><h3>{{document["title"].capitalize.gsub("_"," ")}}<h3></th>
12
+ <th><h3><small>{{document["body"].split("=").first.delete("\n")}}</small></h3></th>
13
+ <th><small><a class='btn btn-info' href='/{{Kaya::Support::Configuration.hostname}}/kaya/help/{{document["title"]}}' role='button' style="text-align:middle;">Read more &raquo;</a></small></th>
14
+ </tr>
15
+ % end
16
+ </tbody>
17
+ </table>
18
+ % else
19
+ <h1>Could not find documentation</h1>
20
+ % end
21
+ </div>
@@ -0,0 +1,2 @@
1
+ % page_content = Kaya::Database::MongoConnector.help_body(page)
2
+ </div></div> <div style='font-weight:normal;'>{{GitHub::Markup.render("#{page}.md",page_content)}}<p>&nbsp;</p><p>&nbsp;</p></div>
@@ -0,0 +1,29 @@
1
+ % help_search_resut = Kaya::Database::MongoConnector.help_search(query).delete_if{|res| res["title"]=="README"}
2
+ </p><h3>Results for <b>"{{query}}"</b></h3></p>
3
+ <br>
4
+ <p style='display:none;'>strong fix</p>
5
+ % if help_search_resut.size.zero?
6
+ No result where found for "{{query}}\"</div></div>
7
+ % else
8
+ % help_search_resut.each do |result|
9
+ <div class='panel panel-primary'>
10
+ <div class='panel-heading'>
11
+ <a href='/{{Kaya::Support::Configuration.hostname}}/kaya/help/{{result["title"]}}' style='display: block;color: white !important;'>
12
+ <h3 class='panel-title'>
13
+ <span class='glyphicon glyphicon-file' aria-hidden='true'></span>
14
+ {{result["title"].to_s.gsub('_', ' ').capitalize}}
15
+ </h3>
16
+ </a>
17
+ </div>
18
+ <ul class='list-group'>
19
+ % result["body"].split(/\n/).each do |line|
20
+ % if (line.include? query)
21
+ <li class='list-group-item'>
22
+ <div style='font-weight:normal;'>... {{line.to_s.gsub("#{query}", "<span style='background-color: #FFFF00'>#{query}</span>")}} ...</div>
23
+ </li>
24
+ % end
25
+ % end
26
+ </ul>
27
+ </div>
28
+ % end
29
+ % end
@@ -0,0 +1,72 @@
1
+
2
+
3
+
4
+ % title = (page == "main")? page : Kaya::Database::MongoConnector.help_title(page)
5
+
6
+ % javascript = Mote.parse(File.read("#{Kaya::View.path}/javascript.mote"), self, []).call()
7
+
8
+ % styles = Mote.parse(File.read("#{Kaya::View.path}/styles.mote"), self, []).call()
9
+
10
+ % available_pages = Kaya::Database::MongoConnector.get_all_documentation.map{|doc| doc["title"].downcase}
11
+
12
+ % navigation_bar = Mote.parse(File.read("#{Kaya::View.path}/navigation_bar.mote"), self, [:section]).call(section:"help")
13
+
14
+ % query = query_string
15
+
16
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
17
+ <html xmlns ="http://www.w3.org/1999/xhtml">
18
+
19
+ <head>
20
+ <title>{{Kaya::Support::Configuration.project_name}} through Kaya - {{title}}</title>
21
+
22
+ <meta content='text/html;charset=utf-8' http-equiv='Content-Type'/>
23
+ <meta name='viewport' content='width=device-width, initial-scale=1.0'>
24
+ <link rel='shortcut icon' href='/favicon'>
25
+ <link href='https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css' rel='stylesheet'>
26
+
27
+ {{javascript}}
28
+
29
+ {{styles}}
30
+
31
+
32
+
33
+ </head>
34
+ <body class='padding-top: 50px;'>
35
+
36
+
37
+ {{navigation_bar}}
38
+
39
+ <div class='container'>
40
+ <br>
41
+
42
+ <div class='jumbotron'>
43
+ <div class='container'>
44
+ <h1>
45
+ <a href='/{{Kaya::Support::Configuration.hostname}}/kaya/help'>Help</a>
46
+ {{page.capitalize.gsub("_"," ")}}
47
+ <div class='col-sm-3 col-md-3 pull-right'>
48
+ <form class='navbar-form' role='search' action='/{{Kaya::Support::Configuration.hostname}}/kaya/help/main' method='get'>
49
+ <div class='input-group'>
50
+ <input type='text' class='form-control' placeholder='Search' name='s' value="{{query}}">
51
+ <div class='input-group-btn'>
52
+ <button class='btn btn-info' type='submit'><i class='glyphicon glyphicon-search'></i></button>
53
+ </div>
54
+ </div>
55
+ </form>
56
+ </div>
57
+ </h1>
58
+ <!-- inicio content-->
59
+ % if query and !query.empty?
60
+ {{Mote.parse(File.read("#{Kaya::View.path}/help/search_result.mote"), self, [:query]).call(query:query)}}
61
+ % else
62
+ % if available_pages.include? page
63
+ {{Mote.parse(File.read("#{Kaya::View.path}/help/page.mote"), self, [:page]).call(page:page)}}
64
+ % else
65
+ {{Mote.parse(File.read("#{Kaya::View.path}/help/main.mote"), self, []).call()}}
66
+ % end
67
+ % end
68
+ <!-- fin content -->
69
+ </div>
70
+ </div>
71
+ </body>
72
+ </html>
@@ -0,0 +1,96 @@
1
+ <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
2
+ <script src='https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js'></script>
3
+ <script type='text/javascript'>
4
+
5
+ function my_alert(title, text){
6
+ info(title,text);
7
+ url = 'http://' + window.location.host + window.location.pathname;
8
+ $('#myModal').modal('show');
9
+ }
10
+ function starter_link(formId){
11
+ var form = document.getElementById(formId);
12
+ var link = window.location.origin + '/{{Kaya::Support::Configuration.hostname}}/kaya/suites/' + formId + '/run?';
13
+ var elements = form.getElementsByClassName('customParam');
14
+ for(i=0; i < elements.length; i++){
15
+ if(elements[i].value.length > 0){
16
+ link += elements[i].getAttribute('name') + '=' + elements[i].value + '&';
17
+ }
18
+ }
19
+ info_for_link('Use to the following link to start execution, share it!', link.slice(0,link.length-1));
20
+ }
21
+ function info(title, text){
22
+ document.getElementById('myModalLabel').innerHTML= title;
23
+ document.getElementById('my-modal').innerHTML= text;
24
+ }
25
+ function featureInfo(title, text){
26
+ start_html = '<pre lang="ruby" style="height:400px; overflow:scroll; white-space:pre; word-wrap:normal;">';
27
+ end_html = '</pre>'
28
+ replaced_text = text.replace(/%LT&/g,'&lt;')
29
+ replaced_text = replaced_text.replace(/%GT&/g,'&gt;')
30
+ all_html = start_html + replaced_text + end_html;
31
+ document.getElementById('myLargeModalLabel').innerHTML= title;
32
+ document.getElementById('my-largeModal').innerHTML= all_html;
33
+ }
34
+ function go_clean(){
35
+ window.location.href = url;
36
+ }
37
+ function refresh_and_open(url){
38
+ window.open(url, '_blank', 'toolbar=no, scrollbars=yes, resizable=yes, top=300, left=300, width=800, height=600');
39
+ location.reload();
40
+ }
41
+ function selectLink(){
42
+ document.getElementById('link-text-area').focus();
43
+ document.getElementById('link-text-area').select();
44
+ }
45
+ function info_for_link(title, text){
46
+ document.getElementById('myModalLabel').innerHTML= title;
47
+ content = "<textarea id='link-text-area' rows='3' cols='63' style='resize: none; 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; font-weight:normal;' onfocus='selectLink()'>" + text + "</textarea><br>";
48
+ content += '<small>Click to select.<small>';
49
+ document.getElementById('my-modal').innerHTML= content;
50
+ }
51
+ function isInArray(value, array) {
52
+ return array.indexOf(value) > -1;
53
+ }
54
+ function addTextInput(selectId, plusFields, index){
55
+ for (var key in plusFields){
56
+ document.getElementById(plusFields[key] + index).style.display = 'none';
57
+ }
58
+ if(plusFields.hasOwnProperty(document.getElementById(selectId + index).options[document.getElementById(selectId + index).selectedIndex].value)) {
59
+ document.getElementById(plusFields[document.getElementById(selectId + index).options[document.getElementById(selectId + index).selectedIndex].value] + index).style.display = 'block';
60
+ }
61
+ }
62
+
63
+ function get_and_close(url){
64
+ xmlHttp = new XMLHttpRequest();
65
+ xmlHttp.open( 'GET', url, false );
66
+ xmlHttp.send();
67
+ window.close();
68
+ }
69
+
70
+ function go_to_bottom(){
71
+ window.scrollTo(0,document.body.scrollHeight);
72
+ }
73
+
74
+ function go_to_top(){
75
+ window.scrollTo(0,0);
76
+ }
77
+
78
+
79
+ var collapsed = false;
80
+ function auto_collapse(){
81
+ if(collapsed) {
82
+ collapsed = false;
83
+ document.getElementById('collapse_icon').innerHTML = "<span class='glyphicon glyphicon-minus' aria-hidden='true' style='font-size:18px;'></span>";
84
+ } else {
85
+ collapsed = true;
86
+ document.getElementById('collapse_icon').innerHTML = "<span class='glyphicon glyphicon-plus' aria-hidden='true' style='font-size:18px;'></span>";
87
+ }
88
+ $('.panel-body').collapse('toggle');
89
+ }
90
+
91
+
92
+ function PrintScreenshot(path){
93
+ var win = window.open(path , "win");
94
+ win.onload = win.print;
95
+ }
96
+ </script>
@@ -0,0 +1,3 @@
1
+ <h3>{{log_name.gsub("_"," ").capitalize}}</h3>
2
+ % content = Kaya::Support::Logs.read_log_file_content_for log_name
3
+ <pre style="height:400px; overflow:scroll; white-space:pre; word-wrap:normal;">{{content}}</pre>
@@ -0,0 +1,31 @@
1
+ <div id='myModal' class='modal fade' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
2
+ <div class='modal-dialog'>
3
+ <div class='modal-content'>
4
+ <div class='modal-header'>
5
+ <h3 class='modal-title' id='myModalLabel'></h3>
6
+ </div>
7
+ <div class='modal-body'>
8
+ <h4 id='my-modal' style='overflow: hidden'></h4>
9
+ </div>
10
+ <div class='modal-footer'>
11
+ <button type='button' class='btn btn-default' data-dismiss='modal' onclick='go_clean();'>Close</button>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ </div>
16
+
17
+ <div id='myLargeModal' class='modal fade bs-example-modal-lg' tabindex='-1' role='dialog' aria-labelledby='myLargeModalLabel' aria-hidden='true'>
18
+ <div class='modal-dialog modal-lg'>
19
+ <div class='modal-content'>
20
+ <div class='modal-header'>
21
+ <h4 class='modal-title' id='myLargeModalLabel'></h4>
22
+ </div>
23
+ <div class='modal-body'>
24
+ <h6 id='my-largeModal'></h6>
25
+ </div>
26
+ <div class='modal-footer'>
27
+ <button type='button' class='btn btn-default' data-dismiss='modal'>Close</button>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
@@ -0,0 +1,48 @@
1
+ <div class='navbar navbar-inverse navbar-fixed-top'>
2
+ <div class='container'>
3
+ <div class='navbar-header'>
4
+ <button type='button' class='navbar-toggle' data-toggle='collapse' data-target='.navbar-collapse'>
5
+ <span class='icon-bar'></span>
6
+ <span class='icon-bar'></span>
7
+ <span class='icon-bar'></span>
8
+ <span class='icon-bar'></span>
9
+ <span class='icon-bar'></span>
10
+ <span class='icon-bar'></span>
11
+ </button>
12
+ <a class='navbar-brand' href='#'>{{Kaya::Support::Configuration.project_name}}</a>
13
+ </div>
14
+ <div class='collapse navbar-collapse'>
15
+ <ul class='nav navbar-nav'>
16
+ <li class='{{'active' if section == "test_suites"}}'>
17
+ <a href='/{{Kaya::Support::Configuration.hostname}}/kaya/suites'>Test Suites</a>
18
+ </li>
19
+ <li class='{{'active' if section == "features"}}'>
20
+ <a href='/{{Kaya::Support::Configuration.hostname}}/kaya/features'>Features</a>
21
+ </li>
22
+ <li class='{{'active' if section == "results"}}'>
23
+ <a href='/{{Kaya::Support::Configuration.hostname}}/kaya/results'>Results</a>
24
+ </li>
25
+ <li class='{{'active' if section == "all_results"}}'>
26
+ <a href='/{{Kaya::Support::Configuration.hostname}}/kaya/results/all'>All Results</a>
27
+ </li>
28
+ <li class='{{'active' if section == "repo"}}'>
29
+ <a title='Open repository url' href='{{Kaya::Support::Configuration.project_url}}' target='_blank'>Repo</a>
30
+ </li>
31
+ <li class='{{'active' if section == "logs"}}'>
32
+ <a href='#' class='dropdown-toggle' data-toggle='dropdown' role= 'button' aria-expanded='false'>
33
+ Logs
34
+ </a>
35
+ <ul class='dropdown-menu' role='menu'>
36
+ % Kaya::Support::Logs.all.keys.each do |log|
37
+ <li><a href='/{{Kaya::Support::Configuration.hostname}}/kaya/logs/{{log}}'>{{log.split('_').first.capitalize}}</a></li>
38
+ % end
39
+ </ul>
40
+ </li>
41
+ <li class='{{section == "help" ? 'active' : ''}}'>
42
+ <a href='/{{Kaya::Support::Configuration.hostname}}/kaya/help'>Help</a>
43
+ </li>
44
+ </ul>
45
+ </div>
46
+ <!--/.nav-collapse -->
47
+ </div>
48
+ </div>