Skip to content

Commit

Permalink
Merge pull request #38827 from owncloud/update-tests
Browse files Browse the repository at this point in the history
[Tests-Only] update test scenarios to work with ocis
  • Loading branch information
phil-davis authored Jun 14, 2021
2 parents 34037bd + 9a1a142 commit 1a65c41
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 69 deletions.
8 changes: 4 additions & 4 deletions tests/TestHelpers/Asserts/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ public static function assertContentOfRemoteAndLocalFileIsSame(
$password,
$remoteFile
);

$localContent = \file_get_contents($localFile);
$downloadedContent = $result->getBody()->getContents();

if ($shouldBeSame) {
self::assertSame(
$localContent,
Expand Down Expand Up @@ -170,14 +170,14 @@ public static function assertContentOfDAVFileAndSkeletonFileOnSUT(
$remoteFile
);
$downloadedContent = $result->getBody()->getContents();

$localContent = SetupHelper::readSkeletonFile(
$fileInSkeletonFolder,
$baseUrl,
$adminUsername,
$adminPassword
);

if ($shouldBeSame) {
self::assertSame(
$localContent,
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ default:
contexts:
- FeatureContext: *common_feature_context_params
- LoggingContext:
- OccContext:
- WebDavPropertiesContext:
- AppConfigurationContext:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@api @notToImplementOnOCIS
Feature: checksums

Background:
Given user "Alice" has been created with default attributes and without skeleton files

# this is a bug demo scenario for https://github.com/owncloud/core/issues/38835
# Once this scenario is fixed Delete this file and remove @skipOnOcV10 tag from tests/acceptance/features/apiMain/checksums.feature:132
@files_sharing-app-required
Scenario: Sharing and modifying a file should return correct checksum in the propfind using new DAV path
Given the administrator has set the default folder for received shares to "Shares"
And auto-accept shares has been disabled
And using new DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When user "Alice" shares file "/myChecksumFile.txt" with user "Brian" using the sharing API
And user "Brian" accepts share "/myChecksumFile.txt" offered by user "Alice" using the sharing API
And user "Brian" uploads file with checksum "SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399" and content "Some Text" to "/Shares/myChecksumFile.txt" using the WebDAV API
And user "Brian" requests the checksum of "/Shares/myChecksumFile.txt" via propfind
Then the webdav checksum should be empty
16 changes: 11 additions & 5 deletions tests/acceptance/features/apiMain/checksums.feature
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,27 @@ Feature: checksums
@files_sharing-app-required
@issue-ocis-reva-196
Scenario: Sharing a file with checksum should return the checksum in the propfind using new DAV path
Given using new DAV path
Given the administrator has set the default folder for received shares to "Shares"
And auto-accept shares has been disabled
And using new DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When user "Alice" shares file "/myChecksumFile.txt" with user "Brian" using the sharing API
And user "Brian" requests the checksum of "/myChecksumFile.txt" via propfind
And user "Brian" accepts share "/myChecksumFile.txt" offered by user "Alice" using the sharing API
And user "Brian" requests the checksum of "/Shares/myChecksumFile.txt" via propfind
Then the webdav checksum should match "SHA1:3ee962b839762adb0ad8ba6023a4690be478de6f MD5:d70b40f177b14b470d1756a3c12b963a ADLER32:8ae90960"

@files_sharing-app-required
@issue-ocis-reva-196
@issue-ocis-reva-196 @skipOnOcV10
Scenario: Sharing and modifying a file should return correct checksum in the propfind using new DAV path
Given using new DAV path
Given the administrator has set the default folder for received shares to "Shares"
And auto-accept shares has been disabled
And using new DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/myChecksumFile.txt" with checksum "MD5:d70b40f177b14b470d1756a3c12b963a"
When user "Alice" shares file "/myChecksumFile.txt" with user "Brian" using the sharing API
And user "Brian" uploads file with checksum "SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399" and content "Some Text" to "/myChecksumFile.txt" using the WebDAV API
And user "Brian" accepts share "/myChecksumFile.txt" offered by user "Alice" using the sharing API
And user "Brian" uploads file with checksum "SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399" and content "Some Text" to "/Shares/myChecksumFile.txt" using the WebDAV API
Then as user "Alice" the webdav checksum of "/myChecksumFile.txt" via propfind should match "SHA1:ce5582148c6f0c1282335b87df5ed4be4b781399 MD5:56e57920c3c8c727bfe7a5288cdf61c4 ADLER32:1048035a"

@issue-ocis-reva-56
Expand Down
Loading

0 comments on commit 1a65c41

Please sign in to comment.