Skip to content

Commit

Permalink
tests modified according to ocis responses
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranparajuli589 committed May 21, 2021
1 parent 736f856 commit 5ffc6fe
Showing 1 changed file with 61 additions and 11 deletions.
72 changes: 61 additions & 11 deletions tests/acceptance/features/apiWebdavPreviews/previews.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,22 @@ Feature: previews of files downloaded through the webdav API
Background:
Given user "Alice" has been created with default attributes and without skeleton files

@issue-ocis-200
Scenario Outline: download previews of different sizes
@skipOnOcV10
Scenario Outline: download different sizes of previews of file on ocis
Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
When user "Alice" downloads the preview of "/parent.txt" with width <width> and height <height> using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be <expected-width> pixels wide and <expected-height> pixels high
Examples:
| width | height | expected-width | expected-height |
| 1 | 1 | 16 | 16 |
| 32 | 32 | 32 | 32 |
| 1024 | 1024 | 640 | 480 |
| 1 | 1024 | 16 | 16 |
| 1024 | 1 | 640 | 480 |

@skipOnOcis
Scenario Outline: download different sizes of previews of file
Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
When user "Alice" downloads the preview of "/parent.txt" with width <width> and height <height> using the WebDAV API
Then the HTTP status code should be "200"
Expand Down Expand Up @@ -52,15 +66,15 @@ Feature: previews of files downloaded through the webdav API
| A |
| %2F |

@issue-ocis-200

Scenario: download previews of files inside sub-folders
Given user "Alice" has created folder "subfolder"
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/subfolder/parent.txt"
When user "Alice" downloads the preview of "/subfolder/parent.txt" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be "32" pixels wide and "32" pixels high

@issue-ocis-189

Scenario Outline: download previews of file types that don't support preview
Given user "Alice" has uploaded file "filesForUpload/<filename>" to "/<newfilename>"
When user "Alice" downloads the preview of "/<newfilename>" with width "32" and height "32" using the WebDAV API
Expand All @@ -72,7 +86,7 @@ Feature: previews of files downloaded through the webdav API
| simple.odt | test.odt |
| new-data.zip | test.zip |

@issue-ocis-187

Scenario Outline: download previews of different image file types
Given user "Alice" has uploaded file "filesForUpload/<imageName>" to "/<newImageName>"
When user "Alice" downloads the preview of "/<newImageName>" with width "32" and height "32" using the WebDAV API
Expand All @@ -83,15 +97,14 @@ Feature: previews of files downloaded through the webdav API
| testavatar.jpg | testimage.jpg |
| testavatar.png | testimage.png |

@issue-ocis-187

Scenario: download previews of image after renaming it
Given user "Alice" has uploaded file "filesForUpload/testavatar.jpg" to "/testimage.jpg"
When user "Alice" moves file "/testimage.jpg" to "/testimage.txt" using the WebDAV API
And user "Alice" downloads the preview of "/testimage.txt" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be "32" pixels wide and "32" pixels high

@issue-ocis-68
Scenario: download previews of shared files
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
Expand All @@ -100,7 +113,16 @@ Feature: previews of files downloaded through the webdav API
Then the HTTP status code should be "200"
And the downloaded image should be "32" pixels wide and "32" pixels high

@issue-ocis-thumbnails-191
@skipOnOcV10
Scenario: download previews of other users files
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
When user "Brian" downloads the preview of "/parent.txt" of "Alice" with width "32" and height "32" using the WebDAV API
Then the HTTP status code should be "404"
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "File with name parent.txt could not be located"
And the value of the item "/d:error/s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"

@skipOnOcis
Scenario: download previews of other users files
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
Expand All @@ -109,7 +131,7 @@ Feature: previews of files downloaded through the webdav API
And the value of the item "/d:error/s:message" in the response about user "Alice" should be "File not found: parent.txt in '%username%'"
And the value of the item "/d:error/s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\NotFound"

@skipOnOcV10.3 @skipOnOcV10.4.0 @issue-ocis-190
@skipOnOcV10.3 @skipOnOcV10.4.0 @issue-ocis-2064
Scenario: download previews of folders
Given user "Alice" has created folder "subfolder"
When user "Alice" downloads the preview of "/subfolder/" with width "32" and height "32" using the WebDAV API
Expand Down Expand Up @@ -150,7 +172,7 @@ Feature: previews of files downloaded through the webdav API
Then the HTTP status code should be "400"
And the value of the item "/d:error/s:exception" in the response about user "Alice" should be "Sabre\DAV\Exception\BadRequest"

@issue-ocis-200
@skipOnOcis
Scenario Outline: download previews of different size smaller than the maximum size set
Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
And the administrator has updated system config key "preview_max_x" with value "32"
Expand All @@ -165,7 +187,22 @@ Feature: previews of files downloaded through the webdav API
| 32 | 12 | 200 |
| 12 | 32 | 200 |

@issue-ocis-200
@skipOnOcV10
Scenario Outline: download previews of different size smaller than the maximum size set on ocis
Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
And the administrator has updated system config key "preview_max_x" with value "32"
And the administrator has updated system config key "preview_max_y" with value "32"
When user "Alice" downloads the preview of "/parent.txt" with width "<width>" and height "<height>" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be "<expected-width>" pixels wide and "<expected-height>" pixels high
Examples:
| width | height | expected-width | expected-height |
| 32 | 32 | 32 | 32 |
| 12 | 12 | 32 | 32 |
| 32 | 12 | 32 | 32 |
| 12 | 32 | 32 | 32 |

@skipOnOcis
Scenario Outline: download previews of different size larger than the maximum size set
Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
And the administrator has updated system config key "preview_max_x" with value "32"
Expand All @@ -177,3 +214,16 @@ Feature: previews of files downloaded through the webdav API
| width | height | http-code |
| 64 | 64 | 200 |
| 2048 | 2048 | 200 |

@skipOnOcV10
Scenario Outline: download previews of different size larger than the maximum size set
Given user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/parent.txt"
And the administrator has updated system config key "preview_max_x" with value "32"
And the administrator has updated system config key "preview_max_y" with value "32"
When user "Alice" downloads the preview of "/parent.txt" with width "<width>" and height "<height>" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded image should be "<expected-width>" pixels wide and "<expected-height>" pixels high
Examples:
| width | height | expected-width | expected-height |
| 64 | 64 | 32 | 32 |
| 2048 | 2048 | 640 | 480 |

0 comments on commit 5ffc6fe

Please sign in to comment.