2013-10-08 11:20:50 +02:00
|
|
|
@javascript @assets
|
|
|
|
Feature: Manage files
|
|
|
|
As a cms author
|
|
|
|
I want to upload and manage files within the CMS
|
|
|
|
So that I can insert them into my content efficiently
|
|
|
|
|
|
|
|
Background:
|
2014-04-11 07:49:17 +02:00
|
|
|
Given a "image" "assets/folder1/file1.jpg" was created "2012-01-01 12:00:00"
|
|
|
|
And a "image" "assets/folder1/folder1.1/file2.jpg" was created "2010-01-01 12:00:00"
|
2013-10-08 11:20:50 +02:00
|
|
|
And a "folder" "assets/folder2"
|
|
|
|
And I am logged in with "ADMIN" permissions
|
|
|
|
And I go to "/admin/assets"
|
|
|
|
|
|
|
|
@modal
|
|
|
|
Scenario: I can add a new folder
|
|
|
|
Given I press the "Add folder" button
|
|
|
|
And I type "newfolder" into the dialog
|
|
|
|
And I confirm the dialog
|
|
|
|
Then the "Files" table should contain "newfolder"
|
|
|
|
|
|
|
|
Scenario: I can list files in a folder
|
|
|
|
Given I click on "folder1" in the "Files" table
|
|
|
|
Then the "folder1" table should contain "file1"
|
|
|
|
And the "folder1" table should not contain "file1.1"
|
|
|
|
|
|
|
|
Scenario: I can upload a file to a folder
|
|
|
|
Given I click on "folder1" in the "Files" table
|
|
|
|
And I press the "Upload" button
|
|
|
|
And I attach the file "testfile.jpg" to "AssetUploadField" with HTML5
|
|
|
|
And I wait for 5 seconds
|
|
|
|
And I press the "Back to folder" button
|
|
|
|
Then the "folder1" table should contain "testfile"
|
|
|
|
|
|
|
|
Scenario: I can edit a file
|
|
|
|
Given I click on "folder1" in the "Files" table
|
|
|
|
And I click on "file1" in the "folder1" table
|
|
|
|
And I fill in "renamedfile" for "Title"
|
|
|
|
And I press the "Save" button
|
2015-06-26 02:48:29 +02:00
|
|
|
And I follow "folder1"
|
2013-10-08 11:20:50 +02:00
|
|
|
Then the "folder1" table should not contain "testfile"
|
|
|
|
And the "folder1" table should contain "renamedfile"
|
|
|
|
|
|
|
|
Scenario: I can delete a file
|
|
|
|
Given I click on "folder1" in the "Files" table
|
|
|
|
And I click on "file1" in the "folder1" table
|
|
|
|
And I press the "Delete" button, confirming the dialog
|
|
|
|
Then the "folder1" table should not contain "file1"
|
|
|
|
|
|
|
|
Scenario: I can change the folder of a file
|
|
|
|
Given I click on "folder1" in the "Files" table
|
|
|
|
And I click on "file1" in the "folder1" table
|
|
|
|
And I fill in "folder2" for the "Folder" dropdown
|
|
|
|
And I press the "Save" button
|
|
|
|
# /show/0 is to ensure that we are on top level folder
|
|
|
|
And I go to "/admin/assets/show/0"
|
|
|
|
And I click on "folder2" in the "Files" table
|
|
|
|
And the "folder2" table should contain "file1"
|
|
|
|
|
|
|
|
Scenario: I can see allowed extensions help
|
|
|
|
When I go to "/admin/assets/add"
|
|
|
|
And I follow "Show allowed extensions"
|
|
|
|
Then I should see "png,"
|
2014-02-17 22:23:51 +01:00
|
|
|
|
|
|
|
Scenario: I can filter the files list view using name
|
2015-06-16 00:49:19 +02:00
|
|
|
Given I expand the content filters
|
2014-02-17 22:23:51 +01:00
|
|
|
And I fill in "Name" with "file1"
|
2015-06-16 00:49:19 +02:00
|
|
|
And I press the "Search" button
|
2014-03-17 20:56:41 +01:00
|
|
|
Then the "Files" table should contain "file1"
|
|
|
|
And the "Files" table should not contain "file2"
|
2014-02-17 22:23:51 +01:00
|
|
|
|
|
|
|
Scenario: I can filter the files list view using filetype
|
|
|
|
Given a "file" "assets/document.pdf"
|
2015-06-16 00:49:19 +02:00
|
|
|
And I expand the content filters
|
2014-05-30 04:44:35 +02:00
|
|
|
And I select "Image" from "File type" with javascript
|
2015-06-16 00:49:19 +02:00
|
|
|
And I press the "Search" button
|
2014-03-17 20:56:41 +01:00
|
|
|
Then the "Files" table should contain "file1"
|
|
|
|
And the "Files" table should not contain "document"
|
2014-04-11 07:49:17 +02:00
|
|
|
|
|
|
|
Scenario: I can filter out files that don't match the date range
|
2015-06-16 00:49:19 +02:00
|
|
|
Given I expand the content filters
|
2014-04-11 07:49:17 +02:00
|
|
|
And I fill in "From" with "2003-01-01"
|
|
|
|
And I fill in "To" with "2011-01-01"
|
2015-06-16 00:49:19 +02:00
|
|
|
And I press the "Search" button
|
2014-04-11 07:49:17 +02:00
|
|
|
And the "Files" table should contain "file2"
|
|
|
|
And the "Files" table should not contain "file1"
|