Skip to content

Commit

Permalink
add test coverage for audio, location, image and photo props
Browse files Browse the repository at this point in the history
add audio test file

add test file with location, image and photo metadata
  • Loading branch information
Salipa-Gurung committed Jul 1, 2024
1 parent 176c99b commit 807a543
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ default:
- TUSContext:
- OcisConfigContext:
- SharingNgContext:
- WebDavPropertiesContext:

apiReshare:
paths:
Expand Down
36 changes: 36 additions & 0 deletions tests/acceptance/features/apiSearchContent/contentSearch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,39 @@ Feature: content search
| old |
| new |
| spaces |


Scenario: check extracted properties of a file from project space
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has uploaded a file "filesForUpload/testimage.mp3" to "testimage.mp3" in space "new-space"
And user "Alice" has uploaded a file "filesForUpload/testavatar.jpg" to "testavatar.jpg" in space "new-space"
When user "Alice" gets the following extracted properties of resource "testimage.mp3" inside space "new-space" using the WebDAV API
| propertyName |
| oc:audio |
Then the HTTP status code should be "207"
And the "PROPFIND" response should contain a space "new-space" with these key and value pairs:
| key | value |
| oc:audio/oc:album | ALBUM1234567890123456789012345 |
| oc:audio/oc:artist | ARTIST123456789012345678901234 |
| oc:audio/oc:genre | Pop |
| oc:audio/oc:title | TITLE1234567890123456789012345 |
| oc:audio/oc:track | 1 |
| oc:audio/oc:year | 2001 |
When user "Alice" gets the following extracted properties of resource "testavatar.jpg" inside space "new-space" using the WebDAV API
| propertyName |
| oc:image |
| oc:location |
| oc:photo |
Then the HTTP status code should be "207"
And the "PROPFIND" response should contain a space "new-space" with these key and value pairs:
| key | value |
| oc:image/oc:width | 640 |
| oc:image/oc:height | 480 |
| oc:location/oc:latitude | 43.467157 |
| oc:location/oc:longitude | 11.885395 |
| oc:photo/oc:camera-make | NIKON |
| oc:photo/oc:camera-model | COOLPIX P6000 |
| oc:photo/oc:f-number | 4.5 |
| oc:photo/oc:focal-length | 6 |
26 changes: 26 additions & 0 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -3510,6 +3510,32 @@ public function userGetsTheFollowingPropertiesOfFileInsideSpaceUsingTheWebdavApi
$this->featureContext->setResponse($response);
}

/**
* @When /^user "([^"]*)" gets the following extracted properties of (?:file|folder|entry|resource) "([^"]*)" inside space "([^"]*)" using the WebDAV API$/
*
* @param string $user
* @param string $resourceName
* @param string $spaceName
* @param TableNode|null $propertiesTable
*
* @return void
*
* @throws Exception|GuzzleException
*/
public function userGetsTheFollowingExtractedPropertiesOfFileInsideSpaceUsingTheWebdavApi(
string $user,
string $resourceName,
string $spaceName,
TableNode $propertiesTable
):void {
// NOTE: extracting properties occurs asynchronously
// short wait is necessary before getting those properties
sleep(2);
$this->setSpaceIDByName($user, $spaceName);
$response = $this->webDavPropertiesContext->getPropertiesOfFolder($user, $resourceName, $propertiesTable);
$this->featureContext->setResponse($response);
}

/**
* @Then /^as user "([^"]*)" (?:file|folder|entry|resource) "([^"]*)" inside space "([^"]*)" should contain a property "([^"]*)" with value "([^"]*)"$/
*
Expand Down
Binary file modified tests/acceptance/filesForUpload/testavatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/acceptance/filesForUpload/testimage.mp3
Binary file not shown.

0 comments on commit 807a543

Please sign in to comment.