uptime_monitor 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +5 -5
- data/TODO.md +10 -0
- data/VERSION +1 -1
- data/lib/uptime_monitor/uptime_monitor.rb +7 -3
- data/spec/uptime_monitor_spec.rb +6 -6
- data/uptime_monitor.gemspec +7 -6
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac52cdfd40d5e93ff2f32cd163a786699c2e8d8f
|
4
|
+
data.tar.gz: e5489ade6c72a1e2a87ece3da4db581c8a49267b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6e325144ef9cea5377966e04b99fc022f80b74df4a97ac832da304b55b5726bb37c3cb81731acb2eec43851c5e380c02690d7afdf300d161ffd142ab1061dff
|
7
|
+
data.tar.gz: 489af5a84dc5ae43aeff4a19442a7c452b660e29fe4374a14128344912825fb5c927b9f830779134020767914ffe80c57bd9a011f1a7cc4a4a7b19508ee7cebe
|
data/Gemfile
CHANGED
@@ -5,7 +5,7 @@ source "http://rubygems.org"
|
|
5
5
|
gem 'headless', "~> 1.0.2"
|
6
6
|
gem 'watir-webdriver', git: 'https://github.com/watir/watir-webdriver.git'
|
7
7
|
gem 'watir-webdriver-performance', "~> 0.2.4"
|
8
|
-
gem 'activesupport'
|
8
|
+
gem 'activesupport'
|
9
9
|
|
10
10
|
# Add dependencies to develop your gem here.
|
11
11
|
# Include everything needed to run rake, tests, features, etc.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -34,7 +34,7 @@ monitor = {
|
|
34
34
|
],
|
35
35
|
browser: ["firefox"]
|
36
36
|
}
|
37
|
-
ragios.
|
37
|
+
ragios.create(monitor)
|
38
38
|
```
|
39
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.
|
40
40
|
|
@@ -313,7 +313,7 @@ monitor = {
|
|
313
313
|
],
|
314
314
|
browser: ["firefox"]
|
315
315
|
}
|
316
|
-
ragios.
|
316
|
+
ragios.create(monitor)
|
317
317
|
```
|
318
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.
|
319
319
|
|
@@ -350,7 +350,7 @@ monitor = {
|
|
350
350
|
browser: ["phantomjs"]
|
351
351
|
}
|
352
352
|
|
353
|
-
ragios.
|
353
|
+
ragios.create(monitor)
|
354
354
|
```
|
355
355
|
|
356
356
|
|
@@ -376,7 +376,7 @@ monitor = {
|
|
376
376
|
exists?: login_process,
|
377
377
|
browser: ["firefox", headless: true]
|
378
378
|
}
|
379
|
-
ragios.
|
379
|
+
ragios.create(monitor)
|
380
380
|
```
|
381
381
|
|
382
382
|
####Testing the validations outside Ragios
|
@@ -469,7 +469,7 @@ monitor = {
|
|
469
469
|
],
|
470
470
|
browser: ["firefox", headless: true]
|
471
471
|
}
|
472
|
-
ragios.
|
472
|
+
ragios.create(monitor)
|
473
473
|
</pre>
|
474
474
|
|
475
475
|
|
data/TODO.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#TODO v0.1.1
|
2
|
+
- Change the test results into a single hash key with tuples for individual results
|
3
|
+
```ruby
|
4
|
+
{:results=>[[], [], [], [], [], []]}
|
5
|
+
```
|
6
|
+
individual tuple will look like this
|
7
|
+
```ruby
|
8
|
+
[ [{"link"=>{"href"=>"https://www.southmunn.com/aboutus"}}], "exists_as_expected" ]
|
9
|
+
```
|
10
|
+
This makes the test results accessible to be evaluated by code.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -7,6 +7,8 @@ module Ragios
|
|
7
7
|
|
8
8
|
def initialize
|
9
9
|
@test_result = ActiveSupport::OrderedHash.new
|
10
|
+
@result_set = []
|
11
|
+
@test_result = {results: @result_set }
|
10
12
|
end
|
11
13
|
|
12
14
|
def init(monitor)
|
@@ -20,15 +22,17 @@ module Ragios
|
|
20
22
|
end
|
21
23
|
|
22
24
|
def test_command?
|
25
|
+
@result_set = []
|
23
26
|
@success = true
|
24
27
|
browser_reader = Hercules::UptimeMonitor::BrowserReader.new(@monitor.browser)
|
25
28
|
start_browser(@monitor.url, browser_reader.browser_name, browser_reader.headless)
|
26
29
|
exists(@monitor.exists?)
|
30
|
+
@test_result = {results: @result_set }
|
27
31
|
close_browser
|
28
32
|
@success
|
29
33
|
rescue Net::ReadTimeout => e
|
30
34
|
close_browser rescue nil
|
31
|
-
@test_result = {"Page Load Timeout"
|
35
|
+
@test_result = {results: ["Page Load Timeout", "Page could not load after 2 minutes"]}
|
32
36
|
return true
|
33
37
|
rescue Exception => e
|
34
38
|
close_browser rescue nil
|
@@ -51,8 +55,8 @@ module Ragios
|
|
51
55
|
|
52
56
|
def result!(page_element, state)
|
53
57
|
@success = false if state == false
|
54
|
-
result = state ?
|
55
|
-
@
|
58
|
+
result = state ? [page_element, "exists_as_expected"] : [page_element, "does_not_exist_as_expected"]
|
59
|
+
@result_set << result
|
56
60
|
end
|
57
61
|
end
|
58
62
|
end
|
data/spec/uptime_monitor_spec.rb
CHANGED
@@ -6,12 +6,12 @@ describe Ragios::Plugin::UptimeMonitor do
|
|
6
6
|
end
|
7
7
|
it "sets the correct test result for success" do
|
8
8
|
@uptime_monitor.result!("page_element", state = true)
|
9
|
-
@uptime_monitor.test_result.should == {"page_element"
|
9
|
+
@uptime_monitor.test_result.should == {:results=>[["page_element", "exists_as_expected"]]}
|
10
10
|
@uptime_monitor.success.should == nil #since no test_command? was run
|
11
11
|
end
|
12
12
|
it "sets the correct test result for failure" do
|
13
13
|
@uptime_monitor.result!(:page_element, state = false)
|
14
|
-
@uptime_monitor.test_result.should == {:page_element
|
14
|
+
@uptime_monitor.test_result.should == {:results=>[[:page_element, "does_not_exist_as_expected"]]}
|
15
15
|
@uptime_monitor.success.should == false
|
16
16
|
end
|
17
17
|
it "sets test_result as failure if any validation fails" do
|
@@ -39,7 +39,7 @@ describe Ragios::Plugin::UptimeMonitor do
|
|
39
39
|
@uptime_monitor.start_browser("http://obi-akubue.org","firefox", headless = true)
|
40
40
|
page_element = [:title]
|
41
41
|
@uptime_monitor.exists([page_element])
|
42
|
-
@uptime_monitor.test_result.should == {
|
42
|
+
@uptime_monitor.test_result.should == {:results => [[page_element, "exists_as_expected"]]}
|
43
43
|
@uptime_monitor.success.should == nil #since no test_command? was run
|
44
44
|
@uptime_monitor.close_browser
|
45
45
|
end
|
@@ -49,7 +49,7 @@ describe Ragios::Plugin::UptimeMonitor do
|
|
49
49
|
@uptime_monitor.start_browser("http://obi-akubue.org","firefox", headless = true)
|
50
50
|
page_element = [:title, [text: "dont_exist"]]
|
51
51
|
@uptime_monitor.exists([page_element])
|
52
|
-
@uptime_monitor.test_result.should == {
|
52
|
+
@uptime_monitor.test_result.should == {:results => [[page_element, "does_not_exist_as_expected"]]}
|
53
53
|
@uptime_monitor.success.should == false
|
54
54
|
@uptime_monitor.close_browser
|
55
55
|
end
|
@@ -61,7 +61,7 @@ describe Ragios::Plugin::UptimeMonitor do
|
|
61
61
|
}
|
62
62
|
@uptime_monitor.init(monitor)
|
63
63
|
@uptime_monitor.test_command?.should == true
|
64
|
-
@uptime_monitor.test_result.should == {
|
64
|
+
@uptime_monitor.test_result.should == {:results => [[page_element, "exists_as_expected"]]}
|
65
65
|
end
|
66
66
|
it "runs a test that fails" do
|
67
67
|
page_element = [:title, [text: "dont_exist"]]
|
@@ -71,6 +71,6 @@ describe Ragios::Plugin::UptimeMonitor do
|
|
71
71
|
}
|
72
72
|
@uptime_monitor.init(monitor)
|
73
73
|
@uptime_monitor.test_command?.should == false
|
74
|
-
@uptime_monitor.test_result.should == {
|
74
|
+
@uptime_monitor.test_result.should == {:results => [[page_element, "does_not_exist_as_expected"]]}
|
75
75
|
end
|
76
76
|
end
|
data/uptime_monitor.gemspec
CHANGED
@@ -2,16 +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.1.
|
5
|
+
# stub: uptime_monitor 0.1.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "uptime_monitor"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["obi-a"]
|
14
|
-
s.date = "2015-03-
|
14
|
+
s.date = "2015-03-21"
|
15
15
|
s.description = "A Ragios plugin that uses a real web browser to monitor transactions on a website for availability"
|
16
16
|
s.email = "obioraakubue@yahoo.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
"LICENSE",
|
27
27
|
"README.md",
|
28
28
|
"Rakefile",
|
29
|
+
"TODO.md",
|
29
30
|
"VERSION",
|
30
31
|
"lib/uptime_monitor.rb",
|
31
32
|
"lib/uptime_monitor/browser.rb",
|
@@ -49,7 +50,7 @@ Gem::Specification.new do |s|
|
|
49
50
|
s.add_runtime_dependency(%q<headless>, ["~> 1.0.2"])
|
50
51
|
s.add_runtime_dependency(%q<watir-webdriver>, [">= 0"])
|
51
52
|
s.add_runtime_dependency(%q<watir-webdriver-performance>, ["~> 0.2.4"])
|
52
|
-
s.add_runtime_dependency(%q<activesupport>, ["
|
53
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
53
54
|
s.add_development_dependency(%q<rspec>, [">= 0"])
|
54
55
|
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
55
56
|
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
@@ -59,7 +60,7 @@ Gem::Specification.new do |s|
|
|
59
60
|
s.add_dependency(%q<headless>, ["~> 1.0.2"])
|
60
61
|
s.add_dependency(%q<watir-webdriver>, [">= 0"])
|
61
62
|
s.add_dependency(%q<watir-webdriver-performance>, ["~> 0.2.4"])
|
62
|
-
s.add_dependency(%q<activesupport>, ["
|
63
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
63
64
|
s.add_dependency(%q<rspec>, [">= 0"])
|
64
65
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
65
66
|
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
@@ -70,7 +71,7 @@ Gem::Specification.new do |s|
|
|
70
71
|
s.add_dependency(%q<headless>, ["~> 1.0.2"])
|
71
72
|
s.add_dependency(%q<watir-webdriver>, [">= 0"])
|
72
73
|
s.add_dependency(%q<watir-webdriver-performance>, ["~> 0.2.4"])
|
73
|
-
s.add_dependency(%q<activesupport>, ["
|
74
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
74
75
|
s.add_dependency(%q<rspec>, [">= 0"])
|
75
76
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
76
77
|
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uptime_monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- obi-a
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: headless
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: activesupport
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- LICENSE
|
153
153
|
- README.md
|
154
154
|
- Rakefile
|
155
|
+
- TODO.md
|
155
156
|
- VERSION
|
156
157
|
- lib/uptime_monitor.rb
|
157
158
|
- lib/uptime_monitor/browser.rb
|