Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Class: behat_filepicker  - X-Ref

Steps definitions to deal with the filemanager and filepicker.

i_create_folder_in_filemanager($foldername, $filemanagerelement)   X-Ref
Creates a folder with specified name in the current folder and in the specified filemanager field.

param: string $foldername
param: string $filemanagerelement

i_open_folder_from_filemanager($foldername, $filemanagerelement)   X-Ref
Opens the contents of a filemanager folder. It looks for the folder in the current folder and in the path bar.

param: string $foldername
param: string $filemanagerelement

i_unzip_file_from_filemanager($filename, $filemanagerelement)   X-Ref
Unzips the specified file from the specified filemanager field. The zip file has to be visible in the current folder.

param: string $filename
param: string $filemanagerelement

i_zip_folder_from_filemanager($foldername, $filemanagerelement)   X-Ref
Zips the specified folder from the specified filemanager field. The folder has to be in the current folder.

param: string $foldername
param: string $filemanagerelement

i_delete_file_from_filemanager($name, $filemanagerelement)   X-Ref
Deletes the specified file or folder from the specified filemanager field.

param: string $name
param: string $filemanagerelement

i_should_see_elements_in_filemanager($elementscount, $filemanagerelement)   X-Ref
Makes sure user can see the exact number of elements (files in folders) in the filemanager.

param: int $elementscount
param: string $filemanagerelement

i_add_file_from_repository_to_filemanager($filepath, $repository, $filemanagerelement)   X-Ref
Picks the file from repository leaving default values in select file dialogue.

param: string $filepath
param: string $repository
param: string $filemanagerelement

i_add_and_overwrite_file_from_repository_to_filemanager($filepath, $repository, $filemanagerelement)   X-Ref
Picks the file from repository leaving default values in select file dialogue and confirming to overwrite an existing file.

param: string $filepath
param: string $repository
param: string $filemanagerelement

i_add_file_from_repository_to_filemanager_as($filepath, $repository, $filemanagerelement, TableNode $data)   X-Ref
Picks the file from repository filling the form in Select file dialogue.

param: string $filepath
param: string $repository
param: string $filemanagerelement
param: TableNode $data Data to fill the form in Select file dialogue

i_add_and_overwrite_file_from_repository_to_filemanager_as($filepath, $repository, $filemanagerelement,TableNode $data)   X-Ref
Picks the file from repository confirming to overwrite an existing file

param: string $filepath
param: string $repository
param: string $filemanagerelement
param: TableNode $data Data to fill the form in Select file dialogue

add_file_from_repository_to_filemanager($filepath, $repository, $filemanagerelement, TableNode $data,$overwriteaction = false)   X-Ref
Picks the file from private files repository

param: string $filepath
param: string $repository
param: string $filemanagerelement
param: TableNode $data Data to fill the form in Select file dialogue
param: false|string $overwriteaction false if we don't expect that file with the same name already exists,

i_select_filepicker_repository($repositoryname)   X-Ref
Selects a repository from the repository list in the file picker.

param: string $repositoryname

i_should_see_elements_in_filepicker_repository($expectedcount)   X-Ref
Makes sure user can see the exact number of elements (files and folders) in the repository content area in
the file picker.

param: int $expectedcount

get_element_in_filepicker_repository($elementname, $elementtype)   X-Ref
Returns a specific element (file or folder) in the repository content area in the file picker.

param: string $elementname The name of the element
param: string $elementtype The type of the element ("file" or "folder")
return: NodeElement

i_should_see_element_in_filepicker_repository($elementname, $elementtype)   X-Ref
Makes sure user can see a specific element (file or folder) in the repository content area in the file picker.

param: string $elementname The name of the element
param: string $elementtype The type of the element ("file" or "folder")

i_click_on_element_in_filepicker_repository($elementname, $elementtype)   X-Ref
Clicks on a specific element (file or folder) in the repository content area in the file picker.

param: string $elementname The name of the element
param: string $elementtype The type of the element ("file" or "folder")

i_should_see_breadcrumb_navigation_in_filepicker_repository($breadcrumbs)   X-Ref
Makes sure the user can see a specific breadcrumb navigation structure in the file picker repository.

param: string $breadcrumbs The breadcrumb navigation structure (ex. "System > Category > Course")