Skip to content

Commit

Permalink
Merge pull request #40392 from owncloud/refactorExpectedFailureClosed…
Browse files Browse the repository at this point in the history
…Issue

[tests-only][full-ci]Refactor closed issue related scenarios
  • Loading branch information
SwikritiT authored Oct 18, 2022
2 parents 832d043 + eab5338 commit f969b50
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
7 changes: 6 additions & 1 deletion tests/acceptance/features/apiMain/main.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ Feature: Other tests related to api
Scenario: robots.txt file should be accessible
When a user requests "/robots.txt" with "GET" and no authentication
Then the HTTP status code should be "200"
And the content in the response should match with the content of file "robots.txt" in the server root
And the content in the response should match the following content:
"""
User-agent: *
Disallow: /
"""
14 changes: 0 additions & 14 deletions tests/acceptance/features/apiWebdavOperations/listFiles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,6 @@ Feature: list files
| dav_version |
| new |

@skipOnOcV10 @personalSpace
Examples:
| dav_version |
| spaces |


Scenario Outline: Get the list of resources in a folder shared through public link with depth 1
Given using <dav_version> DAV path
Expand Down Expand Up @@ -250,10 +245,6 @@ Feature: list files
| dav_version |
| new |

@skipOnOcV10 @personalSpace
Examples:
| dav_version |
| spaces |

@depthInfinityPropfindEnabled
Scenario Outline: Get the list of resources in a folder shared through public link with depth infinity
Expand Down Expand Up @@ -287,11 +278,6 @@ Feature: list files
| dav_version |
| new |

@skipOnOcV10 @personalSpace
Examples:
| dav_version |
| spaces |


Scenario Outline: Get the list of files in the trashbin with depth 0
Given using <dav_version> DAV path
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2841,7 +2841,7 @@ public function readFileInServerRootForOCIS(string $path):string {
$pathToOcis = \getenv("PATH_TO_OCIS");
$targetFile = \rtrim($pathToOcis, "/") . "/" . "services/web/assets" . "/" . ltrim($path, '/');
if (!\file_exists($targetFile)) {
throw new Exception('Target File' . $targetFile . 'could not be found');
throw new Exception('Target File ' . $targetFile . ' could not be found');
}
return \file_get_contents($targetFile);
}
Expand Down
3 changes: 2 additions & 1 deletion tests/acceptance/features/bootstrap/SearchContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ public function fileOrFolderInTheSearchResultShouldContainProperties(
$properties = $properties->getHash();
$fileResult = $this->featureContext->findEntryFromPropfindResponse(
$path,
$user
$user,
"REPORT",
);
Assert::assertNotFalse(
$fileResult,
Expand Down
13 changes: 12 additions & 1 deletion tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -1182,10 +1182,21 @@ public function checkDownloadedContentMatches(
Assert::assertEquals(
$expectedContent,
$actualContent,
$extraErrorText . "The downloaded content was expected to be '$expectedContent', but actually is '$actualContent'. HTTP status was $actualStatus"
$extraErrorText . "The content was expected to be '$expectedContent', but actually is '$actualContent'. HTTP status was $actualStatus"
);
}

/**
* @Then the content in the response should match the following content:
*
* @param PyStringNode $content
*
* @return void
*/
public function theContentInTheResponseShouldMatchTheFollowingContent(PyStringNode $content): void {
$this->checkDownloadedContentMatches($content->getRaw());
}

/**
* @Then /^if the HTTP status code was "([^"]*)" then the downloaded content for multipart byterange should be:$/
*
Expand Down

0 comments on commit f969b50

Please sign in to comment.