From e76f2eaf8c2793c6d39206984078a3fb163db60a Mon Sep 17 00:00:00 2001 From: Sagar Gurung <46086950+SagarGi@users.noreply.github.com> Date: Thu, 21 Dec 2023 14:09:57 +0545 Subject: [PATCH] [tests-only][full-ci]Added tests for the expirydate with displaName for share link (#8036) * Added tests for the expirydata with displaName for share link * review address --- ...ected-failures-localAPI-on-OCIS-storage.md | 2 + .../features/apiSharingNg/createLink.feature | 158 +++++++++++++++++- 2 files changed, 158 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index ae74e3232..c16582c00 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -258,6 +258,8 @@ The expected failures in this file are from features in the owncloud/ocis repo. ### [blocksDownload link type is not implemented yet (sharing-ng)](https://github.com/owncloud/ocis/issues/7879) - [apiSharingNg/createLink.feature:78](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/createLink.feature#L78) - [apiSharingNg/createLink.feature:147](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/createLink.feature#L147) +- [apiSharingNg/createLink.feature:225](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/createLink.feature#L225) +- [apiSharingNg/createLink.feature:301](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/createLink.feature#L301) - Note: always have an empty line at the end of this file. The bash script that processes this file requires that the last line has a newline on the end. diff --git a/tests/acceptance/features/apiSharingNg/createLink.feature b/tests/acceptance/features/apiSharingNg/createLink.feature index 5eeadb4bd..cd20282f6 100644 --- a/tests/acceptance/features/apiSharingNg/createLink.feature +++ b/tests/acceptance/features/apiSharingNg/createLink.feature @@ -6,7 +6,7 @@ Feature: Create a share link for a resource | username | | Alice | - + @issue-7879 Scenario Outline: create a link share of a folder Given user "Alice" has created folder "folder" When user "Alice" creates the following link share using the Graph API: @@ -77,7 +77,7 @@ Feature: Create a share link for a resource | createOnly | | blocksDownload | - + @issue-7879 Scenario Outline: create a link share of a file Given user "Alice" has uploaded file with content "other data" to "textfile1.txt" When user "Alice" creates the following link share using the Graph API: @@ -145,3 +145,157 @@ Feature: Create a share link for a resource | view | | edit | | blocksDownload | + + @issue-7879 + Scenario Outline: create a link share of a folder with display name and expiry date + Given user "Alice" has created folder "folder" + When user "Alice" creates the following link share using the Graph API: + | resourceType | folder | + | resource | folder | + | space | Personal | + | role | | + | password | %public% | + | displayName | Homework | + | expirationDateTime | 2200-07-15T14:00:00.000Z | + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "hasPassword", + "id", + "link", + "expirationDateTime" + ], + "properties": { + "hasPassword": { + "type": "boolean", + "enum": [true] + }, + "id": { + "type": "string", + "pattern": "^[a-zA-Z]{15}$" + }, + "expirationDateTime": { + "type": "string", + "enum": ["2200-07-15T23:59:59Z"] + }, + "link": { + "type": "object", + "required": [ + "@libre.graph.displayName", + "@libre.graph.quickLink", + "preventsDownload", + "type", + "webUrl" + ], + "properties": { + "@libre.graph.displayName": { + "type": "string", + "enum": ["Homework"] + }, + "@libre.graph.quickLink": { + "type": "boolean", + "enum": [false] + }, + "preventsDownload": { + "type": "boolean", + "enum": [false] + }, + "type": { + "type": "string", + "enum": [""] + }, + "webUrl": { + "type": "string", + "pattern": "^%base_url%\/s\/[a-zA-Z]{15}$" + } + } + } + } + } + """ + Examples: + | role | + | view | + | edit | + | upload | + | createOnly | + | blocksDownload | + + @issue-7879 + Scenario Outline: create a link share of a file with display name and expiry date + Given user "Alice" has uploaded file with content "other data" to "textfile1.txt" + When user "Alice" creates the following link share using the Graph API: + | resourceType | file | + | resource | textfile1.txt | + | space | Personal | + | role | | + | password | %public% | + | displayName | Homework | + | expirationDateTime | 2200-07-15T14:00:00.000Z | + Then the HTTP status code should be "200" + And the JSON data of the response should match + """ + { + "type": "object", + "required": [ + "hasPassword", + "id", + "link", + "expirationDateTime" + ], + "properties": { + "hasPassword": { + "type": "boolean", + "enum": [true] + }, + "id": { + "type": "string", + "pattern": "^[a-zA-Z]{15}$" + }, + "expirationDateTime": { + "type": "string", + "enum": ["2200-07-15T23:59:59Z"] + }, + "link": { + "type": "object", + "required": [ + "@libre.graph.displayName", + "@libre.graph.quickLink", + "preventsDownload", + "type", + "webUrl" + ], + "properties": { + "@libre.graph.displayName": { + "type": "string", + "enum": ["Homework"] + }, + "@libre.graph.quickLink": { + "type": "boolean", + "enum": [false] + }, + "preventsDownload": { + "type": "boolean", + "enum": [false] + }, + "type": { + "type": "string", + "enum": [""] + }, + "webUrl": { + "type": "string", + "pattern": "^%base_url%\/s\/[a-zA-Z]{15}$" + } + } + } + } + } + """ + Examples: + | role | + | view | + | edit | + | blocksDownload |