uptime_monitor 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1890b8ae1adad65edc5bae8778c946da11647254
4
+ data.tar.gz: ea908389252a20a7c8099ec623dcff0b60e2cdf0
5
+ SHA512:
6
+ metadata.gz: 550ef0a4e8c0cee17d72d2e17a25ae6871fe882c5c1b3ee0d9ed315ccac8003082548d2644bdb4d62666a92ed755fd239e6e081d76aff19227e829b36975559f
7
+ data.tar.gz: aff7185c607a9c9eee4adb3febadbb6f4bbf0addac9a3e6ed1d32c68adfe1b19b6623b951fb0ec9a7ce63bbb47037284f3ef8d899555333af6ca1290f8a54b05
data/README.md CHANGED
@@ -3,7 +3,7 @@ uptime_monitor (Hercules)
3
3
  [![Build Status](https://travis-ci.org/obi-a/uptime_monitor.png?branch=master)](https://travis-ci.org/obi-a/uptime_monitor)
4
4
  [![Gem Version](https://badge.fury.io/rb/uptime_monitor.svg)](http://badge.fury.io/rb/uptime_monitor)
5
5
 
6
- Uptime_monitor is a [ragios](https://github.com/obi-a/ragios) plugin that uses a real web browser to perform transactions on a website to ensure that features of the site are still working correctly. It can check elements of a webpage to ensure they still exist and it can also perform transactions like a website login to ensure that the process still works correctly.
6
+ Uptime_monitor is a [ragios](https://github.com/obi-a/ragios) plugin that uses a real web browser to perform transactions on a web application to ensure that features of the app are still working correctly. It can check elements of a webpage to ensure they still exist and it can also perform transactions like a website login to ensure that the process still works correctly.
7
7
 
8
8
  ##Requirements
9
9
  [Ragios](https://github.com/obi-a/ragios)
@@ -22,18 +22,19 @@ Restart ragios
22
22
  ##usage:
23
23
  A quick example, to monitor the title tag of a web page to ensure that it hasn't changed. Using [Ragios ruby client](http://www.whisperservers.com/ragios/ragios-saint-ruby/using-ragios)
24
24
  ````ruby
25
- monitor = {monitor: "My Blog title tag",
26
- url: "http://obi-akubue.org",
27
- every: "5m",
28
- contact: "admin@obiora.com",
29
- via: "gmail_notifier",
30
- plugin: "uptime_monitor",
31
- exists?: [
32
- [:title, [text: "Obi Akubue"]]
33
- ],
34
- browser: ["firefox"]
35
- }
36
- ragios.add [monitor]
25
+ monitor = {
26
+ monitor: "My Blog title tag",
27
+ url: "http://obi-akubue.org",
28
+ every: "5m",
29
+ contact: "admin@obiora.com",
30
+ via: "gmail_notifier",
31
+ plugin: "uptime_monitor",
32
+ exists?: [
33
+ [:title, [text: "Obi Akubue"]]
34
+ ],
35
+ browser: ["firefox"]
36
+ }
37
+ ragios.add(monitor)
37
38
  ```
38
39
  The above example will create a ragios monitor that will, every 5 minutes, use firefox to visit the website url http://obi-akubue.org, and verify that the title tag on the page matches the text "Obi Akubue". When the title tag doesn't match the text, a failure notification will be sent out to the contact.
39
40
 
@@ -231,7 +232,7 @@ exists?: [
231
232
  Text validations can be used on html elements that can contain text like title, div, span, h1, h2 etc.
232
233
 
233
234
  ####Actions
234
- Validations can also include actions. The actions are performed on the html element after it is validated. Example to set a text field's value
235
+ Validations can also include actions. The actions are performed on the html element after it is verfied that the element exists. Example to set a text field's value
235
236
  ```ruby
236
237
  exists?: [
237
238
  [{text_field: {id: "username"}}, [set: "admin"]]
@@ -294,49 +295,88 @@ A combination of multiple validations and actions form the basis for performing
294
295
  ####Performing Transactions
295
296
  Transactions are achieved by a combination of multiple validations and actions.
296
297
 
297
- To monitor the keyword search feature on my blog:
298
- ```ruby
299
- monitor = {monitor: "My Blog: keyword search",
300
- url: "http://obi-akubue.org",
301
- every: "1h",
302
- contact: "admin@obiora.com",
303
- via: "gmail_notifier",
304
- plugin: "uptime_monitor",
305
- exists?: [
306
- [:title,[text: "Obi Akubue"]],
307
- [{text_field: {id: "s"}}, [set: "ruby"]],
308
- [{button:{id: "searchsubmit"}}, [:click]],
309
- [:title, [includes_text: "ruby"], [includes_text: "Search Results"]],
310
- [{h2:{class: "pagetitle"}},[includes_text: "Search results for"]]
311
- ],
312
- browser: ["firefox"]
313
- }
314
- ragios.add [monitor]
298
+ Example, to monitor the keyword search feature on my blog, notice the validations in the exists? key's value:
299
+ ```ruby
300
+ monitor = {
301
+ monitor: "My Blog: keyword search",
302
+ url: "http://obi-akubue.org",
303
+ every: "1h",
304
+ contact: "admin@obiora.com",
305
+ via: "gmail_notifier",
306
+ plugin: "uptime_monitor",
307
+ exists?: [
308
+ [:title,[text: "Obi Akubue"]],
309
+ [{text_field: {id: "s"}}, [set: "ruby"]],
310
+ [{button:{id: "searchsubmit"}}, [:click]],
311
+ [:title, [includes_text: "ruby"], [includes_text: "Search Results"]],
312
+ [{h2:{class: "pagetitle"}},[includes_text: "Search results for"]]
313
+ ],
314
+ browser: ["firefox"]
315
+ }
316
+ ragios.add(monitor)
315
317
  ```
316
318
  In the above example the monitor will visit "http://obi-akubue.org" every hour, and perform a search for keyword 'ruby', then confirm that the search works by checking that the title tag and h2 tag of the search results page contains the expected text.
317
319
 
318
- Another example, to monitor the login process of the website southmunn.com
320
+ Another example, to search my friend's ecommerce site http://akross.net, for a citizen brand wristwatch, add one to cart, and go to the checkout page.
321
+
322
+ This transaction verifies the the following about the site:
323
+
324
+ 1. Product search is working
325
+
326
+ 2. Add to cart works
327
+
328
+ 3. Checkout page is reachable
329
+
330
+ 4. All three above works together as a sequence
331
+
332
+ ```ruby
333
+ monitor = {
334
+ monitor: "Akross.net: Add citizen watch to cart and checkout",
335
+ url: "http://akross.net",
336
+ every: "1h",
337
+ contact: "admin@obiora.com",
338
+ via: "ses",
339
+ plugin: "uptime_monitor",
340
+ exists?: [
341
+ [:title, [text: "All Watches Shop, Authentic Watches at Akross"]],
342
+ [{text_field: {name: "filter_name"}}, [set: "citizen"]],
343
+ [{div: {class: "button-search"}}, [:click]],
344
+ [:title,[text: "Search"]],
345
+ [link: {text: "Search"}],
346
+ [{button: {value: "Add to Cart"}}, [:click]],
347
+ [{link: {text: "Checkout"}}, [:click]],
348
+ [:title, [text: "Checkout"]]
349
+ ],
350
+ browser: ["phantomjs"]
351
+ }
352
+
353
+ ragios.add(monitor)
354
+ ```
355
+
356
+
357
+ Another example, to monitor the login process of the website http://southmunn.com
319
358
  ```ruby
320
359
  login_process = [
321
- [:title, [text: "Website Uptime Monitoring | SouthMunn.com"]],
322
- [{link: {text:"Login"}}, [:click]],
323
- [:title, [text: "Sign in - Website Uptime Monitoring | SouthMunn.com"]],
324
- [{text_field: {id: "username"}}, [set: "admin"]],
325
- [{text_field: {id: "password"}}, [set: "pass"]],
326
- [:button, [:click]],
327
- [:title, [text: "Dashboard - Website Uptime Monitoring | SouthMunn.com"]]
328
- ]
329
-
330
- monitor = {monitor: "My Website login processs",
331
- url: "https:/southmunn.com",
332
- every: "1h",
333
- contact: "admin@obiora.com",
334
- via: "email_notifier",
335
- plugin: "uptime_monitor",
336
- exists?: login_process,
337
- browser: ["firefox", headless: true]
338
- }
339
- ragios.add [monitor]
360
+ [:title, [text: "Website Uptime Monitoring | SouthMunn.com"]],
361
+ [{link: {text:"Login"}}, [:click]],
362
+ [:title, [text: "Sign in - Website Uptime Monitoring | SouthMunn.com"]],
363
+ [{text_field: {id: "username"}}, [set: "admin"]],
364
+ [{text_field: {id: "password"}}, [set: "pass"]],
365
+ [:button, [:click]],
366
+ [:title, [text: "Dashboard - Website Uptime Monitoring | SouthMunn.com"]]
367
+ ]
368
+
369
+ monitor = {
370
+ monitor: "My Website login processs",
371
+ url: "https:/southmunn.com",
372
+ every: "1h",
373
+ contact: "admin@obiora.com",
374
+ via: "email_notifier",
375
+ plugin: "uptime_monitor",
376
+ exists?: login_process,
377
+ browser: ["firefox", headless: true]
378
+ }
379
+ ragios.add(monitor)
340
380
  ```
341
381
 
342
382
  ####Testing the validations outside Ragios
@@ -344,14 +384,15 @@ Sometimes it's useful to run validations outside Ragios to verify that the valid
344
384
  ```ruby
345
385
  require 'uptime_monitor'
346
386
 
347
- monitor = {monitor: "About Us page",
348
- url: "https://www.southmunn.com/aboutus",
349
- browser: ["firefox", headless: false],
350
- exists?: [
351
- [{div: {class: "box_content"}}, [includes_text: "SouthMunn is a Website Uptime Monitoring SASS created and maintained by"]],
352
- [img: {src: "https://fc03.deviantart.net/fs14/f/2007/047/f/2/Street_Addiction_by_gizmodus.jpg"}],
353
- ],
354
- }
387
+ monitor = {
388
+ monitor: "About Us page",
389
+ url: "https://www.southmunn.com/aboutus",
390
+ browser: ["firefox", headless: false],
391
+ exists?: [
392
+ [{div: {class: "box_content"}}, [includes_text: "SouthMunn is a Website Uptime Monitoring SASS created and maintained by"]],
393
+ [img: {src: "https://fc03.deviantart.net/fs14/f/2007/047/f/2/Street_Addiction_by_gizmodus.jpg"}],
394
+ ],
395
+ }
355
396
 
356
397
  u = Ragios::Plugin::UptimeMonitor.new
357
398
  u.init(monitor)
@@ -406,28 +447,29 @@ The above example creates a browser object and visits the url. The exists? metho
406
447
 
407
448
  ##Specification:
408
449
  <pre lang="ruby">
409
- monitor = {monitor: "My Website",
410
- url: "http://mysite.com",
411
- every: "5m",
412
- contact: "admin@obiora.com",
413
- via: "mail_notifier",
414
- plugin: "uptime_monitor",
415
- exists?: [
416
- [:title, [text: "Welcome to my site"]],
417
- [{div: {id:"test", class: "test-section"}}, [text: "this is a test"]],
418
- [a: {href: "/aboutus" }],
419
- [:h1],
420
- [:h2,[text: "Login"]],
421
- [form: {action: "/signup", method: "get"}],
422
- [{element: {css: "#submit-button"}}, [:click]],
423
- [{text_field: {id: "username"}}, [set: "admin"]],
424
- [{text_field: {id: "password"}}, [set: "pass"]],
425
- [link: {text: "Contact Us"}],
426
- [wait_until_exists?: [div: {id:"open-section"}]]
427
- ],
428
- browser: ["firefox", headless: true]
429
- }
430
- ragios.add [monitor]
450
+ monitor = {
451
+ monitor: "My Website",
452
+ url: "http://mysite.com",
453
+ every: "5m",
454
+ contact: "admin@obiora.com",
455
+ via: "mail_notifier",
456
+ plugin: "uptime_monitor",
457
+ exists?: [
458
+ [:title, [text: "Welcome to my site"]],
459
+ [{div: {id:"test", class: "test-section"}}, [text: "this is a test"]],
460
+ [a: {href: "/aboutus" }],
461
+ [:h1],
462
+ [:h2,[text: "Login"]],
463
+ [form: {action: "/signup", method: "get"}],
464
+ [{element: {css: "#submit-button"}}, [:click]],
465
+ [{text_field: {id: "username"}}, [set: "admin"]],
466
+ [{text_field: {id: "password"}}, [set: "pass"]],
467
+ [link: {text: "Contact Us"}],
468
+ [wait_until_exists?: [div: {id:"open-section"}]]
469
+ ],
470
+ browser: ["firefox", headless: true]
471
+ }
472
+ ragios.add(monitor)
431
473
  </pre>
432
474
 
433
475
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
@@ -32,7 +32,7 @@ module Ragios
32
32
  end
33
33
 
34
34
  def close_browser
35
- @browser.close
35
+ @browser.close if @browser.respond_to?('close')
36
36
  end
37
37
 
38
38
  def start_browser(url, browser_name, headless)
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: uptime_monitor 0.0.7 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "uptime_monitor"
8
- s.version = "0.0.6"
9
+ s.version = "0.0.7"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["obi-a"]
12
- s.date = "2014-04-13"
14
+ s.date = "2014-08-30"
13
15
  s.description = "A Ragios plugin that uses a real web browser to monitor transactions on a website for availability"
14
16
  s.email = "obioraakubue@yahoo.com"
15
17
  s.extra_rdoc_files = [
@@ -37,12 +39,11 @@ Gem::Specification.new do |s|
37
39
  ]
38
40
  s.homepage = "http://github.com/obi-a/uptime_monitor"
39
41
  s.licenses = ["MIT"]
40
- s.require_paths = ["lib"]
41
- s.rubygems_version = "1.8.28"
42
+ s.rubygems_version = "2.2.2"
42
43
  s.summary = "Real browser website uptime monitoring plugin for Ragios"
43
44
 
44
45
  if s.respond_to? :specification_version then
45
- s.specification_version = 3
46
+ s.specification_version = 4
46
47
 
47
48
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
48
49
  s.add_runtime_dependency(%q<headless>, [">= 0"])
metadata CHANGED
@@ -1,169 +1,107 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: uptime_monitor
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.6
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.7
6
5
  platform: ruby
7
- authors:
6
+ authors:
8
7
  - obi-a
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-04-13 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
11
+
12
+ date: 2014-08-30 00:00:00 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ version_requirements: &id001 !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - &id002
18
+ - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: "0"
15
21
  name: headless
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
22
  type: :runtime
23
+ requirement: *id001
23
24
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
25
+ - !ruby/object:Gem::Dependency
26
+ version_requirements: &id003 !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - *id002
31
29
  name: watir-webdriver
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
30
  type: :runtime
31
+ requirement: *id003
39
32
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
33
+ - !ruby/object:Gem::Dependency
34
+ version_requirements: &id004 !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - *id002
47
37
  name: watir-webdriver-performance
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
38
  type: :runtime
39
+ requirement: *id004
55
40
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- - !ruby/object:Gem::Dependency
41
+ - !ruby/object:Gem::Dependency
42
+ version_requirements: &id005 !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - *id002
63
45
  name: activesupport
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
46
  type: :runtime
47
+ requirement: *id005
71
48
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- - !ruby/object:Gem::Dependency
49
+ - !ruby/object:Gem::Dependency
50
+ version_requirements: &id006 !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - *id002
79
53
  name: rspec
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ! '>='
84
- - !ruby/object:Gem::Version
85
- version: '0'
86
54
  type: :development
55
+ requirement: *id006
87
56
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
94
- - !ruby/object:Gem::Dependency
95
- name: rdoc
96
- requirement: !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
57
+ - !ruby/object:Gem::Dependency
58
+ version_requirements: &id007 !ruby/object:Gem::Requirement
59
+ requirements:
99
60
  - - ~>
100
- - !ruby/object:Gem::Version
101
- version: '3.12'
61
+ - !ruby/object:Gem::Version
62
+ version: "3.12"
63
+ name: rdoc
102
64
  type: :development
65
+ requirement: *id007
103
66
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
67
+ - !ruby/object:Gem::Dependency
68
+ version_requirements: &id008 !ruby/object:Gem::Requirement
69
+ requirements:
107
70
  - - ~>
108
- - !ruby/object:Gem::Version
109
- version: '3.12'
110
- - !ruby/object:Gem::Dependency
71
+ - !ruby/object:Gem::Version
72
+ version: "1.0"
111
73
  name: bundler
112
- requirement: !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
115
- - - ~>
116
- - !ruby/object:Gem::Version
117
- version: '1.0'
118
74
  type: :development
75
+ requirement: *id008
119
76
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ~>
124
- - !ruby/object:Gem::Version
125
- version: '1.0'
126
- - !ruby/object:Gem::Dependency
127
- name: jeweler
128
- requirement: !ruby/object:Gem::Requirement
129
- none: false
130
- requirements:
77
+ - !ruby/object:Gem::Dependency
78
+ version_requirements: &id009 !ruby/object:Gem::Requirement
79
+ requirements:
131
80
  - - ~>
132
- - !ruby/object:Gem::Version
81
+ - !ruby/object:Gem::Version
133
82
  version: 1.8.7
83
+ name: jeweler
134
84
  type: :development
85
+ requirement: *id009
135
86
  prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ~>
140
- - !ruby/object:Gem::Version
141
- version: 1.8.7
142
- - !ruby/object:Gem::Dependency
87
+ - !ruby/object:Gem::Dependency
88
+ version_requirements: &id010 !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - *id002
143
91
  name: pry
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ! '>='
148
- - !ruby/object:Gem::Version
149
- version: '0'
150
92
  type: :development
93
+ requirement: *id010
151
94
  prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ! '>='
156
- - !ruby/object:Gem::Version
157
- version: '0'
158
- description: A Ragios plugin that uses a real web browser to monitor transactions
159
- on a website for availability
95
+ description: A Ragios plugin that uses a real web browser to monitor transactions on a website for availability
160
96
  email: obioraakubue@yahoo.com
161
97
  executables: []
98
+
162
99
  extensions: []
163
- extra_rdoc_files:
100
+
101
+ extra_rdoc_files:
164
102
  - LICENSE
165
103
  - README.md
166
- files:
104
+ files:
167
105
  - .document
168
106
  - .travis.yml
169
107
  - Gemfile
@@ -182,31 +120,27 @@ files:
182
120
  - spec/uptime_monitor_spec.rb
183
121
  - uptime_monitor.gemspec
184
122
  homepage: http://github.com/obi-a/uptime_monitor
185
- licenses:
123
+ licenses:
186
124
  - MIT
125
+ metadata: {}
126
+
187
127
  post_install_message:
188
128
  rdoc_options: []
189
- require_paths:
129
+
130
+ require_paths:
190
131
  - lib
191
- required_ruby_version: !ruby/object:Gem::Requirement
192
- none: false
193
- requirements:
194
- - - ! '>='
195
- - !ruby/object:Gem::Version
196
- version: '0'
197
- segments:
198
- - 0
199
- hash: 4402610893578547372
200
- required_rubygems_version: !ruby/object:Gem::Requirement
201
- none: false
202
- requirements:
203
- - - ! '>='
204
- - !ruby/object:Gem::Version
205
- version: '0'
132
+ required_ruby_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - *id002
135
+ required_rubygems_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - *id002
206
138
  requirements: []
139
+
207
140
  rubyforge_project:
208
- rubygems_version: 1.8.28
141
+ rubygems_version: 2.2.2
209
142
  signing_key:
210
- specification_version: 3
143
+ specification_version: 4
211
144
  summary: Real browser website uptime monitoring plugin for Ragios
212
145
  test_files: []
146
+