Test in Boost and Clean.
NOTE: A session cookie is created with 30 mins expiration time, so in order to test the scenarios easily, you should manually remove the Moodle session cookie each time (there are extensions for chrome and mozilla that helps you do that).
Test 1: (Age of digital consent verification setting).
- Log in as an Admin.
- Go to Site administration > Plugins > Authentication > Manage authentication.
- Set 'Self registration' = 'Email-based self-registration'.
- Enable 'Digital age of consent verification' and save changes.
- Logout Admin.
- Go to 'Log in' page and click on 'Create new account' button.
- make sure the 'Age and location verification' page is displayed.
- Log in as Admin.
- Go to Site administration > Plugins > Authentication > Manage authentication.
- Disable 'Digital age of consent verification' and save changes.
- Logout Admin.
- Go to 'Log in' page and click on 'Create new account' button.
- make sure the 'Sign up' page is displayed.
- Try to access the 'Age and location verification' page by entering the url (your_moodle_instance/login/verify_age_location.php).
- make sure you are redirected to the home page and a message 'Sorry, digital age consent verification is not possible at this time.' is displayed.
Test 2: (User is a minor).
Prerequisite:
- 'Digital age of consent verification' enabled (Site administration > Plugins > Authentication > Manage authentication).
- 'Digital age of consent' has the default value (default (wildcard *) age value and several exception values are present).
User's country of residence exists in 'Digital age of consent' map.
- Go to Log in page and click on 'Create new account' button.
- In 'Age and location verification' page:
- Set 'In which country do you live?' = Austria (AT) (or any other country that is present in the 'Age of digital consent' map as an exception).
- Set 'What is your age?' = 13 (or any age that is below the age defined in 'Age of digital consent' for that particular country).
- Click on 'Proceed'.
- make sure you are directed to a page where it says the user is a digital minor and contact details of the administrator are presented.
- Go back to 'Log in' page and click on 'Create new account' button.
- make sure the digital minor page is displayed.
- Try to access the 'Sign up' page by entering the url (your_moodle_instance/login/signup.php).
- make sure you're directed to the digital minor page.
User's country of residence does not exists in 'Digital age of consent' map.
- Go to Log in page and click on 'Create new account' button.
- In 'Age and location verification' page:
- Set 'In which country do you live?' = Algeria (DZ) (or any other country that is NOT present in the 'Age of digital consent' map as an exception).
- Set 'What is your age?' = 15 (or any age that is below the default age (wildcard *) defined in 'Age of digital consent').
- Click on 'Proceed'.
- make you are directed to a page where it says the user is a digital minor and contact details of the administrator are presented.
- Go back to 'Log in' page and click on 'Create new account' button.
- make sure the digital minor page is displayed.
- Try to access the 'Sign up' page by entering the url (your_moodle_instance/login/signup.php)
- make sure you're directed to the digital minor page.
Test 3: (User is not a minor).
Prerequisite:
- 'Digital age of consent verification' enabled (Site administration > Plugins > Authentication > Manage authentication).
- 'Digital age of consent' has the default value (default (wildcard *) age value and several exception values are present).
User's country of residence exists in 'Digital age of consent' map.
- Go to Log in page and click on 'Create new account' button.
- In 'Age and location verification' page:
- Set 'In which country do you live?' = Austria (AT) (or any other country that is present in the 'Age of digital consent' map as an exception).
- Set 'What is your age?' = 15 (or any age that is over/equal the age defined in 'Age of digital consent' for that particular country).
- Click on 'Proceed'.
- make sure you are directed to the 'Sign up' page.
- Go back to 'Log in' page and click on 'Create new account' button.
- make sure the 'Sign up' page is displayed.
User's country of residence does not exists in 'Digital age of consent' map.
- Go to Log in page and click on 'Create new account' button.
- In 'Age and location verification' page:
- Set 'In which country do you live?' = Algeria (DZ) (or any other country that is NOT present in the 'Age of digital consent' map as an exception).
- Set 'What is your age?' = 16 (or any age that is over/equal the default age (wildcard *) defined in 'Age of digital consent').
- Click on 'Proceed'.
- make sure you are directed to the 'Sign up' page.
- Go back to 'Log in' page and click on 'Create new account' button.
- make sure the 'Sign up' page is displayed.
Test 4 (Validation of Age and location verification form).
Prerequisite:
- 'Digital age of consent verification' enabled (Site administration > Plugins > Authentication > Manage authentication).
- 'Digital age of consent' has the default value (default (wildcard *) age value and several exception values are present).
Test
- Go to Log in page and click on 'Create new account' button.
- In 'Age and location verification' page:
- Set 'Where do you live' = 'Select a country' (empty value).
- Set 'How old are you?' = Invalid age value (ex. string value, negative number, etc.).
- Click on 'Proceed'.
- make the form is properly validated and proper validation messages are displayed.
Test 5 (Age of digital consent setting).
- Log in as an Admin.
- Go to Site administration > Plugins > Authentication > Manage authentication.
- Modify 'Digital age of consent' default value and make sure the modified value has an invalid format.
- Invalid formats to test (examples):
- missing comma separator between values:
'*, 16
AT14'
- missing/invalid value for country:
'*, 16
, 20'
- missing/invalid value for age:
'*, 16
AT, '
- invalid value for country:
'*, 16
TEST, 14'
- invalid value for age:
'*, 16
AT, age'
- missing default (wildcard *) value:
'AT, 14
CZ, 13'
- Save changes.
- make sure a validation error message is displayed stating the format of the 'Age of digital consent' value is invalid and the change is not saved.