Skip to content

Commit

Permalink
[Tests-only] Adjust public link tests
Browse files Browse the repository at this point in the history
Enabled some tests and tagged others that are not working yet.

In some feature files, the "old" and "new" public webdav API tests were
split into separate scenarios, as OCIS doesn't support the old public
webdav API.
  • Loading branch information
Vincent Petry committed Jun 24, 2020
1 parent 40f6c38 commit cc8730b
Show file tree
Hide file tree
Showing 9 changed files with 519 additions and 156 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @TestAlsoOnExternalUserBackend @public_link_share-feature-required @files_sharing-app-required @skipOnOcis @issue-ocis-reva-49
@api @TestAlsoOnExternalUserBackend @public_link_share-feature-required @files_sharing-app-required @skipOnOcis @issue-ocis-reva-49 @issue-ocis-reva-282
Feature: accessing a public link share

Background:
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @TestAlsoOnExternalUserBackend @public_link_share-feature-required @files_sharing-app-required @skipOnOcis @issue-ocis-reva-49
@api @TestAlsoOnExternalUserBackend @public_link_share-feature-required @files_sharing-app-required @skipOnOcis @issue-ocis-reva-49 @issue-ocis-reva-288 @issue-ocis-reva-252
Feature: multilinksharing

Background:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@api @TestAlsoOnExternalUserBackend @files_sharing-app-required @public_link_share-feature-required @skipOnOcis @issue-ocis-reva-49
@issue-ocis-reva-233 @issue-ocis-reva-243
@api @TestAlsoOnExternalUserBackend @files_sharing-app-required @public_link_share-feature-required @skipOnOcis @issue-ocis-reva-49 @issue-ocis-reva-282
@issue-ocis-reva-233 @issue-ocis-reva-243 @issue-ocis-reva-289
Feature: reshare as public link
As a user
I want to create public link shares from files/folders shared with me
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @TestAlsoOnExternalUserBackend @files_sharing-app-required @public_link_share-feature-required @skipOnOcis @issue-ocis-reva-49
@api @TestAlsoOnExternalUserBackend @files_sharing-app-required @public_link_share-feature-required @skipOnOcis @issue-ocis-reva-252
Feature: update a public link share

Background:
Expand Down

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions tests/acceptance/features/bootstrap/OCSContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,19 +583,22 @@ public function userRequestsTheseEndpointsWithUsingThePasswordOfUser($asUser, $m
* @throws Exception
*/
public function theOCSStatusCodeShouldBe($statusCode, $message = "") {
if ($message === "") {
$message = "OCS status code is not the expected value";
}

$responseStatusCode = $this->getOCSResponseStatusCode(
$this->featureContext->getResponse()
);
if (\is_array($statusCode)) {
if ($message === "") {
$message = "OCS status code is not any of the expected values " . \implode(",", $statusCode) . " got " . $responseStatusCode;
}
Assert::assertContainsEquals(
$responseStatusCode, $statusCode,
$message
);
} else {
if ($message === "") {
$message = "OCS status code is not the expected value " . $statusCode . " got " . $responseStatusCode;
}

Assert::assertEquals(
$statusCode, $responseStatusCode,
$message
Expand Down
3 changes: 2 additions & 1 deletion tests/acceptance/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ public function createShare(
$this->sharingApiVersion
);
$this->lastShareData = $this->getResponseXml();
if ($shareType === 'public_link') {
if ($shareType === 'public_link' && isset($this->lastShareData->data)) {
$linkName = (string) $this->lastShareData->data[0]->name;
$linkUrl = (string) $this->lastShareData->data[0]->url;
$this->addToListOfCreatedPublicLinks($linkName, $linkUrl);
Expand All @@ -929,6 +929,7 @@ public function doesFieldValueMatchExpectedContent(
if (($contentExpected === "ANY_VALUE")
|| (($contentExpected === "A_TOKEN") && (\strlen($value) === 15))
|| (($contentExpected === "A_NUMBER") && \is_numeric($value))
|| (($contentExpected === "A_STRING") && \is_string($value))
|| (($contentExpected === "AN_URL") && $this->isAPublicLinkUrl($value))
|| (($field === 'remote') && (\rtrim($value, "/") === $contentExpected))
|| ($contentExpected === $value)
Expand Down

0 comments on commit cc8730b

Please sign in to comment.