Skip to content

Commit

Permalink
Merge branch 'MDL-75019-39' of https://github.com/andelacruz/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_39_STABLE
  • Loading branch information
junpataleta committed Aug 31, 2022
2 parents 874472a + 5d15e96 commit 9ae0e4a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 46 deletions.
11 changes: 4 additions & 7 deletions course/tests/behat/view_subfolders_inline.feature
Expand Up @@ -14,13 +14,10 @@ Feature: View subfolders in a course in-line
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Folder" to section "3" and I fill the form with:
| Name | Test folder |
| Display folder contents | On a separate page |
| Show subfolders expanded | |
And I am on the "Test folder" "folder activity" page
And the following "activities" exist:
| activity | course | name | display | showexpanded |
| folder | C1 | Test folder | 0 | 0 |
And I am on the "Test folder" "folder activity" page logged in as "teacher1"
And I press "Edit"
And I press "Create folder"
And I set the field "New folder name" to "Test subfolder 1"
Expand Down
12 changes: 6 additions & 6 deletions repository/recent/tests/behat/add_recent.feature
Expand Up @@ -9,20 +9,20 @@ Feature: Recent files repository lists the recently used files
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "activities" exist:
| activity | course | name | intro |
| folder | C1 | Folder name | Folder description |
And I log in as "admin"
And I follow "Manage private files"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filemanager
And I press "Save changes"
And I am on "Course 1" course homepage with editing mode on
When I add a "Folder" to section "1"
And I set the following fields to these values:
| Name | Folder name |
| Description | Folder description |
And I am on the "Folder name" "folder activity" page
And I press "Edit"
And I add "empty.txt" file from "Recent files" to "Files" filemanager
And I add "empty.txt" file from "Recent files" to "Files" filemanager as:
| Save as | empty_copy.txt |
And I press "Save and display"
And I press "Save changes"
Then I should see "empty.txt"
And I should see "empty_copy.txt"
And I should see "Folder description"
12 changes: 6 additions & 6 deletions repository/tests/behat/cancel_add_file.feature
Expand Up @@ -9,22 +9,22 @@ Feature: A selected file can be cancelled
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "activities" exist:
| activity | course | name | intro |
| folder | C1 | Folder name | Folder description |
And I log in as "admin"
And I follow "Manage private files"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I press "Save changes"
And I am on "Course 1" course homepage with editing mode on
When I add a "Folder" to section "1"
And I set the following fields to these values:
| Name | Folder name |
| Description | Folder description |
And I am on the "Folder name" "folder activity" page
And I press "Edit"
And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filemanager
And I click on "Add..." "button" in the "Files" "form_row"
And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
And I click on "//a[contains(concat(' ', normalize-space(@class), ' '), ' fp-file ')][normalize-space(.)='empty.txt']" "xpath_element"
And I click on ".moodle-dialogue-focused .fp-select .fp-select-cancel" "css_element"
And I click on "Close" "button" in the "File picker" "dialogue"
And I press "Save and display"
And I press "Save changes"
Then I should see "upload_users.csv"
And I should not see "empty.txt"
And I should see "Folder description"
37 changes: 10 additions & 27 deletions repository/tests/behat/select_file.feature
Expand Up @@ -8,18 +8,17 @@ Feature: Select file feature
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "activities" exist:
| activity | course | name |
| folder | C1 | Test folder |
And I am on the "Test folder" "folder activity" page logged in as admin
And I press "Edit"
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I press "Save changes"

@javascript
Scenario: Select a file from the "Recent files" repository using "icons" view
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Folder" to section "1"
And I set the following fields to these values:
| Name | Test folder |
| Description | Test folder description |
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I click on "Save and display" "button"
And I follow "Dashboard" in the user menu
Given I follow "Dashboard" in the user menu
And I follow "Manage private files"
And I click on "Add..." "button" in the "Files" "form_row"
And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
Expand All @@ -32,15 +31,7 @@ Feature: Select file feature

@javascript
Scenario: Select a file from the "Recent files" repository using "list" view
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Folder" to section "1"
And I set the following fields to these values:
| Name | Test folder |
| Description | Test folder description |
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I click on "Save and display" "button"
And I follow "Dashboard" in the user menu
Given I follow "Dashboard" in the user menu
And I follow "Manage private files"
And I click on "Add..." "button" in the "Files" "form_row"
And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
Expand All @@ -53,15 +44,7 @@ Feature: Select file feature

@javascript
Scenario: Select a file from the "Recent files" repository using "tree" view
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Folder" to section "1"
And I set the following fields to these values:
| Name | Test folder |
| Description | Test folder description |
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
And I click on "Save and display" "button"
And I follow "Dashboard" in the user menu
Given I follow "Dashboard" in the user menu
And I follow "Manage private files"
And I click on "Add..." "button" in the "Files" "form_row"
And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
Expand Down

0 comments on commit 9ae0e4a

Please sign in to comment.