mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-38950 behat: New tests
According to MDLQA-1765, a selected file can be cancelled. Also adding a test for repository_recent.
This commit is contained in:
parent
a2fd9c6fe4
commit
3d7848c584
2 changed files with 62 additions and 0 deletions
28
repository/recent/tests/behat/add_recent.feature
Normal file
28
repository/recent/tests/behat/add_recent.feature
Normal file
|
@ -0,0 +1,28 @@
|
|||
@repository_recent @_only_local
|
||||
Feature: Recent files repository lists the recently used files
|
||||
In order to save time when selecting files
|
||||
As a moodle user
|
||||
I need to use again the files I've just used
|
||||
|
||||
@javascript
|
||||
Scenario: Add files recently uploaded
|
||||
Given the following "courses" exists:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And I log in as "admin"
|
||||
And I expand "My profile" node
|
||||
And I follow "My private files"
|
||||
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filepicker
|
||||
And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filepicker
|
||||
And I press "Save changes"
|
||||
And I am on homepage
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
When I add a "Folder" to section "1"
|
||||
And I fill the moodle form with:
|
||||
| Name | Folder name |
|
||||
| Description | Folder description |
|
||||
And I add "empty.txt" file from recent files to "Files" filepicker
|
||||
And I press "Save and display"
|
||||
Then I should see "empty.txt"
|
||||
And I should see "Folder description"
|
34
repository/tests/behat/cancel_add_file.feature
Normal file
34
repository/tests/behat/cancel_add_file.feature
Normal file
|
@ -0,0 +1,34 @@
|
|||
@repository @_only_local
|
||||
Feature: A selected file can be cancelled
|
||||
In order to refine the file manager contents
|
||||
As a moodle user
|
||||
I need to cancel a selected file
|
||||
|
||||
@javascript
|
||||
Scenario: Cancel a selected recent file from being added to a folder
|
||||
Given the following "courses" exists:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And I log in as "admin"
|
||||
And I expand "My profile" node
|
||||
And I follow "My private files"
|
||||
And I upload "lib/tests/fixtures/empty.txt" file to "Files" filepicker
|
||||
And I press "Save changes"
|
||||
And I am on homepage
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
When I add a "Folder" to section "1"
|
||||
And I fill the moodle form with:
|
||||
| Name | Folder name |
|
||||
| Description | Folder description |
|
||||
And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filepicker
|
||||
And I click on "#fitem_id_files .fp-btn-add a" "css_element"
|
||||
And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
|
||||
And I click on "//a[contains(concat(' ', @class, ' '), ' fp-file ')][contains(., 'empty.txt')]" "xpath_element"
|
||||
And I wait "2" seconds
|
||||
And I click on ".fp-select .fp-select-cancel" "css_element"
|
||||
And I click on ".file-picker button.yui3-button-close" "css_element"
|
||||
And I press "Save and display"
|
||||
Then I should see "upload_users.csv"
|
||||
And I should not see "empty.txt"
|
||||
And I should see "Folder description"
|
Loading…
Add table
Add a link
Reference in a new issue