Module: AutoTest::Dsl
- Included in:
- AutoTest
- Defined in:
- lib/dsl.rb
Class Method Summary collapse
-
.always_present(class_name, key, value) ⇒ Object
add an array of the classname, key and value of the object to be checked every cycle.
-
.get_users_from_db(user_class_name, bool) ⇒ Object
determine wether users can be read from db or not.
-
.links_to_exclude(*links) ⇒ Object
set the links, that aren´t supposed to be clicked @*links List of two-element-arrays, first value link-text, second value link href.
-
.set_input(input, *values) ⇒ Object
for the name or part of the name of an input field, decide, which values to use if not set, random values matching the input type are used.
-
.set_login_attribute_names(names, fields) ⇒ Object
set the attribute_names and fields that are needed to login the argument is a list of pairs [attribute_name, field].
-
.set_login_button(text) ⇒ Object
set the text of the login button.
-
.set_login_data(*data) ⇒ Object
give data for logins, e.g.
-
.set_login_path(path) ⇒ Object
set the login path.
-
.set_logout_path(path) ⇒ Object
set the path to logout.
-
.set_max_depth(value) ⇒ Object
set the maximal depth to which the links are clicked.
-
.set_max_number_of_session_links(no) ⇒ Object
set the maxium number of links one session can click in a row before the next session continues.
-
.set_no_auth ⇒ Object
set, if there´s no authentication in the application.
-
.set_number_of_sessions(number) ⇒ Object
set the number of sessions used to test the app.
-
.set_number_of_test_runs(number) ⇒ Object
set the number of test runs.
-
.set_object_dependency(child, parent, attribute_name) ⇒ Object
for all objects of class child, there has to be one object of class parent attribute_name is the column that joins the two tables.
-
.set_unique_login_attribute_name(name) ⇒ Object
set the unique attribute name of the user.
-
.stop_at_first_error(stop_at_first_error) ⇒ Object
determine if the test is supposed to stop when the first error is found.
Class Method Details
.always_present(class_name, key, value) ⇒ Object
add an array of the classname, key and value of the object to be checked every cycle
14 15 16 |
# File 'lib/dsl.rb', line 14 def always_present(class_name, key, value) Test.always_present(class_name, key, value) end |
.get_users_from_db(user_class_name, bool) ⇒ Object
determine wether users can be read from db or not
42 43 44 |
# File 'lib/dsl.rb', line 42 def get_users_from_db(user_class_name, bool) Authentication.get_users_from_db(user_class_name, bool) end |
.links_to_exclude(*links) ⇒ Object
set the links, that aren´t supposed to be clicked @*links List of two-element-arrays, first value link-text, second value link href
9 10 11 |
# File 'lib/dsl.rb', line 9 def links_to_exclude(*links) Test.links_to_exclude(*links) end |
.set_input(input, *values) ⇒ Object
for the name or part of the name of an input field, decide, which values to use if not set, random values matching the input type are used
30 31 32 |
# File 'lib/dsl.rb', line 30 def set_input(input, *values) Test.set_input(input, *values) end |
.set_login_attribute_names(names, fields) ⇒ Object
set the attribute_names and fields that are needed to login the argument is a list of pairs [attribute_name, field]
80 81 82 83 84 |
# File 'lib/dsl.rb', line 80 def set_login_attribute_names(names, fields) Authentication.set_login_attribute_names(names, fields) Authentication.set_login_fields(fields) Authentication.set_login_names(names) end |
.set_login_button(text) ⇒ Object
set the text of the login button
69 70 71 |
# File 'lib/dsl.rb', line 69 def (text) Authentication.(text) end |
.set_login_data(*data) ⇒ Object
give data for logins, e.g. if the password for users is saved as salt and hash in the database the data has to be created in the test_seeds.rb file
37 38 39 |
# File 'lib/dsl.rb', line 37 def set_login_data(*data) Authentication.set_login_data(*data) end |
.set_login_path(path) ⇒ Object
set the login path
74 75 76 |
# File 'lib/dsl.rb', line 74 def set_login_path(path) Authentication.set_login_path(path) end |
.set_logout_path(path) ⇒ Object
set the path to logout
87 88 89 |
# File 'lib/dsl.rb', line 87 def set_logout_path(path) Authentication.set_logout_path(path) end |
.set_max_depth(value) ⇒ Object
set the maximal depth to which the links are clicked
19 20 21 |
# File 'lib/dsl.rb', line 19 def set_max_depth(value) Test.set_max_depth(value) end |
.set_max_number_of_session_links(no) ⇒ Object
set the maxium number of links one session can click in a row before the next session continues
59 60 61 |
# File 'lib/dsl.rb', line 59 def set_max_number_of_session_links(no) Test.set_max_number_of_session_links(no) end |
.set_no_auth ⇒ Object
set, if there´s no authentication in the application
64 65 66 |
# File 'lib/dsl.rb', line 64 def set_no_auth Test.set_no_auth end |
.set_number_of_sessions(number) ⇒ Object
set the number of sessions used to test the app
53 54 55 |
# File 'lib/dsl.rb', line 53 def set_number_of_sessions(number) Test.set_number_of_sessions(number) end |
.set_number_of_test_runs(number) ⇒ Object
set the number of test runs
97 98 99 |
# File 'lib/dsl.rb', line 97 def set_number_of_test_runs(number) Test.set_number_of_test_runs(number) end |
.set_object_dependency(child, parent, attribute_name) ⇒ Object
for all objects of class child, there has to be one object of class parent attribute_name is the column that joins the two tables
48 49 50 |
# File 'lib/dsl.rb', line 48 def set_object_dependency(child, parent, attribute_name) Test.set_object_dependency(child, parent, attribute_name) end |
.set_unique_login_attribute_name(name) ⇒ Object
set the unique attribute name of the user
24 25 26 |
# File 'lib/dsl.rb', line 24 def set_unique_login_attribute_name(name) Authentication.set_unique_login_attribute_name(name) end |
.stop_at_first_error(stop_at_first_error) ⇒ Object
determine if the test is supposed to stop when the first error is found
92 93 94 |
# File 'lib/dsl.rb', line 92 def stop_at_first_error(stop_at_first_error) Test.stop_at_first_error(stop_at_first_error) end |