diff --git a/tests/acceptance/bootstrap/CliContext.php b/tests/acceptance/bootstrap/CliContext.php index 12d215cbf37..cf91ec8c207 100644 --- a/tests/acceptance/bootstrap/CliContext.php +++ b/tests/acceptance/bootstrap/CliContext.php @@ -53,6 +53,16 @@ class CliContext implements Context { $this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext'); } + /** + * @Given the administrator has cleaned the search service data + * + * @return void + */ + public function theAdministratorHasCleanedTheSearchServiceData(): void { + $dataPath = $this->featureContext->getOcisDataPath() . "/search"; + \exec("rm -rf $dataPath"); + } + /** * @Given the administrator has stopped the server * diff --git a/tests/acceptance/bootstrap/FeatureContext.php b/tests/acceptance/bootstrap/FeatureContext.php index 6284f9f016c..ce95cbd725b 100644 --- a/tests/acceptance/bootstrap/FeatureContext.php +++ b/tests/acceptance/bootstrap/FeatureContext.php @@ -731,8 +731,16 @@ class FeatureContext extends BehatVariablesContext { /** * @return string */ - public function getStorageUsersRoot(): string { + public function getOcisDataPath(): string { $ocisDataPath = getenv("OCIS_BASE_DATA_PATH") ? getenv("OCIS_BASE_DATA_PATH") : getenv("HOME") . '/.ocis'; + return $ocisDataPath; + } + + /** + * @return string + */ + public function getStorageUsersRoot(): string { + $ocisDataPath = $this->getOcisDataPath(); return getenv("STORAGE_USERS_OCIS_ROOT") ? getenv("STORAGE_USERS_OCIS_ROOT") : $ocisDataPath . "/storage/users"; } diff --git a/tests/acceptance/features/cliCommands/searchReIndex.feature b/tests/acceptance/features/cliCommands/searchReIndex.feature index 8615135cca9..ffaf43eb9aa 100644 --- a/tests/acceptance/features/cliCommands/searchReIndex.feature +++ b/tests/acceptance/features/cliCommands/searchReIndex.feature @@ -5,7 +5,8 @@ Feature: reindex space via CLI command So that I can improve search performance by ensuring that the index is up-to-date Background: - Given user "Alice" has been created with default attributes + Given the administrator has cleaned the search service data + And user "Alice" has been created with default attributes And using spaces DAV path And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API And user "Alice" has created a space "new-space" with the default quota using the Graph API