From ca76f79be3e08b0b926f4b7aec234c49a37d1739 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Tue, 8 Oct 2024 12:26:40 +0545 Subject: [PATCH] test: get necessary contexts properly --- tests/acceptance/TestHelpers/BehatHelper.php | 54 +++++++++++++++ .../acceptance/bootstrap/ArchiverContext.php | 11 +--- tests/acceptance/bootstrap/AuthContext.php | 20 ++---- .../bootstrap/CapabilitiesContext.php | 3 +- .../acceptance/bootstrap/ChecksumContext.php | 5 +- tests/acceptance/bootstrap/CliContext.php | 9 +-- .../bootstrap/CollaborationContext.php | 5 +- .../acceptance/bootstrap/FavoritesContext.php | 7 +- tests/acceptance/bootstrap/FeatureContext.php | 36 +++------- .../bootstrap/FilesVersionsContext.php | 5 +- tests/acceptance/bootstrap/GraphContext.php | 9 ++- .../bootstrap/NotificationContext.php | 21 +++--- tests/acceptance/bootstrap/OCSContext.php | 3 +- tests/acceptance/bootstrap/OcmContext.php | 7 +- .../bootstrap/PublicWebDavContext.php | 7 +- tests/acceptance/bootstrap/SearchContext.php | 3 +- .../acceptance/bootstrap/SettingsContext.php | 23 ++++--- tests/acceptance/bootstrap/ShareesContext.php | 5 +- .../acceptance/bootstrap/SharingNgContext.php | 12 ++-- tests/acceptance/bootstrap/SpacesContext.php | 65 ++++++++----------- .../acceptance/bootstrap/SpacesTUSContext.php | 9 +-- tests/acceptance/bootstrap/TUSContext.php | 9 +-- tests/acceptance/bootstrap/TagContext.php | 7 +- .../acceptance/bootstrap/TrashbinContext.php | 3 +- .../bootstrap/WebDavLockingContext.php | 11 ++-- .../bootstrap/WebDavPropertiesContext.php | 5 +- tests/acceptance/config/behat.yml | 34 +++++----- 27 files changed, 205 insertions(+), 183 deletions(-) create mode 100644 tests/acceptance/TestHelpers/BehatHelper.php diff --git a/tests/acceptance/TestHelpers/BehatHelper.php b/tests/acceptance/TestHelpers/BehatHelper.php new file mode 100644 index 0000000000..8ddf877552 --- /dev/null +++ b/tests/acceptance/TestHelpers/BehatHelper.php @@ -0,0 +1,54 @@ + + * @copyright Copyright (c) 2017 Artur Neumann artur@jankaritech.com + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, + * as published by the Free Software Foundation; + * either version 3 of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * + */ +namespace TestHelpers; + +use Behat\Behat\Context\Context; +use Behat\Behat\Context\Environment\InitializedContextEnvironment; +use Behat\Behat\Context\Exception\ContextNotFoundException; +use Behat\Behat\Hook\Scope\ScenarioScope; + +/** + * Helper for Behat environment configuration + * + */ +class BehatHelper { + /** + * @param ScenarioScope $scope + * @param InitializedContextEnvironment $environment + * @param string $class + * + * @return Context + */ + public static function getContext(ScenarioScope $scope, InitializedContextEnvironment $environment, string $class): Context { + try { + return $environment->getContext($class); + } catch (ContextNotFoundException $e) { + print_r("[INFO] '$class' context not found. Registering...\n"); + $context = new $class(); + $environment->registerContext($context); + if (\method_exists($context, 'before')) { + $context->before($scope); + } + return $environment->getContext($class); + } + } +} diff --git a/tests/acceptance/bootstrap/ArchiverContext.php b/tests/acceptance/bootstrap/ArchiverContext.php index c31865b6be..6e3146f144 100644 --- a/tests/acceptance/bootstrap/ArchiverContext.php +++ b/tests/acceptance/bootstrap/ArchiverContext.php @@ -26,6 +26,7 @@ use Behat\Gherkin\Node\TableNode; use GuzzleHttp\Exception\GuzzleException; use TestHelpers\HttpRequestHelper; use TestHelpers\SetupHelper; +use TestHelpers\BehatHelper; use PHPUnit\Framework\Assert; use Psr\Http\Message\ResponseInterface; use splitbrain\PHPArchive\Tar; @@ -52,17 +53,11 @@ class ArchiverContext implements Context { * * @throws Exception */ - public function setUpScenario(BeforeScenarioScope $scope): void { + public function before(BeforeScenarioScope $scope): void { // 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->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } /** diff --git a/tests/acceptance/bootstrap/AuthContext.php b/tests/acceptance/bootstrap/AuthContext.php index 03fc32e722..41ffe10867 100644 --- a/tests/acceptance/bootstrap/AuthContext.php +++ b/tests/acceptance/bootstrap/AuthContext.php @@ -20,11 +20,12 @@ */ use Behat\Behat\Hook\Scope\BeforeScenarioScope; -use TestHelpers\HttpRequestHelper; use Behat\Gherkin\Node\TableNode; use Behat\Behat\Context\Context; -use TestHelpers\SetupHelper; use Psr\Http\Message\ResponseInterface; +use TestHelpers\HttpRequestHelper; +use TestHelpers\SetupHelper; +use TestHelpers\BehatHelper; use TestHelpers\WebDavHelper; /** @@ -40,22 +41,11 @@ class AuthContext implements Context { * * @return void */ - public function setUpScenario(BeforeScenarioScope $scope):void { + public function before(BeforeScenarioScope $scope):void { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); - - // Reset ResponseXml - $this->featureContext->setResponseXml([]); - - // Initialize SetupHelper class - SetupHelper::init( - $this->featureContext->getAdminUsername(), - $this->featureContext->getAdminPassword(), - $this->featureContext->getBaseUrl(), - $this->featureContext->getOcPath() - ); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } /** diff --git a/tests/acceptance/bootstrap/CapabilitiesContext.php b/tests/acceptance/bootstrap/CapabilitiesContext.php index 90e1beece1..446f74461b 100644 --- a/tests/acceptance/bootstrap/CapabilitiesContext.php +++ b/tests/acceptance/bootstrap/CapabilitiesContext.php @@ -28,6 +28,7 @@ use Behat\Gherkin\Node\PyStringNode; use Psr\Http\Message\ResponseInterface; use PHPUnit\Framework\Assert; use TestHelpers\OcsApiHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -51,7 +52,7 @@ class CapabilitiesContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } /** diff --git a/tests/acceptance/bootstrap/ChecksumContext.php b/tests/acceptance/bootstrap/ChecksumContext.php index 3f92395ce5..18242e7e79 100644 --- a/tests/acceptance/bootstrap/ChecksumContext.php +++ b/tests/acceptance/bootstrap/ChecksumContext.php @@ -22,8 +22,9 @@ use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; use PHPUnit\Framework\Assert; -use TestHelpers\WebDavHelper; use Psr\Http\Message\ResponseInterface; +use TestHelpers\WebDavHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -485,6 +486,6 @@ class ChecksumContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } } diff --git a/tests/acceptance/bootstrap/CliContext.php b/tests/acceptance/bootstrap/CliContext.php index d730b3c319..9e6869b0c5 100644 --- a/tests/acceptance/bootstrap/CliContext.php +++ b/tests/acceptance/bootstrap/CliContext.php @@ -22,10 +22,11 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Behat\Context\Context; +use Behat\Gherkin\Node\TableNode; use PHPUnit\Framework\Assert; use TestHelpers\CliHelper; use TestHelpers\OcisConfigHelper; -use Behat\Gherkin\Node\TableNode; +use TestHelpers\BehatHelper; /** * CLI context @@ -41,12 +42,12 @@ class CliContext implements Context { * * @return void */ - public function setUpScenario(BeforeScenarioScope $scope): void { + public function before(BeforeScenarioScope $scope): void { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); - $this->spacesContext = $environment->getContext('SpacesContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext'); } /** diff --git a/tests/acceptance/bootstrap/CollaborationContext.php b/tests/acceptance/bootstrap/CollaborationContext.php index 4dbf203750..0fdf4242a5 100644 --- a/tests/acceptance/bootstrap/CollaborationContext.php +++ b/tests/acceptance/bootstrap/CollaborationContext.php @@ -27,6 +27,7 @@ use GuzzleHttp\Exception\GuzzleException; use TestHelpers\HttpRequestHelper; use TestHelpers\WebDavHelper; use TestHelpers\CollaborationHelper; +use TestHelpers\BehatHelper; /** * steps needed to re-configure oCIS server @@ -50,8 +51,8 @@ class CollaborationContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context from here - $this->featureContext = $environment->getContext('FeatureContext'); - $this->spacesContext = $environment->getContext('SpacesContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext'); } /** diff --git a/tests/acceptance/bootstrap/FavoritesContext.php b/tests/acceptance/bootstrap/FavoritesContext.php index ab1d5d0b8f..dd163cdd50 100644 --- a/tests/acceptance/bootstrap/FavoritesContext.php +++ b/tests/acceptance/bootstrap/FavoritesContext.php @@ -25,6 +25,7 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\TableNode; use Psr\Http\Message\ResponseInterface; use TestHelpers\WebDavHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -245,8 +246,10 @@ class FavoritesContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); - $this->webDavPropertiesContext = $environment->getContext( + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->webDavPropertiesContext = BehatHelper::getContext( + $scope, + $environment, 'WebDavPropertiesContext' ); } diff --git a/tests/acceptance/bootstrap/FeatureContext.php b/tests/acceptance/bootstrap/FeatureContext.php index 0f05fac5c7..0b30bf6497 100644 --- a/tests/acceptance/bootstrap/FeatureContext.php +++ b/tests/acceptance/bootstrap/FeatureContext.php @@ -43,6 +43,7 @@ use TestHelpers\GraphHelper; use TestHelpers\WebDavHelper; use TestHelpers\SettingsHelper; use TestHelpers\OcisConfigHelper; +use TestHelpers\BehatHelper; use Swaggest\JsonSchema\InvalidValue as JsonSchemaException; use Swaggest\JsonSchema\Exception\ArrayException; use Swaggest\JsonSchema\Exception\ConstException; @@ -2617,36 +2618,23 @@ class FeatureContext extends BehatVariablesContext { */ public function before(BeforeScenarioScope $scope): void { $this->scenarioStartTime = \time(); + // Get the environment $environment = $scope->getEnvironment(); - // registers context in every suite, as every suite has FeatureContext - // that calls BasicStructure.php - $this->ocsContext = new OCSContext(); - $this->authContext = new AuthContext(); - $this->tusContext = new TUSContext(); - $this->ocmContext = new OcmContext(); - $this->ocsContext->before($scope); - $this->authContext->setUpScenario($scope); - $this->tusContext->setUpScenario($scope); - $environment->registerContext($this->ocsContext); - $environment->registerContext($this->authContext); - $environment->registerContext($this->tusContext); - $environment->registerContext($this->ocmContext); + // Get all the contexts you need in this context + $this->ocsContext = BehatHelper::getContext($scope, $environment, 'OCSContext'); + $this->authContext = BehatHelper::getContext($scope, $environment, 'AuthContext'); + $this->tusContext = BehatHelper::getContext($scope, $environment, 'TUSContext'); + $this->ocmContext = BehatHelper::getContext($scope, $environment, 'OcmContext'); + $this->graphContext = BehatHelper::getContext($scope, $environment, 'GraphContext'); + $this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext'); + $scenarioLine = $scope->getScenario()->getLine(); $featureFile = $scope->getFeature()->getFile(); $suiteName = $scope->getSuite()->getName(); $featureFileName = \basename($featureFile); - - if (!OcisHelper::isTestingOnReva()) { - $this->spacesContext = new SpacesContext(); - $this->spacesContext->setUpScenario($scope); - $environment->registerContext($this->spacesContext); - } - if (HttpRequestHelper::sendScenarioLineReferencesInXRequestId()) { $this->scenarioString = $suiteName . '/' . $featureFileName . ':' . $scenarioLine; - } else { - $this->scenarioString = ''; } // Initialize SetupHelper @@ -2661,10 +2649,6 @@ class FeatureContext extends BehatVariablesContext { $suiteParameters = SetupHelper::getSuiteParameters($scope); $this->connectToLdap($suiteParameters); } - - $this->graphContext = new GraphContext(); - $this->graphContext->before($scope); - $environment->registerContext($this->graphContext); } /** diff --git a/tests/acceptance/bootstrap/FilesVersionsContext.php b/tests/acceptance/bootstrap/FilesVersionsContext.php index 8c738c9cb3..7c71b65e2f 100644 --- a/tests/acceptance/bootstrap/FilesVersionsContext.php +++ b/tests/acceptance/bootstrap/FilesVersionsContext.php @@ -24,9 +24,10 @@ use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\TableNode; use PHPUnit\Framework\Assert; +use Psr\Http\Message\ResponseInterface; use TestHelpers\HttpRequestHelper; use TestHelpers\WebDavHelper; -use Psr\Http\Message\ResponseInterface; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -571,6 +572,6 @@ class FilesVersionsContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } } diff --git a/tests/acceptance/bootstrap/GraphContext.php b/tests/acceptance/bootstrap/GraphContext.php index e73ed206db..0eb0dde096 100644 --- a/tests/acceptance/bootstrap/GraphContext.php +++ b/tests/acceptance/bootstrap/GraphContext.php @@ -13,11 +13,12 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; use GuzzleHttp\Exception\GuzzleException; +use PHPUnit\Framework\Assert; use Psr\Http\Message\ResponseInterface; use TestHelpers\GraphHelper; use TestHelpers\WebDavHelper; -use PHPUnit\Framework\Assert; use TestHelpers\HttpRequestHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -47,10 +48,8 @@ class GraphContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context from here - $this->featureContext = $environment->getContext('FeatureContext'); - if (!\TestHelpers\OcisHelper::isTestingOnReva()) { - $this->spacesContext = $environment->getContext('SpacesContext'); - } + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext'); } /** diff --git a/tests/acceptance/bootstrap/NotificationContext.php b/tests/acceptance/bootstrap/NotificationContext.php index bd9fea738d..97dbf043e6 100644 --- a/tests/acceptance/bootstrap/NotificationContext.php +++ b/tests/acceptance/bootstrap/NotificationContext.php @@ -8,15 +8,16 @@ use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; -use TestHelpers\OcsApiHelper; -use Behat\Gherkin\Node\PyStringNode; -use TestHelpers\EmailHelper; -use PHPUnit\Framework\Assert; -use TestHelpers\GraphHelper; -use TestHelpers\SettingsHelper; use Behat\Gherkin\Node\TableNode; +use Behat\Gherkin\Node\PyStringNode; +use PHPUnit\Framework\Assert; use GuzzleHttp\Exception\GuzzleException; use Psr\Http\Message\ResponseInterface; +use TestHelpers\EmailHelper; +use TestHelpers\OcsApiHelper; +use TestHelpers\GraphHelper; +use TestHelpers\SettingsHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -94,13 +95,13 @@ class NotificationContext implements Context { * @return void * @throws Exception */ - public function setUpScenario(BeforeScenarioScope $scope):void { + public function before(BeforeScenarioScope $scope):void { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); - $this->spacesContext = $environment->getContext('SpacesContext'); - $this->settingsContext = $environment->getContext('SettingsContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext'); + $this->settingsContext = BehatHelper::getContext($scope, $environment, 'SettingsContext'); } /** diff --git a/tests/acceptance/bootstrap/OCSContext.php b/tests/acceptance/bootstrap/OCSContext.php index af219026e1..c485ca19d9 100644 --- a/tests/acceptance/bootstrap/OCSContext.php +++ b/tests/acceptance/bootstrap/OCSContext.php @@ -28,6 +28,7 @@ use Psr\Http\Message\ResponseInterface; use PHPUnit\Framework\Assert; use TestHelpers\OcsApiHelper; use TestHelpers\TranslationHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -658,6 +659,6 @@ class OCSContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } } diff --git a/tests/acceptance/bootstrap/OcmContext.php b/tests/acceptance/bootstrap/OcmContext.php index 102ea6aef0..edda80a492 100644 --- a/tests/acceptance/bootstrap/OcmContext.php +++ b/tests/acceptance/bootstrap/OcmContext.php @@ -26,6 +26,7 @@ use Psr\Http\Message\ResponseInterface; use TestHelpers\OcisHelper; use TestHelpers\OcmHelper; use TestHelpers\WebDavHelper; +use TestHelpers\BehatHelper; /** * Acceptance test steps related to testing federation share(ocm) features @@ -45,13 +46,10 @@ class OcmContext implements Context { * @return void */ public function before(BeforeScenarioScope $scope): void { - if (OcisHelper::isTestingOnReva()) { - return; - } // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context from here - $this->featureContext = $environment->getContext('FeatureContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } /** @@ -332,5 +330,4 @@ class OcmContext implements Context { $ocmUser['idp'] ); } - } diff --git a/tests/acceptance/bootstrap/PublicWebDavContext.php b/tests/acceptance/bootstrap/PublicWebDavContext.php index fccd271b6f..2bdfaa5a88 100644 --- a/tests/acceptance/bootstrap/PublicWebDavContext.php +++ b/tests/acceptance/bootstrap/PublicWebDavContext.php @@ -24,9 +24,10 @@ use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; use GuzzleHttp\Exception\GuzzleException; use PHPUnit\Framework\Assert; +use Psr\Http\Message\ResponseInterface; use TestHelpers\HttpRequestHelper; use TestHelpers\WebDavHelper; -use Psr\Http\Message\ResponseInterface; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -1797,11 +1798,11 @@ class PublicWebDavContext implements Context { * * @return void */ - public function setUpScenario(BeforeScenarioScope $scope):void { + public function before(BeforeScenarioScope $scope):void { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } /** diff --git a/tests/acceptance/bootstrap/SearchContext.php b/tests/acceptance/bootstrap/SearchContext.php index f6230fd3e9..7c5dc83b6d 100644 --- a/tests/acceptance/bootstrap/SearchContext.php +++ b/tests/acceptance/bootstrap/SearchContext.php @@ -26,6 +26,7 @@ use Behat\Gherkin\Node\TableNode; use PHPUnit\Framework\Assert; use TestHelpers\WebDavHelper; use TestHelpers\HttpRequestHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -181,7 +182,7 @@ class SearchContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } /** diff --git a/tests/acceptance/bootstrap/SettingsContext.php b/tests/acceptance/bootstrap/SettingsContext.php index 150e186cf4..5f40f16e0b 100644 --- a/tests/acceptance/bootstrap/SettingsContext.php +++ b/tests/acceptance/bootstrap/SettingsContext.php @@ -12,11 +12,12 @@ declare(strict_types=1); use Behat\Behat\Context\Context; use GuzzleHttp\Exception\GuzzleException; use Behat\Behat\Hook\Scope\BeforeScenarioScope; +use Behat\Gherkin\Node\TableNode; use PHPUnit\Framework\Assert; use Psr\Http\Message\ResponseInterface; use TestHelpers\HttpRequestHelper; use TestHelpers\SettingsHelper; -use Behat\Gherkin\Node\TableNode; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -25,7 +26,6 @@ require_once 'bootstrap.php'; */ class SettingsContext implements Context { private FeatureContext $featureContext; - private string $baseUrl; private string $settingsUrl = '/api/v0/settings/'; /** @@ -42,8 +42,7 @@ class SettingsContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context from here - $this->featureContext = $environment->getContext('FeatureContext'); - $this->baseUrl = \trim($this->featureContext->getBaseUrl(), "/"); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } /** @@ -56,7 +55,7 @@ class SettingsContext implements Context { */ public function getRoles(string $user): ResponseInterface { return SettingsHelper::getRolesList( - $this->baseUrl, + $this->featureContext->getBaseUrl(), $user, $this->featureContext->getPasswordForUser($user), $this->featureContext->getStepLineRef() @@ -90,7 +89,7 @@ class SettingsContext implements Context { */ public function assignRoleToUser(string $user, string $userId, string $roleId): ResponseInterface { return SettingsHelper::assignRoleToUser( - $this->baseUrl, + $this->featureContext->getBaseUrl(), $user, $this->featureContext->getPasswordForUser($user), $userId, @@ -110,7 +109,7 @@ class SettingsContext implements Context { */ public function getAssignmentsList(string $user, string $userId): ResponseInterface { return SettingsHelper::getAssignmentsList( - $this->baseUrl, + $this->featureContext->getBaseUrl(), $user, $this->featureContext->getPasswordForUser($user), $userId, @@ -294,7 +293,7 @@ class SettingsContext implements Context { */ public function sendRequestGetBundlesList(string $user): ResponseInterface { return SettingsHelper::getBundlesList( - $this->baseUrl, + $this->featureContext->getBaseUrl(), $user, $this->featureContext->getPasswordForUser($user), $this->featureContext->getStepLineRef(), @@ -312,7 +311,7 @@ class SettingsContext implements Context { */ public function getBundleByName(string $user, string $bundleName): array { return SettingsHelper::getBundleByName( - $this->baseUrl, + $this->featureContext->getBaseUrl(), $user, $this->featureContext->getPasswordForUser($user), $bundleName, @@ -331,7 +330,7 @@ class SettingsContext implements Context { */ public function sendRequestGetSettingsValuesList(string $user, array $headers = null): ResponseInterface { return SettingsHelper::getValuesList( - $this->baseUrl, + $this->featureContext->getBaseUrl(), $user, $this->featureContext->getPasswordForUser($user), $this->featureContext->getStepLineRef(), @@ -407,7 +406,7 @@ class SettingsContext implements Context { JSON_THROW_ON_ERROR ); return SettingsHelper::updateSettings( - $this->baseUrl, + $this->featureContext->getBaseUrl(), $user, $this->featureContext->getPasswordForUser($user), $body, @@ -460,7 +459,7 @@ class SettingsContext implements Context { ); return SettingsHelper::updateSettings( - $this->baseUrl, + $this->featureContext->getBaseUrl(), $user, $this->featureContext->getPasswordForUser($user), $body, diff --git a/tests/acceptance/bootstrap/ShareesContext.php b/tests/acceptance/bootstrap/ShareesContext.php index ee8f536ef3..0bd6b32278 100644 --- a/tests/acceptance/bootstrap/ShareesContext.php +++ b/tests/acceptance/bootstrap/ShareesContext.php @@ -27,6 +27,7 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\TableNode; use Psr\Http\Message\ResponseInterface; use PHPUnit\Framework\Assert; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -231,7 +232,7 @@ class ShareesContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); - $this->ocsContext = $environment->getContext('OCSContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->ocsContext = BehatHelper::getContext($scope, $environment, 'OCSContext'); } } diff --git a/tests/acceptance/bootstrap/SharingNgContext.php b/tests/acceptance/bootstrap/SharingNgContext.php index 4452b007d0..fbc7b43ac3 100644 --- a/tests/acceptance/bootstrap/SharingNgContext.php +++ b/tests/acceptance/bootstrap/SharingNgContext.php @@ -21,14 +21,15 @@ use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; +use Behat\Gherkin\Node\TableNode; use GuzzleHttp\Exception\GuzzleException; +use PHPUnit\Framework\Assert; use Psr\Http\Message\ResponseInterface; use TestHelpers\GraphHelper; use TestHelpers\OcisHelper; use TestHelpers\WebDavHelper; use TestHelpers\HttpRequestHelper; -use Behat\Gherkin\Node\TableNode; -use PHPUnit\Framework\Assert; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -50,14 +51,11 @@ class SharingNgContext implements Context { * @return void */ public function before(BeforeScenarioScope $scope): void { - if (OcisHelper::isTestingOnReva()) { - return; - } // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context from here - $this->featureContext = $environment->getContext('FeatureContext'); - $this->spacesContext = $environment->getContext('SpacesContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext'); } /** diff --git a/tests/acceptance/bootstrap/SpacesContext.php b/tests/acceptance/bootstrap/SpacesContext.php index 8c388d8c6f..e39b1771be 100644 --- a/tests/acceptance/bootstrap/SpacesContext.php +++ b/tests/acceptance/bootstrap/SpacesContext.php @@ -27,12 +27,14 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; use GuzzleHttp\Exception\GuzzleException; +use PHPUnit\Framework\Assert; use Psr\Http\Message\ResponseInterface; use TestHelpers\HttpRequestHelper; use TestHelpers\WebDavHelper; use TestHelpers\SetupHelper; use TestHelpers\GraphHelper; -use PHPUnit\Framework\Assert; +use TestHelpers\OcisHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -47,7 +49,6 @@ class SpacesContext implements Context { private FavoritesContext $favoritesContext; private ChecksumContext $checksumContext; private FilesVersionsContext $filesVersionsContext; - private string $baseUrl; /** * key is space name and value is the username that created the space @@ -266,7 +267,7 @@ class SpacesContext implements Context { */ public function getFileData(string $user, string $spaceName, string $fileName): ResponseInterface { $space = $this->getSpaceByName($user, $spaceName); - $fullUrl = $this->baseUrl . $this->davSpacesUrl . $space["id"] . "/" . $fileName; + $fullUrl = $this->featureContext->getBaseUrl() . $this->davSpacesUrl . $space["id"] . "/" . $fileName; return HttpRequestHelper::get( $fullUrl, @@ -388,32 +389,17 @@ class SpacesContext implements Context { * * @throws Exception */ - public function setUpScenario(BeforeScenarioScope $scope): void { + public function before(BeforeScenarioScope $scope): void { // Get the environment $environment = $scope->getEnvironment(); - // register new context - $this->trashbinContext = new TrashbinContext(); - $this->webDavPropertiesContext = new WebDavPropertiesContext(); - $this->favoritesContext = new FavoritesContext(); - $this->checksumContext = new ChecksumContext(); - $this->filesVersionsContext = new FilesVersionsContext(); - $environment->registerContext($this->trashbinContext); - $environment->registerContext($this->webDavPropertiesContext); - $environment->registerContext($this->favoritesContext); - $environment->registerContext($this->checksumContext); - $environment->registerContext($this->filesVersionsContext); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); - $this->ocsContext = $environment->getContext('OCSContext'); - // Run the BeforeScenario function in OCSContext to set it up correctly - $this->ocsContext->before($scope); - $this->baseUrl = \trim($this->featureContext->getBaseUrl(), "/"); - SetupHelper::init( - $this->featureContext->getAdminUsername(), - $this->featureContext->getAdminPassword(), - $this->baseUrl, - $this->featureContext->getOcPath() - ); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->ocsContext = BehatHelper::getContext($scope, $environment, 'OCSContext'); + $this->trashbinContext = BehatHelper::getContext($scope, $environment, 'TrashbinContext'); + $this->webDavPropertiesContext = BehatHelper::getContext($scope, $environment, 'WebDavPropertiesContext'); + $this->favoritesContext = BehatHelper::getContext($scope, $environment, 'FavoritesContext'); + $this->checksumContext = BehatHelper::getContext($scope, $environment, 'ChecksumContext'); + $this->filesVersionsContext = BehatHelper::getContext($scope, $environment, 'FilesVersionsContext'); } /** @@ -424,6 +410,9 @@ class SpacesContext implements Context { * @throws Exception|GuzzleException */ public function cleanDataAfterTests(): void { + if (OcisHelper::isTestingOnReva()) { + return; + } $this->deleteAllProjectSpaces(); } @@ -2135,7 +2124,7 @@ class SpacesContext implements Context { "expireDate" => $rows["expireDate"] ]; - $fullUrl = $this->baseUrl . $this->ocsApiUrl; + $fullUrl = $this->featureContext->getBaseUrl() . $this->ocsApiUrl; return $this->sendPostRequestToUrl( $fullUrl, @@ -2197,7 +2186,7 @@ class SpacesContext implements Context { $body["permissions"] = $rows["permissions"]; } - $fullUrl = $this->baseUrl . $this->ocsApiUrl; + $fullUrl = $this->featureContext->getBaseUrl() . $this->ocsApiUrl; $response = $this->sendPostRequestToUrl( $fullUrl, $user, @@ -2278,7 +2267,7 @@ class SpacesContext implements Context { */ public function updateSharedResource(string $user, array $rows):ResponseInterface { $shareId = ($this->featureContext->isUsingSharingNG()) ? $this->featureContext->shareNgGetLastCreatedUserGroupShareID() : $this->featureContext->getLastCreatedUserGroupShareId(); - $fullUrl = $this->baseUrl . $this->ocsApiUrl . '/' . $shareId; + $fullUrl = $this->featureContext->getBaseUrl() . $this->ocsApiUrl . '/' . $shareId; return HttpRequestHelper::sendRequest( $fullUrl, $this->featureContext->getStepLineRef(), @@ -2358,7 +2347,7 @@ class SpacesContext implements Context { "expireDate" => $rows["expireDate"] ]; - $fullUrl = $this->baseUrl . $this->ocsApiUrl; + $fullUrl = $this->featureContext->getBaseUrl() . $this->ocsApiUrl; $response = $this->sendPostRequestToUrl( $fullUrl, @@ -2487,7 +2476,7 @@ class SpacesContext implements Context { string $recipient ): ResponseInterface { $space = $this->getSpaceByName($user, $spaceName); - $fullUrl = $this->baseUrl . $this->ocsApiUrl . "/" . $space['id'] . "?shareWith=" . $recipient; + $fullUrl = $this->featureContext->getBaseUrl() . $this->ocsApiUrl . "/" . $space['id'] . "?shareWith=" . $recipient; return HttpRequestHelper::delete( $fullUrl, @@ -2794,7 +2783,7 @@ class SpacesContext implements Context { string $spaceName ): ResponseInterface { $space = $this->getSpaceByName($user, $spaceName); - $fullUrl = $this->baseUrl . $this->davSpacesUrl . "trash-bin/" . $space["id"]; + $fullUrl = $this->featureContext->getBaseUrl() . $this->davSpacesUrl . "trash-bin/" . $space["id"]; return HttpRequestHelper::sendRequest( $fullUrl, $this->featureContext->getStepLineRef(), @@ -2837,7 +2826,7 @@ class SpacesContext implements Context { ): void { // get space by admin user $space = $this->getSpaceByName($this->featureContext->getAdminUserName(), $spaceName); - $fullUrl = $this->baseUrl . $this->davSpacesUrl . "trash-bin/" . $space["id"]; + $fullUrl = $this->featureContext->getBaseUrl() . $this->davSpacesUrl . "trash-bin/" . $space["id"]; $this->featureContext->setResponse( HttpRequestHelper::sendRequest($fullUrl, $this->featureContext->getStepLineRef(), 'PROPFIND', $user, $this->featureContext->getPasswordForUser($user)) ); @@ -2942,10 +2931,10 @@ class SpacesContext implements Context { throw new Exception(__METHOD__ . " Object '$object' was not found in the trashbin of space '$spaceName' by user '$user'"); } - $destination = $this->baseUrl . $this->davSpacesUrl . $space["id"] . $destination; + $destination = $this->featureContext->getBaseUrl() . $this->davSpacesUrl . $space["id"] . $destination; $header = ["Destination" => $destination, "Overwrite" => "F"]; - $fullUrl = $this->baseUrl . $pathToDeletedObject; + $fullUrl = $this->featureContext->getBaseUrl() . $pathToDeletedObject; $this->featureContext->setResponse( HttpRequestHelper::sendRequest( $fullUrl, @@ -2989,7 +2978,7 @@ class SpacesContext implements Context { throw new Exception(__METHOD__ . " Object '$object' was not found in the trashbin of space '$spaceName' by user '$user'"); } - $fullUrl = $this->baseUrl . $pathToDeletedObject; + $fullUrl = $this->featureContext->getBaseUrl() . $pathToDeletedObject; $this->featureContext->setResponse( HttpRequestHelper::sendRequest( $fullUrl, @@ -3036,7 +3025,7 @@ class SpacesContext implements Context { $urlParameters = \http_build_query($urlParameters, '', '&'); $space = $this->getSpaceByName($user, $spaceName); - $fullUrl = $this->baseUrl . $this->davSpacesUrl . $space['id'] . '/' . $fileName . '?' . $urlParameters; + $fullUrl = $this->featureContext->getBaseUrl() . $this->davSpacesUrl . $space['id'] . '/' . $fileName . '?' . $urlParameters; $this->featureContext->setResponse( HttpRequestHelper::get( @@ -3331,7 +3320,7 @@ class SpacesContext implements Context { "expireDate" => $rows["expireDate"] ]; - $fullUrl = $this->baseUrl . $this->ocsApiUrl; + $fullUrl = $this->featureContext->getBaseUrl() . $this->ocsApiUrl; $response = $this->sendPostRequestToUrl( $fullUrl, diff --git a/tests/acceptance/bootstrap/SpacesTUSContext.php b/tests/acceptance/bootstrap/SpacesTUSContext.php index d373111266..283c383c56 100644 --- a/tests/acceptance/bootstrap/SpacesTUSContext.php +++ b/tests/acceptance/bootstrap/SpacesTUSContext.php @@ -11,10 +11,11 @@ declare(strict_types=1); use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; -use GuzzleHttp\Exception\GuzzleException; use Behat\Gherkin\Node\TableNode; +use GuzzleHttp\Exception\GuzzleException; use PHPUnit\Framework\Assert; use TestHelpers\WebDavHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -40,9 +41,9 @@ class SpacesTUSContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context from here - $this->featureContext = $environment->getContext('FeatureContext'); - $this->spacesContext = $environment->getContext('SpacesContext'); - $this->tusContext = $environment->getContext('TUSContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext'); + $this->tusContext = BehatHelper::getContext($scope, $environment, 'TUSContext'); } /** diff --git a/tests/acceptance/bootstrap/TUSContext.php b/tests/acceptance/bootstrap/TUSContext.php index 92bd7b11ad..83a26d961e 100644 --- a/tests/acceptance/bootstrap/TUSContext.php +++ b/tests/acceptance/bootstrap/TUSContext.php @@ -24,13 +24,14 @@ use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\TableNode; use GuzzleHttp\Exception\GuzzleException; -use TestHelpers\HttpRequestHelper; -use TestHelpers\WebDavHelper; use TusPhp\Exception\ConnectionException; use TusPhp\Exception\TusException; use TusPhp\Tus\Client; use PHPUnit\Framework\Assert; use Psr\Http\Message\ResponseInterface; +use TestHelpers\HttpRequestHelper; +use TestHelpers\WebDavHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -458,11 +459,11 @@ class TUSContext implements Context { * * @return void */ - public function setUpScenario(BeforeScenarioScope $scope): void { + public function before(BeforeScenarioScope $scope): void { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); // clear TUS locations cache $this->tusResourceLocations = []; } diff --git a/tests/acceptance/bootstrap/TagContext.php b/tests/acceptance/bootstrap/TagContext.php index 62a27662b0..678f39ab41 100644 --- a/tests/acceptance/bootstrap/TagContext.php +++ b/tests/acceptance/bootstrap/TagContext.php @@ -23,8 +23,9 @@ use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\TableNode; use PHPUnit\Framework\Assert; -use TestHelpers\GraphHelper; use Psr\Http\Message\ResponseInterface; +use TestHelpers\GraphHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -49,8 +50,8 @@ class TagContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context from here - $this->featureContext = $environment->getContext('FeatureContext'); - $this->spacesContext = $environment->getContext('SpacesContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext'); } /** diff --git a/tests/acceptance/bootstrap/TrashbinContext.php b/tests/acceptance/bootstrap/TrashbinContext.php index 1f560d2c45..d88145e591 100644 --- a/tests/acceptance/bootstrap/TrashbinContext.php +++ b/tests/acceptance/bootstrap/TrashbinContext.php @@ -27,6 +27,7 @@ use PHPUnit\Framework\Assert; use Psr\Http\Message\ResponseInterface; use TestHelpers\HttpRequestHelper; use TestHelpers\WebDavHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -1120,7 +1121,7 @@ class TrashbinContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } /** diff --git a/tests/acceptance/bootstrap/WebDavLockingContext.php b/tests/acceptance/bootstrap/WebDavLockingContext.php index a57af75a80..17555df351 100644 --- a/tests/acceptance/bootstrap/WebDavLockingContext.php +++ b/tests/acceptance/bootstrap/WebDavLockingContext.php @@ -25,10 +25,11 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\TableNode; use GuzzleHttp\Exception\GuzzleException; use PHPUnit\Framework\Assert; +use Psr\Http\Message\ResponseInterface; use TestHelpers\HttpRequestHelper; use TestHelpers\WebDavHelper; -use Psr\Http\Message\ResponseInterface; use TestHelpers\OcisHelper; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -991,10 +992,8 @@ class WebDavLockingContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); - $this->publicWebDavContext = $environment->getContext('PublicWebDavContext'); - if (!OcisHelper::isTestingOnReva()) { - $this->spacesContext = $environment->getContext('SpacesContext'); - } + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); + $this->publicWebDavContext = BehatHelper::getContext($scope, $environment, 'PublicWebDavContext'); + $this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext'); } } diff --git a/tests/acceptance/bootstrap/WebDavPropertiesContext.php b/tests/acceptance/bootstrap/WebDavPropertiesContext.php index bb82b6120e..543e5d5b81 100644 --- a/tests/acceptance/bootstrap/WebDavPropertiesContext.php +++ b/tests/acceptance/bootstrap/WebDavPropertiesContext.php @@ -24,9 +24,10 @@ use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\TableNode; use PHPUnit\Framework\Assert; +use Psr\Http\Message\ResponseInterface; use TestHelpers\Asserts\WebDav as WebDavTest; use TestHelpers\WebDavHelper; -use Psr\Http\Message\ResponseInterface; +use TestHelpers\BehatHelper; require_once 'bootstrap.php'; @@ -1463,6 +1464,6 @@ class WebDavPropertiesContext implements Context { // Get the environment $environment = $scope->getEnvironment(); // Get all the contexts you need in this context - $this->featureContext = $environment->getContext('FeatureContext'); + $this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext'); } } diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 41d578989a..adefa793fe 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -13,15 +13,15 @@ default: ldapGroupsOU: TestGroups ldapInitialUserFilePath: /../config/ldap-users.ldif contexts: - - SettingsContext: - - GraphContext: - - SpacesContext: - FeatureContext: &common_feature_context_params baseUrl: http://localhost:8080 adminUsername: admin adminPassword: admin regularUserPassword: 123456 ocPath: apps/testing/api/v1/occ + - SettingsContext: + - GraphContext: + - SpacesContext: - CapabilitiesContext: - FilesVersionsContext: - NotificationContext: @@ -33,9 +33,9 @@ default: - "%paths.base%/../features/apiSpaces" context: *common_ldap_suite_context contexts: + - FeatureContext: *common_feature_context_params - SettingsContext: - SpacesContext: - - FeatureContext: *common_feature_context_params - CapabilitiesContext: - FilesVersionsContext: - NotificationContext: @@ -54,9 +54,9 @@ default: - "%paths.base%/../features/apiSpacesShares" context: *common_ldap_suite_context contexts: + - FeatureContext: *common_feature_context_params - SettingsContext: - SpacesContext: - - FeatureContext: *common_feature_context_params - CapabilitiesContext: - ChecksumContext: - FavoritesContext: @@ -77,9 +77,9 @@ default: - "%paths.base%/../features/apiContract" context: *common_ldap_suite_context contexts: + - FeatureContext: *common_feature_context_params - SettingsContext: - SpacesContext: - - FeatureContext: *common_feature_context_params - CapabilitiesContext: - FilesVersionsContext: - OCSContext: @@ -95,10 +95,10 @@ default: - "%paths.base%/../features/apiArchiver" context: *common_ldap_suite_context contexts: + - FeatureContext: *common_feature_context_params - SettingsContext: - ArchiverContext: - SpacesContext: - - FeatureContext: *common_feature_context_params - CapabilitiesContext: - FilesVersionsContext: - OCSContext: @@ -111,10 +111,10 @@ default: - "%paths.base%/../features/apiGraph" context: *common_ldap_suite_context contexts: + - FeatureContext: *common_feature_context_params - SettingsContext: - GraphContext: - SpacesContext: - - FeatureContext: *common_feature_context_params - CapabilitiesContext: - FilesVersionsContext: - OCSContext: @@ -130,10 +130,10 @@ default: - "%paths.base%/../features/apiGraphUserGroup" context: *common_ldap_suite_context contexts: + - FeatureContext: *common_feature_context_params - SettingsContext: - GraphContext: - SpacesContext: - - FeatureContext: *common_feature_context_params - CapabilitiesContext: - FilesVersionsContext: - OCSContext: @@ -149,8 +149,8 @@ default: - "%paths.base%/../features/apiCors" context: *common_ldap_suite_context contexts: - - SpacesContext: - FeatureContext: *common_feature_context_params + - SpacesContext: - FilesVersionsContext: - OCSContext: - GraphContext: @@ -164,8 +164,8 @@ default: - "%paths.base%/../features/apiDepthInfinity" context: *common_ldap_suite_context contexts: - - SpacesContext: - FeatureContext: *common_feature_context_params + - SpacesContext: - OCSContext: - GraphContext: - PublicWebDavContext: @@ -178,8 +178,8 @@ default: - "%paths.base%/../features/apiAsyncUpload" context: *common_ldap_suite_context contexts: - - SpacesContext: - FeatureContext: *common_feature_context_params + - SpacesContext: - WebDavPropertiesContext: - FilesVersionsContext: - OCSContext: @@ -192,8 +192,8 @@ default: context: *common_ldap_suite_context contexts: - NotificationContext: - - SpacesContext: - FeatureContext: *common_feature_context_params + - SpacesContext: - OCSContext: - GraphContext: - FilesVersionsContext: @@ -207,9 +207,9 @@ default: - "%paths.base%/../features/apiAntivirus" context: *common_ldap_suite_context contexts: + - FeatureContext: *common_feature_context_params - NotificationContext: - SpacesContext: - - FeatureContext: *common_feature_context_params - OCSContext: - GraphContext: - FilesVersionsContext: @@ -223,9 +223,9 @@ default: - "%paths.base%/../features/apiDownloads" context: *common_ldap_suite_context contexts: + - FeatureContext: *common_feature_context_params - NotificationContext: - SpacesContext: - - FeatureContext: *common_feature_context_params - WebDavPropertiesContext: - OCSContext: - GraphContext: @@ -262,10 +262,10 @@ default: - "%paths.base%/../features/apiSearch2" context: *common_ldap_suite_context contexts: + - FeatureContext: *common_feature_context_params - SettingsContext: - GraphContext: - SpacesContext: - - FeatureContext: *common_feature_context_params - FilesVersionsContext: - SearchContext: - OCSContext: @@ -280,11 +280,11 @@ default: - "%paths.base%/../features/apiSearchContent" context: *common_ldap_suite_context contexts: + - FeatureContext: *common_feature_context_params - SettingsContext: - GraphContext: - SpacesContext: - PublicWebDavContext: - - FeatureContext: *common_feature_context_params - SearchContext: - CapabilitiesContext: - FilesVersionsContext: