auto_test 0.1.9.8.7 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,12 +5,15 @@ class TestStarter
5
5
  for j in 1..Test.get_number_of_test_runs do
6
6
  Test.run = j
7
7
  if !Test.stop?
8
+ # initialization
8
9
  number_of_sessions = Test.get_number_of_sessions
9
10
  Test.init_sessions_array
10
11
  Test.init_sessions
11
12
  Test.init_ready
12
13
  for i in 0..number_of_sessions-1 do
14
+ # Session instantiation
13
15
  sess = Capybara::Session.new(:rack_test,Rails.application)
16
+ # session variable initialization
14
17
  Test.add_to_sessions_array sess
15
18
  Test.init_hash_sessions(i, Hash.new)
16
19
  Test.sessions(i,"depth", 0)
@@ -33,9 +36,12 @@ class TestStarter
33
36
  if Test.no_auth then
34
37
  Test.users_logged_in = 0
35
38
  end
39
+ # Console output
36
40
  STDOUT.write("\r#{Test.run}. run: \t#{Test.link_counter} links clicked, \t#{Test.users_logged_in} users logged in, \t#{Error.get_error} Errors")
37
41
  while !Test.stop? && !Test.ready? do
42
+ # get a random session
38
43
  session = rand(number_of_sessions)
44
+ # let the session test a random number of times, max the number given by the tester
39
45
  for i in 0..rand(Test.get_max_number_of_session_links) do
40
46
  Page.run_session(session)
41
47
  end
@@ -44,10 +50,12 @@ class TestStarter
44
50
  end
45
51
  Test.check_invariants
46
52
  if !Test.stop? then Test.users_logged_in = Test.users_logged_in + 1 end
53
+ # save the action path to a file
47
54
  f = File.new("#{Rails.root}/log/paths.log", "w")
48
55
  f.puts(Test.action_path)
49
56
  f.close
50
57
  puts
58
+ # print and save the errors
51
59
  Error.print_errors
52
60
  f = File.new("#{Rails.root}/log/errors.log", "w")
53
61
  f.puts(Error.get_error)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: auto_test
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.9.8.7
5
+ version: "1.0"
6
6
  platform: ruby
7
7
  authors:
8
8
  - Maike Hargens
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-11-09 00:00:00 Z
13
+ date: 2012-11-23 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faker