auto_test 0.0.9.3.6 → 0.0.9.3.7
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 +2 -2
- data/lib/spec/requests/error_reduction_spec.rb +4 -8
- data/lib/tasks/auto_test.rb +2 -2
- data/lib/test.rb +4 -8
- 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("#{Rails.root}/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
|
@@ -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("#{Rails.root}/log/new_path.log")
|
109
109
|
home = "localhost:3002"
|
110
110
|
sessions = search_sessions
|
111
111
|
number_of_sessions = sessions.size
|
@@ -21,7 +21,7 @@ describe "Application" do
|
|
21
21
|
end
|
22
22
|
init_err_file
|
23
23
|
lno = 0
|
24
|
-
paths = File.new("#{
|
24
|
+
paths = File.new("#{Rails.root}/log/paths.log")
|
25
25
|
user = Array.new(number_of_sessions)
|
26
26
|
session_index = 0
|
27
27
|
begin
|
@@ -151,7 +151,7 @@ describe "Application" do
|
|
151
151
|
last_path = delete_groups(last_path)
|
152
152
|
last_path = delete_single_links(last_path)
|
153
153
|
delete_ids(last_path)
|
154
|
-
f = File.new("#{
|
154
|
+
f = File.new("#{Rails.root}/log/new_path.log", "w")
|
155
155
|
f.puts last_path
|
156
156
|
f.close
|
157
157
|
end
|
@@ -555,7 +555,7 @@ def try_path(path_to_try)
|
|
555
555
|
#puts "Found Error again, go on..."
|
556
556
|
error_not_found = false
|
557
557
|
else
|
558
|
-
f = File.new("#{
|
558
|
+
f = File.new("#{Rails.root}/log/debugging.log", "w")
|
559
559
|
f.puts path_to_try
|
560
560
|
f.close
|
561
561
|
error_not_found = true
|
@@ -725,7 +725,7 @@ end
|
|
725
725
|
|
726
726
|
def init_user_inputs
|
727
727
|
@user_inputs = Hash.new
|
728
|
-
file = File.new("#{
|
728
|
+
file = File.new("#{Rails.root}/log/user_input.log", "r")
|
729
729
|
while line = file.gets do
|
730
730
|
b = line.split(/:/,2)
|
731
731
|
@user_inputs["#{b[0].strip}"] = b[1].chop
|
@@ -767,7 +767,3 @@ def add_path(value)
|
|
767
767
|
@path << value
|
768
768
|
end
|
769
769
|
|
770
|
-
def gem_path
|
771
|
-
path = %x(gem which auto_test)
|
772
|
-
path = path[0..path.size-13]
|
773
|
-
end
|
data/lib/tasks/auto_test.rb
CHANGED
@@ -6,7 +6,8 @@ namespace :auto_test do
|
|
6
6
|
sh "rails server -e test -p 3002 -d"
|
7
7
|
path = %x(gem which auto_test)
|
8
8
|
path = path[0..path.size-13]
|
9
|
-
sh "rspec '#{path}/../spec/requests/auto_spec.rb'
|
9
|
+
sh "rspec '#{path}/../spec/requests/auto_spec.rb' -o '#{path}/../../log/rspec.txt'"
|
10
|
+
sh "rm '#{path}/../../log/rspec.txt'"
|
10
11
|
Rake::Task["auto_test:error_calc"].invoke
|
11
12
|
Rake::Task["auto_test:stop"].invoke
|
12
13
|
end
|
@@ -15,7 +16,6 @@ namespace :auto_test do
|
|
15
16
|
task :error_calc do
|
16
17
|
path = %x(gem which auto_test)
|
17
18
|
path = path[0..path.size-13]
|
18
|
-
sh "rm '#{path}/../../log/rspec.txt'"
|
19
19
|
err = File.read("#{path}/../../log/errors.log")
|
20
20
|
if err.to_i > 0 then
|
21
21
|
puts "Do you want to see the error-path in firefox? Type yes/no:"
|
data/lib/test.rb
CHANGED
@@ -3,11 +3,7 @@ require 'capybara/rspec'
|
|
3
3
|
module AutoTest
|
4
4
|
module Test
|
5
5
|
module_function
|
6
|
-
|
7
|
-
def gem_path
|
8
|
-
path = %x(gem which auto_test)
|
9
|
-
path = path[0..path.size-13]
|
10
|
-
end
|
6
|
+
|
11
7
|
|
12
8
|
# initialize all variables
|
13
9
|
def initialize_test
|
@@ -300,7 +296,7 @@ module AutoTest
|
|
300
296
|
|
301
297
|
|
302
298
|
def write_user_input_to_file
|
303
|
-
f = File.new("#{
|
299
|
+
f = File.new("#{Rails.root}/log/user_input.log", "w")
|
304
300
|
if Test.no_auth then
|
305
301
|
f.puts("get_number_of_test_runs:#{get_number_of_test_runs}
|
306
302
|
get_number_of_sessions:#{get_number_of_sessions}")
|
@@ -367,13 +363,13 @@ module AutoTest
|
|
367
363
|
end
|
368
364
|
Test.check_invariants
|
369
365
|
if !Test.stop? then Test.users_logged_in = Test.users_logged_in + 1 end
|
370
|
-
f = File.new("#{
|
366
|
+
f = File.new("#{Rails.root}/log/paths.log", "w")
|
371
367
|
f.puts(Test.action_path)
|
372
368
|
f.close
|
373
369
|
puts
|
374
370
|
Error.print_errors
|
375
371
|
if Error.get_error > 0 then
|
376
|
-
f = File.new("#{
|
372
|
+
f = File.new("#{Rails.root}/log/errors.log", "w")
|
377
373
|
f.puts(Error.get_error)
|
378
374
|
f.puts(Error.get_error_messages)
|
379
375
|
f.close
|