|
Moodle PHP Documentation 4.4
Moodle 4.4.9+ (Build: 20250711) (4ea86454947)
|
Steps definitions to deal with the filemanager and filepicker. More...
Public Member Functions | |
| getSession ($name=null) | |
| Returns the Mink session. | |
| i_add_and_overwrite_file_from_repository_to_filemanager ($filepath, $repository, $filemanagerelement) | |
| Picks the file from repository leaving default values in select file dialogue and confirming to overwrite an existing file. | |
| i_add_and_overwrite_file_from_repository_to_filemanager_as ($filepath, $repository, $filemanagerelement, TableNode $data) | |
| Picks the file from repository confirming to overwrite an existing file. | |
| i_add_file_from_repository_to_filemanager ($filepath, $repository, $filemanagerelement) | |
| Picks the file from repository leaving default values in select file dialogue. | |
| i_add_file_from_repository_to_filemanager_as ($filepath, $repository, $filemanagerelement, TableNode $data) | |
| Picks the file from repository filling the form in Select file dialogue. | |
| i_click_on_element_in_filepicker_repository ($elementname, $elementtype) | |
| Clicks on a specific element (file or folder) in the repository content area in the file picker. | |
| i_create_folder_in_filemanager ($foldername, $filemanagerelement) | |
| Creates a folder with specified name in the current folder and in the specified filemanager field. | |
| i_delete_file_from_filemanager ($name, $filemanagerelement) | |
| Deletes the specified file or folder from the specified filemanager field. | |
| i_open_folder_from_filemanager ($foldername, $filemanagerelement) | |
| Opens the contents of a filemanager folder. | |
| i_select_filepicker_repository ($repositoryname) | |
| Selects a repository from the repository list in the file picker. | |
| i_should_see_breadcrumb_navigation_in_filepicker_repository ($breadcrumbs) | |
| Makes sure the user can see a specific breadcrumb navigation structure in the file picker repository. | |
| i_should_see_element_in_filepicker_repository ($elementname, $elementtype) | |
| Makes sure user can see a specific element (file or folder) in the repository content area in the file picker. | |
| i_should_see_elements_in_filemanager ($elementscount, $filemanagerelement) | |
| Makes sure user can see the exact number of elements (files in folders) in the filemanager. | |
| i_should_see_elements_in_filepicker_repository ($expectedcount) | |
| Makes sure user can see the exact number of elements (files and folders) in the repository content area in the file picker. | |
| i_unzip_file_from_filemanager ($filename, $filemanagerelement) | |
| Unzips the specified file from the specified filemanager field. | |
| i_zip_folder_from_filemanager ($foldername, $filemanagerelement) | |
| Zips the specified folder from the specified filemanager field. | |
Public Attributes | |
| const | PAGE_READY_JS |
| The JS code to check that the page is ready. | |
Protected Member Functions | |
| add_file_from_repository_to_filemanager ($filepath, $repository, $filemanagerelement, TableNode $data, $overwriteaction=false) | |
| Picks the file from private files repository. | |
| get_element_in_filepicker_repository ($elementname, $elementtype) | |
| Returns a specific element (file or folder) in the repository content area in the file picker. | |
Steps definitions to deal with the filemanager and filepicker.
|
protected |
Picks the file from private files repository.
| ExpectationException | Thrown by behat_base::find |
| string | $filepath | |
| string | $repository | |
| string | $filemanagerelement | |
| TableNode | $data | Data to fill the form in Select file dialogue |
| false | string | $overwriteaction | false if we don't expect that file with the same name already exists, or button text in overwrite dialogue ("Overwrite", "Rename to ...", "Cancel") |
|
protected |
Returns a specific element (file or folder) in the repository content area in the file picker.
| ExpectationException | Thrown by behat_base::find |
| string | $elementname | The name of the element |
| string | $elementtype | The type of the element ("file" or "folder") |
| NodeElement |
|
inherited |
Returns the Mink session.
| string | null | $name | name of the session OR active session will be used |
| Behat::Mink::Session |
Implemented in behat_form_field.
| behat_filepicker::i_add_and_overwrite_file_from_repository_to_filemanager | ( | $filepath, | |
| $repository, | |||
| $filemanagerelement ) |
Picks the file from repository leaving default values in select file dialogue and confirming to overwrite an existing file.
@When /^I add and overwrite "(?P<filepath_string>(?:[^"]|::")*)" file from "(?P<repository_string>(?:[^"]|")*)" to "(?P<filemanagerelement_string>(?:[^"]|::")*)" filemanager$/
| ExpectationException | Thrown by behat_base::find |
| string | $filepath | |
| string | $repository | |
| string | $filemanagerelement |
| behat_filepicker::i_add_and_overwrite_file_from_repository_to_filemanager_as | ( | $filepath, | |
| $repository, | |||
| $filemanagerelement, | |||
| TableNode | $data ) |
Picks the file from repository confirming to overwrite an existing file.
@When /^I add and overwrite "(?P<filepath_string>(?:[^"]|::")*)" file from "(?P<repository_string>(?:[^"]|")*)" to "(?P<filemanager_field_string>(?:[^"]|::")*)" filemanager as:$/
| ExpectationException | Thrown by behat_base::find |
| string | $filepath | |
| string | $repository | |
| string | $filemanagerelement | |
| TableNode | $data | Data to fill the form in Select file dialogue |
| behat_filepicker::i_add_file_from_repository_to_filemanager | ( | $filepath, | |
| $repository, | |||
| $filemanagerelement ) |
Picks the file from repository leaving default values in select file dialogue.
@When /^I add "(?P<filepath_string>(?:[^"]|::")*)" file from "(?P<repository_string>(?:[^"]|")*)" to "(?P<filemanagerelement_string>(?:[^"]|::")*)" filemanager$/
| ExpectationException | Thrown by behat_base::find |
| string | $filepath | |
| string | $repository | |
| string | $filemanagerelement |
| behat_filepicker::i_add_file_from_repository_to_filemanager_as | ( | $filepath, | |
| $repository, | |||
| $filemanagerelement, | |||
| TableNode | $data ) |
Picks the file from repository filling the form in Select file dialogue.
@When /^I add "(?P<filepath_string>(?:[^"]|::")*)" file from "(?P<repository_string>(?:[^"]|")*)" to "(?P<filemanager_field_string>(?:[^"]|::")*)" filemanager as:$/
| ExpectationException | Thrown by behat_base::find |
| string | $filepath | |
| string | $repository | |
| string | $filemanagerelement | |
| TableNode | $data | Data to fill the form in Select file dialogue |
| behat_filepicker::i_click_on_element_in_filepicker_repository | ( | $elementname, | |
| $elementtype ) |
Clicks on a specific element (file or folder) in the repository content area in the file picker.
@Then /^I click on "(?P<element_name_string>(?:[^"]|::")*)" "(?P<element_type_string>(?:[^"]|")*)" in repository content area$/ @throws ExpectationException Thrown by behat_base::find @param string $elementname The name of the element @param string $elementtype The type of the element ("file" or "folder")
| behat_filepicker::i_create_folder_in_filemanager | ( | $foldername, | |
| $filemanagerelement ) |
Creates a folder with specified name in the current folder and in the specified filemanager field.
@Given /^I create "(?P<foldername_string>(?:[^"]|::")*)" folder in "(?P<filemanager_field_string>(?:[^"]|")*)" filemanager$/
| ExpectationException | Thrown by behat_base::find |
| string | $foldername | |
| string | $filemanagerelement |
| behat_filepicker::i_delete_file_from_filemanager | ( | $name, | |
| $filemanagerelement ) |
Deletes the specified file or folder from the specified filemanager field.
@Given /^I delete "(?P<file_or_folder_name_string>(?:[^"]|::")*)" from "(?P<filemanager_field_string>(?:[^"]|")*)" filemanager$/
| ExpectationException | Thrown by behat_base::find |
| string | $name | |
| string | $filemanagerelement |
| behat_filepicker::i_open_folder_from_filemanager | ( | $foldername, | |
| $filemanagerelement ) |
Opens the contents of a filemanager folder.
It looks for the folder in the current folder and in the path bar.
@Given /^I open "(?P<foldername_string>(?:[^"]|::")*)" folder from "(?P<filemanager_field_string>(?:[^"]|")*)" filemanager$/
| ExpectationException | Thrown by behat_base::find |
| string | $foldername | |
| string | $filemanagerelement |
| behat_filepicker::i_select_filepicker_repository | ( | $repositoryname | ) |
Selects a repository from the repository list in the file picker.
@Then /^I select "(?P<repository_name_string>(?:[^"]|::")*)" repository in file picker$/
| ExpectationException | Thrown by behat_base::find |
| string | $repositoryname |
| behat_filepicker::i_should_see_breadcrumb_navigation_in_filepicker_repository | ( | $breadcrumbs | ) |
Makes sure the user can see a specific breadcrumb navigation structure in the file picker repository.
@Then /^I should see "(?P<breadcrumb_navigation_string>(?:[^"]|::")*)" breadcrumb navigation in repository$/
| ExpectationException | Thrown by behat_base::find |
| string | $breadcrumbs | The breadcrumb navigation structure (ex. "System > Category > Course") |
| behat_filepicker::i_should_see_element_in_filepicker_repository | ( | $elementname, | |
| $elementtype ) |
Makes sure user can see a specific element (file or folder) in the repository content area in the file picker.
@Then /^I should see "(?P<element_name_string>(?:[^"]|::")*)" "(?P<element_type_string>(?:[^"]|")*)" in repository content area$/ @throws ExpectationException Thrown by behat_base::find @param string $elementname The name of the element @param string $elementtype The type of the element ("file" or "folder")
| behat_filepicker::i_should_see_elements_in_filemanager | ( | $elementscount, | |
| $filemanagerelement ) |
Makes sure user can see the exact number of elements (files in folders) in the filemanager.
@Then /^I should see "(?P<elementscount_number>::d+)" elements in "(?P<filemanagerelement_string>(?:[^"]|")*)" filemanager$/
| ExpectationException | Thrown by behat_base::find |
| int | $elementscount | |
| string | $filemanagerelement |
| behat_filepicker::i_should_see_elements_in_filepicker_repository | ( | $expectedcount | ) |
Makes sure user can see the exact number of elements (files and folders) in the repository content area in the file picker.
@Then /^I should see "(?P<elements_number>::d+)" elements in repository content area$/
| ExpectationException | Thrown by behat_base::find_all |
| int | $expectedcount |
| behat_filepicker::i_unzip_file_from_filemanager | ( | $filename, | |
| $filemanagerelement ) |
Unzips the specified file from the specified filemanager field.
The zip file has to be visible in the current folder.
@Given /^I unzip "(?P<filename_string>(?:[^"]|::")*)" file from "(?P<filemanager_field_string>(?:[^"]|")*)" filemanager$/
| ExpectationException | Thrown by behat_base::find |
| string | $filename | |
| string | $filemanagerelement |
| behat_filepicker::i_zip_folder_from_filemanager | ( | $foldername, | |
| $filemanagerelement ) |
Zips the specified folder from the specified filemanager field.
The folder has to be in the current folder.
@Given /^I zip "(?P<filename_string>(?:[^"]|::")*)" folder from "(?P<filemanager_field_string>(?:[^"]|")*)" filemanager$/
| ExpectationException | Thrown by behat_base::find |
| string | $foldername | |
| string | $filemanagerelement |
|
inherited |
The JS code to check that the page is ready.
The document must be complete and either M.util.pending_js must be empty, or it must not be defined at all.