coba-testrunner 0.0.4 → 0.0.5
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/bin/coba +21 -1
- data/lib/coba-testrunner.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec92c9d4f0c5810ce0e37c55a4bfd69a1768385e
|
|
4
|
+
data.tar.gz: e6e1532fad6a7d4a3139ee0d654180da7bffcad9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 993b13e0968fe120778f45c9ef58a07bbb9e587643f2d198bd67bca712eaf0956898f499af44913873b571f0a4b1c4d8d476079b764bb862c533e17c6e44e605
|
|
7
|
+
data.tar.gz: 1d1f0310a19f23755676ba1a14f016bc826045d3df4aa1056d07b922e1dd417cbca1fc01b7625c7e0a966ed7b5f1cf8e6569acb03098afacffa474003292bdd6
|
data/bin/coba
CHANGED
|
@@ -75,10 +75,27 @@ class Coba < Thor
|
|
|
75
75
|
test = TestRunner.new(singleBrowserConfig)
|
|
76
76
|
|
|
77
77
|
# - init
|
|
78
|
+
statusTest = 0
|
|
79
|
+
memoryUsage = Array.new
|
|
78
80
|
test.init()
|
|
79
81
|
# driver init
|
|
80
|
-
|
|
81
82
|
# screenshot after init (if config set to true)
|
|
83
|
+
# RAM Calculation
|
|
84
|
+
# Create Thread, combine, and count average
|
|
85
|
+
t = Thread.new{
|
|
86
|
+
accumulator = 0
|
|
87
|
+
while statusTest != 1 do
|
|
88
|
+
output = `tasklist /FO CSV | grep #{singleBrowserConfig}.exe`
|
|
89
|
+
puts output
|
|
90
|
+
puts "========"
|
|
91
|
+
csvData = CSV.parse(output)
|
|
92
|
+
csvData.each do |data|
|
|
93
|
+
accumulator = accumulator + data.last.sub(",","").sub("K","").to_i
|
|
94
|
+
end
|
|
95
|
+
memoryUsage << accumulator
|
|
96
|
+
accumulator = 0
|
|
97
|
+
end
|
|
98
|
+
}
|
|
82
99
|
# - start
|
|
83
100
|
test.start(testCase)
|
|
84
101
|
# - before Hook (if available)
|
|
@@ -91,7 +108,10 @@ class Coba < Thor
|
|
|
91
108
|
# Log Time
|
|
92
109
|
# screenshot before and after test (if config set to true)
|
|
93
110
|
# - stop
|
|
111
|
+
statusTest = 1;
|
|
112
|
+
t.join
|
|
94
113
|
result = test.stop()
|
|
114
|
+
result['memory'] = memoryUsage
|
|
95
115
|
# driver quit
|
|
96
116
|
|
|
97
117
|
# compose result
|
data/lib/coba-testrunner.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require "selenium-webdriver"
|
|
2
2
|
require 'fileutils'
|
|
3
|
+
require "csv"
|
|
3
4
|
|
|
4
5
|
class TestRunner
|
|
5
6
|
def initialize(config)
|
|
@@ -26,7 +27,7 @@ class TestRunner
|
|
|
26
27
|
@driver = Selenium::WebDriver.for :chrome
|
|
27
28
|
when "chrome"
|
|
28
29
|
@driver = Selenium::WebDriver.for :chrome
|
|
29
|
-
when "
|
|
30
|
+
when "iexplore"
|
|
30
31
|
@driver = Selenium::WebDriver.for :ie
|
|
31
32
|
when "phantomjs"
|
|
32
33
|
@driver = Selenium::WebDriver.for :phantomjs
|
|
@@ -75,8 +76,8 @@ class TestRunner
|
|
|
75
76
|
@time[index]['time'] = finish - start
|
|
76
77
|
end
|
|
77
78
|
def loadUrl(url)
|
|
78
|
-
puts "- Load Url"
|
|
79
|
-
takeScreenshot(@screenshotPath,'loadUrl','start')
|
|
79
|
+
puts "- Load Url"
|
|
80
|
+
takeScreenshot(@screenshotPath,'loadUrl','start')
|
|
80
81
|
|
|
81
82
|
start = Time.new
|
|
82
83
|
|