This repository has been archived by the owner on Jan 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cf71f0
commit 54a7c10
Showing
10 changed files
with
237 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "owncloud/ocis-reva", | ||
"config" : { | ||
"platform": { | ||
"php": "7.2" | ||
} | ||
}, | ||
"require": { | ||
}, | ||
"require-dev": { | ||
"bamarni/composer-bin-plugin": "^1.4" | ||
}, | ||
"extra": { | ||
"bamarni-bin": { | ||
"bin-links": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
default: | ||
autoload: | ||
'': '%paths.base%/../features/bootstrap' | ||
|
||
suites: | ||
apiSpecial1: | ||
paths: | ||
- '%paths.base%/../features/apiSpecial1' | ||
contexts: | ||
- RevaContext: | ||
- OccContext: | ||
- FeatureContext: &common_feature_context_params | ||
baseUrl: http://localhost:8080 | ||
adminUsername: admin | ||
adminPassword: admin | ||
regularUserPassword: 123456 | ||
ocPath: apps/testing/api/v1/occ | ||
|
||
apiSpecial2: | ||
paths: | ||
- '%paths.base%/../features/apiSpecial2' | ||
contexts: | ||
- RevaContext: | ||
- OccContext: | ||
- FeatureContext: *common_feature_context_params | ||
- FavoritesContext: | ||
- WebDavPropertiesContext: | ||
|
||
extensions: | ||
jarnaiz\JUnitFormatter\JUnitFormatterExtension: | ||
filename: report.xml | ||
outputDir: '%paths.base%/../output/' |
31 changes: 31 additions & 0 deletions
31
tests/acceptance/features/apiSpecial1/ocsDELETEAuth.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@api | ||
Feature: auth | ||
|
||
Background: | ||
Given user "another-admin" has been created with default attributes and without skeleton files | ||
And user "another-admin" has been added to group "admin" | ||
|
||
@issue-ocis-reva-30 @issue-ocis-reva-65 | ||
#after fixing all issues delete this Scenario and use the core scenario | ||
Scenario: send DELETE requests to OCS endpoints as admin with wrong password | ||
When user "another-admin" requests these endpoints with "DELETE" using password "invalid" about user "Alice" | ||
| endpoint | | ||
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/123 | | ||
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/123 | | ||
| /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/123 | | ||
| /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/123 | | ||
| /ocs/v2.php/apps/files_sharing/api/v1/shares/123 | | ||
| /ocs/v1.php/apps/files_sharing/api/v1/shares/pending/123 | | ||
| /ocs/v2.php/apps/files_sharing/api/v1/shares/pending/123 | | ||
| /ocs/v1.php/cloud/apps/testing | | ||
| /ocs/v2.php/cloud/apps/testing | | ||
| /ocs/v1.php/cloud/groups/group1 | | ||
| /ocs/v2.php/cloud/groups/group1 | | ||
| /ocs/v1.php/cloud/users/%username% | | ||
| /ocs/v2.php/cloud/users/%username% | | ||
| /ocs/v1.php/cloud/users/%username%/groups | | ||
| /ocs/v2.php/cloud/users/%username%/groups | | ||
| /ocs/v1.php/cloud/users/%username%/subadmins | | ||
| /ocs/v2.php/cloud/users/%username%/subadmins | | ||
Then the HTTP status code of responses on all endpoints should be "401" | ||
And the OCS status code of responses on all endpoints should be "notset" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@api | ||
Feature: favorite | ||
|
||
Background: | ||
Given using OCS API version "1" | ||
And user "Alice" has been created with default attributes and without skeleton files | ||
And user "Alice" has uploaded file with content "some data" to "/textfile0.txt" | ||
And user "Alice" has uploaded file with content "some data" to "/textfile1.txt" | ||
And user "Alice" has uploaded file with content "some data" to "/textfile2.txt" | ||
And user "Alice" has uploaded file with content "some data" to "/textfile3.txt" | ||
And user "Alice" has uploaded file with content "some data" to "/textfile4.txt" | ||
And user "Alice" has created folder "/FOLDER" | ||
And user "Alice" has created folder "/PARENT" | ||
And user "Alice" has uploaded file with content "some data" to "/PARENT/parent.txt" | ||
|
||
@skipOnOcis-OC-Storage @issue-ocis-reva-276 | ||
#after fixing the issues delete this Scenario and use the core scenario | ||
Scenario Outline: Favorite a folder | ||
Given using <dav_version> DAV path | ||
When user "Alice" favorites element "/FOLDER" using the WebDAV API | ||
Then the HTTP status code should be "500" | ||
Examples: | ||
| dav_version | | ||
| old | | ||
| new | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
use Behat\Behat\Context\Context; | ||
use Behat\Behat\Hook\Scope\AfterScenarioScope; | ||
use Behat\Behat\Hook\Scope\BeforeScenarioScope; | ||
use PHPUnit\Framework\Assert; | ||
use TestHelpers\AppConfigHelper; | ||
use TestHelpers\SetupHelper; | ||
|
||
require_once 'bootstrap.php'; | ||
|
||
/** | ||
* Context for Reva specific steps | ||
*/ | ||
class RevaContext implements Context { | ||
|
||
/** | ||
* @var FeatureContext | ||
*/ | ||
private $featureContext; | ||
|
||
/** | ||
* @BeforeScenario | ||
* | ||
* @param BeforeScenarioScope $scope | ||
* | ||
* @return void | ||
* @throws Exception | ||
*/ | ||
public function setUpScenario(BeforeScenarioScope $scope) { | ||
// Get the environment | ||
$environment = $scope->getEnvironment(); | ||
// Get all the contexts you need in this context | ||
$this->featureContext = $environment->getContext('FeatureContext'); | ||
SetupHelper::init( | ||
$this->featureContext->getAdminUsername(), | ||
$this->featureContext->getAdminPassword(), | ||
$this->featureContext->getBaseUrl(), | ||
$this->featureContext->getOcPath() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
$pathToCore = \getenv('PATH_TO_CORE'); | ||
if ($pathToCore === false) { | ||
$pathToCore = "../core"; | ||
} | ||
|
||
require_once $pathToCore . '/tests/acceptance/features/bootstrap/bootstrap.php'; | ||
|
||
$classLoader = new \Composer\Autoload\ClassLoader(); | ||
$classLoader->addPsr4( | ||
"", $pathToCore . "/tests/acceptance/features/bootstrap", true | ||
); | ||
|
||
$classLoader->register(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"config" : { | ||
"platform": { | ||
"php": "7.2" | ||
} | ||
}, | ||
"require": { | ||
"behat/behat": "^3.6", | ||
"behat/mink": "1.7.1", | ||
"behat/mink-extension": "^2.3", | ||
"behat/mink-goutte-driver": "^1.2", | ||
"behat/mink-selenium2-driver": "^1.4", | ||
"jarnaiz/behat-junit-formatter": "^1.3", | ||
"rdx/behat-variables": "^1.2", | ||
"sensiolabs/behat-page-object-extension": "^2.3", | ||
"symfony/translation": "^4.4", | ||
"sabre/xml": "^2.2", | ||
"guzzlehttp/guzzle": "^6.5", | ||
"phpunit/phpunit": "^8.5" | ||
} | ||
} |