auto_test 0.0.8.4 → 0.0.8.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.
- data/lib/{user.rb → authentication.rb} +1 -1
- data/lib/auto_test/version.rb +1 -1
- data/lib/dsl.rb +8 -8
- data/lib/page.rb +6 -6
- data/lib/test.rb +13 -13
- metadata +2 -2
data/lib/auto_test/version.rb
CHANGED
data/lib/dsl.rb
CHANGED
@@ -22,7 +22,7 @@ module AutoTest
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def set_unique_login_attribute_name(name)
|
25
|
-
|
25
|
+
Authentication.set_unique_login_attribute_name(name)
|
26
26
|
end
|
27
27
|
|
28
28
|
# for the name or part of the name of an input field, decide, which values to use
|
@@ -35,11 +35,11 @@ module AutoTest
|
|
35
35
|
# the database
|
36
36
|
# the data has to be created in the test_seeds.rb file
|
37
37
|
def set_login_data(*data)
|
38
|
-
|
38
|
+
Authentication.set_login_data(*data)
|
39
39
|
end
|
40
40
|
|
41
41
|
def get_users_from_db(user_class_name, bool)
|
42
|
-
|
42
|
+
Authentication.get_users_from_db(user_class_name, bool)
|
43
43
|
end
|
44
44
|
|
45
45
|
# for all objects of class child, there has to be one object of class parent
|
@@ -63,19 +63,19 @@ module AutoTest
|
|
63
63
|
|
64
64
|
# set the login path
|
65
65
|
def set_login_path(path)
|
66
|
-
|
66
|
+
Authentication.set_login_path(path)
|
67
67
|
end
|
68
68
|
|
69
69
|
# set the attribute_names and fields that are needed to login
|
70
70
|
# the argument is a list of pairs [attribute_name, field]
|
71
71
|
def set_login_attribute_names(names, fields)
|
72
|
-
|
73
|
-
|
74
|
-
|
72
|
+
Authentication.set_login_attribute_names(names, fields)
|
73
|
+
Authentication.set_login_fields(fields)
|
74
|
+
Authentication.set_login_names(names)
|
75
75
|
end
|
76
76
|
|
77
77
|
def set_logout_path(path)
|
78
|
-
|
78
|
+
Authentication.set_logout_path(path)
|
79
79
|
end
|
80
80
|
|
81
81
|
def stop_at_first_error(stop_at_first_error)
|
data/lib/page.rb
CHANGED
@@ -8,7 +8,7 @@ class Time
|
|
8
8
|
def self.random
|
9
9
|
year = Time.now.year
|
10
10
|
month = rand(12) + 1
|
11
|
-
day = (rand * 28).
|
11
|
+
day = (rand * 28).ceilAuthentication
|
12
12
|
Time.local(year, month, day)
|
13
13
|
end
|
14
14
|
end
|
@@ -21,12 +21,12 @@ module AutoTest
|
|
21
21
|
def run_session(i)
|
22
22
|
session = Test.get_sessions_array[i]
|
23
23
|
if !Test.stop? then
|
24
|
-
if Test.no_auth || Test.get_sessions(i,"current_user") <=
|
24
|
+
if Test.no_auth || Test.get_sessions(i,"current_user") <= Authentication.get_users.size then
|
25
25
|
if Test.get_sessions(i,"depth") <= Test.get_max_depth then
|
26
26
|
if Test.get_sessions(i,"iteration") <= Test.get_sessions(i,"iterations") then
|
27
27
|
begin
|
28
28
|
if Test.get_sessions(i, "current_depth") == 0 && !Test.no_auth then
|
29
|
-
|
29
|
+
Authentication.login(Test.get_sessions(i,"user"),session)
|
30
30
|
Test.check_invariants
|
31
31
|
end
|
32
32
|
if Test.no_auth then
|
@@ -65,7 +65,7 @@ module AutoTest
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
if !Test.no_auth then
|
68
|
-
|
68
|
+
Authentication.logout(session)
|
69
69
|
end
|
70
70
|
Test.sessions(i, "current_depth", 0)
|
71
71
|
Test.sessions(i, "paths", Hash.new)
|
@@ -88,7 +88,7 @@ module AutoTest
|
|
88
88
|
end
|
89
89
|
if !Test.no_auth then
|
90
90
|
Test.sessions(i, "current_user", Test.get_sessions(i,"current_user")+1)
|
91
|
-
user =
|
91
|
+
user = Authentication.get_users[rand(Authentication.get_users.size)]
|
92
92
|
Test.sessions(i, "user", user)
|
93
93
|
Test.add_to_action_path "#{i}:#{user.id}ID"
|
94
94
|
end
|
@@ -264,6 +264,6 @@ module AutoTest
|
|
264
264
|
end
|
265
265
|
|
266
266
|
autoload :Test, 'test'
|
267
|
-
autoload :
|
267
|
+
autoload :Authentication, 'authentication'
|
268
268
|
autoload :Error, 'error'
|
269
269
|
end
|
data/lib/test.rb
CHANGED
@@ -2,14 +2,14 @@ require 'capybara/rspec'
|
|
2
2
|
#require 'watir-webdriver'
|
3
3
|
module AutoTest
|
4
4
|
module Test
|
5
|
-
|
5
|
+
module_functionAuthentication
|
6
6
|
|
7
7
|
# initialize all variables
|
8
8
|
def initialize_test
|
9
9
|
Error.init_error
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
Authentication.init_users
|
12
|
+
Authentication.init_login_data
|
13
13
|
init_action_path
|
14
14
|
init_depth
|
15
15
|
init_inputs
|
@@ -300,15 +300,15 @@ module AutoTest
|
|
300
300
|
get_number_of_sessions:#{get_number_of_sessions}")
|
301
301
|
else
|
302
302
|
f.puts("get_number_of_test_runs:#{get_number_of_test_runs}
|
303
|
-
get_login_path:#{
|
304
|
-
get_logout_path:#{
|
305
|
-
get_login_attributes:#{
|
303
|
+
get_login_path:#{Authentication.get_login_path}
|
304
|
+
get_logout_path:#{Authentication.get_logout_path}
|
305
|
+
get_login_attributes:#{Authentication.get_login_attributes}
|
306
306
|
get_number_of_sessions:#{get_number_of_sessions}
|
307
|
-
get_login_data:#{
|
308
|
-
get_login_names:#{
|
309
|
-
get_unique_login_attribute_name:#{
|
310
|
-
use_db_users:#{
|
311
|
-
user_class:#{
|
307
|
+
get_login_data:#{Authentication.get_login_data}
|
308
|
+
get_login_names:#{Authentication.get_login_names}
|
309
|
+
get_unique_login_attribute_name:#{Authentication.get_unique_login_attribute_name}
|
310
|
+
use_db_users:#{Authentication.use_db_users}
|
311
|
+
user_class:#{Authentication.user_class}")
|
312
312
|
end
|
313
313
|
f.close
|
314
314
|
end
|
@@ -333,7 +333,7 @@ module AutoTest
|
|
333
333
|
Test.sessions(i,"depth", 0)
|
334
334
|
Test.sessions(i,"iterations", 0)
|
335
335
|
if !Test.no_auth then
|
336
|
-
user =
|
336
|
+
user = Authentication.get_users[rand(Authentication.get_users.size)]
|
337
337
|
Test.sessions(i,"user", user)
|
338
338
|
Test.add_to_action_path "#{i}:#{user.id}ID"
|
339
339
|
Test.sessions(i,"current_user", 0)
|
@@ -375,7 +375,7 @@ module AutoTest
|
|
375
375
|
end
|
376
376
|
end
|
377
377
|
|
378
|
-
autoload :
|
378
|
+
autoload :Authentication, 'authentication'
|
379
379
|
autoload :Error, 'error'
|
380
380
|
|
381
381
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: auto_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.8.
|
5
|
+
version: 0.0.8.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Maike Hargens
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- README.md
|
95
95
|
- Rakefile
|
96
96
|
- auto_test.gemspec
|
97
|
+
- lib/authentication.rb
|
97
98
|
- lib/auto_test.rb
|
98
99
|
- lib/auto_test/railtie.rb
|
99
100
|
- lib/auto_test/version.rb
|
@@ -105,7 +106,6 @@ files:
|
|
105
106
|
- lib/spec/requests/error_reduction_spec.rb
|
106
107
|
- lib/tasks/auto_test.rb
|
107
108
|
- lib/test.rb
|
108
|
-
- lib/user.rb
|
109
109
|
homepage:
|
110
110
|
licenses: []
|
111
111
|
|