auto_test 0.0.9.3.3 → 0.0.9.3.4
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.
- data/lib/auto_test/version.rb +1 -1
- data/lib/simulation.rb +3 -3
- data/lib/tasks/auto_test.rb +7 -7
- data/lib/test.rb +7 -4
- metadata +1 -1
data/lib/auto_test/version.rb
CHANGED
data/lib/simulation.rb
CHANGED
@@ -28,7 +28,7 @@ end
|
|
28
28
|
|
29
29
|
def init_user_inputs
|
30
30
|
@user_inputs = Hash.new
|
31
|
-
file = File.new("#{
|
31
|
+
file = File.new("#{gem_path}/../../log/user_input.log", "r")
|
32
32
|
while line = file.gets do
|
33
33
|
b = line.split(/:/,2)
|
34
34
|
@user_inputs["#{b[0].strip}"] = b[1].chop
|
@@ -83,7 +83,7 @@ def add_path(value)
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def search_sessions
|
86
|
-
path_to_search = File.new("#{
|
86
|
+
path_to_search = File.new("#{gem_path}/../../log/new_path.log")
|
87
87
|
sessions = Array.new
|
88
88
|
while line = path_to_search.gets do
|
89
89
|
line.gsub!(/[{}\"]/,'')
|
@@ -105,7 +105,7 @@ init_path
|
|
105
105
|
init_sessions_array
|
106
106
|
init_user_inputs
|
107
107
|
puts "Firefox is getting started..."
|
108
|
-
paths = File.new("#{
|
108
|
+
paths = File.new("#{gem_path}/../../log/new_path.log")
|
109
109
|
home = "localhost:3002"
|
110
110
|
sessions = search_sessions
|
111
111
|
number_of_sessions = sessions.size
|
data/lib/tasks/auto_test.rb
CHANGED
@@ -54,13 +54,13 @@ namespace :auto_test do
|
|
54
54
|
|
55
55
|
desc 'stopping rails'
|
56
56
|
task :stop do
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
57
|
+
begin
|
58
|
+
pid_file = 'tmp/pids/server.pid'
|
59
|
+
pid = File.read(pid_file).to_i
|
60
|
+
Process.kill 9, pid
|
61
|
+
File.delete pid_file
|
62
|
+
rescue
|
63
|
+
end
|
64
64
|
end
|
65
65
|
|
66
66
|
end
|
data/lib/test.rb
CHANGED
@@ -4,7 +4,10 @@ module AutoTest
|
|
4
4
|
module Test
|
5
5
|
module_function
|
6
6
|
|
7
|
-
|
7
|
+
def gem_path
|
8
|
+
path = %x(gem which auto_test)
|
9
|
+
path = path[0..path.size-13]
|
10
|
+
end
|
8
11
|
|
9
12
|
# initialize all variables
|
10
13
|
def initialize_test
|
@@ -298,7 +301,7 @@ module AutoTest
|
|
298
301
|
|
299
302
|
|
300
303
|
def write_user_input_to_file
|
301
|
-
f = File.new("#{
|
304
|
+
f = File.new("#{gem_path}/../../log/user_input.log", "w")
|
302
305
|
if Test.no_auth then
|
303
306
|
f.puts("get_number_of_test_runs:#{get_number_of_test_runs}
|
304
307
|
get_number_of_sessions:#{get_number_of_sessions}")
|
@@ -365,13 +368,13 @@ module AutoTest
|
|
365
368
|
end
|
366
369
|
Test.check_invariants
|
367
370
|
if !Test.stop? then Test.users_logged_in = Test.users_logged_in + 1 end
|
368
|
-
f = File.new("#{
|
371
|
+
f = File.new("#{gem_path}/../../log/paths.log", "w")
|
369
372
|
f.puts(Test.action_path)
|
370
373
|
f.close
|
371
374
|
puts
|
372
375
|
Error.print_errors
|
373
376
|
if Error.get_error > 0 then
|
374
|
-
f = File.new("#{
|
377
|
+
f = File.new("#{gem_path}/../../log/errors.log", "w")
|
375
378
|
f.puts(Error.get_error)
|
376
379
|
f.puts(Error.get_error_messages)
|
377
380
|
f.close
|