mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1400 from open-sausages/pulls/4.0/fix-behat
BUG Fix behat tests for asset abstraction
This commit is contained in:
commit
1a8caad950
@ -8,7 +8,7 @@ So that I can link to a external website or a page on my site
|
||||
Given a "page" "Home"
|
||||
And a "page" "About Us" has the "Content" "<p>My awesome content</p>"
|
||||
And a "page" "Details" has the "Content" "<p>My sub-par content<a name="youranchor"></a></p>"
|
||||
And a "file" "assets/file1.jpg"
|
||||
And a "file" "file1.jpg"
|
||||
And I am logged in with "ADMIN" permissions
|
||||
And I go to "/admin/pages"
|
||||
And I click on "About Us" in the tree
|
||||
|
@ -6,8 +6,8 @@ Feature: Insert an image into a page
|
||||
|
||||
Background:
|
||||
Given a "page" "About Us"
|
||||
And a "image" "assets/folder1/file1.jpg"
|
||||
And a "image" "assets/folder1/file2.jpg"
|
||||
And a "image" "folder1/file1.jpg"
|
||||
And a "image" "folder1/file2.jpg"
|
||||
And I am logged in with "ADMIN" permissions
|
||||
And I go to "/admin/pages"
|
||||
And I click on "About Us" in the tree
|
||||
@ -31,7 +31,7 @@ Feature: Insert an image into a page
|
||||
And I attach the file "testfile.jpg" to "AssetUploadField" with HTML5
|
||||
# TODO Delay previous step until upload succeeded
|
||||
And I wait for 2 seconds
|
||||
Then there should be a file "assets/Uploads/59de0c841f/testfile.jpg"
|
||||
Then there should be a filename "Uploads/testfile.jpg" with hash "59de0c841f0da39f1d21ab12cd4fa85b8a91457c"
|
||||
When I press the "Insert" button
|
||||
Then the "Content" HTML field should contain "testfile__Resampled.jpg"
|
||||
# Required to avoid "unsaved changed" browser dialog
|
||||
@ -39,14 +39,14 @@ Feature: Insert an image into a page
|
||||
|
||||
@assets
|
||||
Scenario: I can upload an image from my own computer that matches the name of an existing file
|
||||
Given a "image" "assets/Uploads/file1.jpg"
|
||||
Given a "image" "Uploads/file1.jpg"
|
||||
When I press the "Insert Media" HTML field button
|
||||
And I attach the file "file1.jpg" to "AssetUploadField" with HTML5
|
||||
# TODO Delay previous step until upload succeeded
|
||||
And I wait for 2 seconds
|
||||
# Note change in default behaviour from 3.1, respect default Upload.replaceFile=false
|
||||
Then there should be a file "assets/Uploads/3d0ef6ec37/file1.jpg"
|
||||
And there should be a file "assets/Uploads/3d0ef6ec37/file1-v2.jpg"
|
||||
Then there should be a filename "Uploads/file1.jpg" with hash "3d0ef6ec372233e08e87f6e1f02ace9c93ce11fe"
|
||||
And there should be a filename "Uploads/file1-v2.jpg" with hash "3d0ef6ec372233e08e87f6e1f02ace9c93ce11fe"
|
||||
When I press the "Insert" button
|
||||
Then the "Content" HTML field should contain "file1-v2__Resampled.jpg"
|
||||
# Required to avoid "unsaved changed" browser dialog
|
||||
|
@ -5,9 +5,9 @@ Feature: Manage files
|
||||
So that I can insert them into my content efficiently
|
||||
|
||||
Background:
|
||||
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"
|
||||
And a "folder" "assets/folder2"
|
||||
Given a "image" "folder1/file1.jpg" was created "2012-01-01 12:00:00"
|
||||
And a "image" "folder1/folder1-1/file2.jpg" was created "2010-01-01 12:00:00"
|
||||
And a "folder" "folder2"
|
||||
And I am logged in with "ADMIN" permissions
|
||||
And I go to "/admin/assets"
|
||||
|
||||
@ -41,7 +41,7 @@ Feature: Manage files
|
||||
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
|
||||
And I press the "Archive" button
|
||||
Then the "folder1" table should not contain "file1"
|
||||
|
||||
Scenario: I can change the folder of a file
|
||||
@ -66,7 +66,7 @@ Feature: Manage files
|
||||
And the "Files" table should not contain "file2"
|
||||
|
||||
Scenario: I can filter the files list view using filetype
|
||||
Given a "file" "assets/document.pdf"
|
||||
Given a "file" "document.pdf"
|
||||
And I expand the content filters
|
||||
And I select "Image" from "File type" with javascript
|
||||
And I press the "Search" button
|
||||
|
Loading…
Reference in New Issue
Block a user