From fcedef4566f13319eb4bc5006e00e6e40ffdae15 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Tue, 21 Feb 2023 12:19:40 +0800 Subject: [PATCH] MDL-77271 behat: verify user licence preference is remembered --- .../tests/behat/license_manager.feature | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/admin/tool/licensemanager/tests/behat/license_manager.feature b/admin/tool/licensemanager/tests/behat/license_manager.feature index 0ff21b929d1be..5ab86353b30db 100644 --- a/admin/tool/licensemanager/tests/behat/license_manager.feature +++ b/admin/tool/licensemanager/tests/behat/license_manager.feature @@ -33,3 +33,26 @@ Feature: Licence manager And "This is the site default licence" "icon" should exist in the "cc" "table_row" And "Enable licence" "icon" should not exist in the "cc" "table_row" And "This is the site default licence" "icon" should not exist in the "public" "table_row" + + @javascript @_file_upload + Scenario Outline: User licence preference is remembered depending of setting value + Given the following config values are set as admin: + | sitedefaultlicense | cc | + | rememberuserlicensepref | | + And I log in as "admin" + And I follow "Private files" in the user menu + And I follow "Add..." + And I follow "Upload a file" + And the field with xpath "//select[@name='license']" matches value "Creative Commons" + And I click on "Close" "button" in the "File picker" "dialogue" + When I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager as: + | Save as | empty_copy.txt | + | license | Public domain | + And I press "Save changes" + And I follow "Add..." + Then the field with xpath "//select[@name='license']" matches value "" + + Examples: + | rememberuserlicensepref | expectedlicence | + | 0 | Creative Commons | + | 1 | Public domain |