tests: update ocm setup and docs

docs: separate provider config

tests: substitution for local and remote server urls

tests: create local configs

tests: fix vscode debugger config

tests: separate federation share steps
This commit is contained in:
Saw-jan
2024-11-08 18:30:53 +05:45
parent 22d80256d6
commit c3b442491d
18 changed files with 576 additions and 420 deletions

View File

@@ -52,20 +52,6 @@ class OcmContext implements Context {
$this->featureContext = BehatHelper::getContext($scope, $environment, 'FeatureContext');
}
/**
* @return string
*/
public function getOcisDomain(): string {
return $this->extractDomain(OcisHelper::getServerUrl());
}
/**
* @return string
*/
public function getFedOcisDomain(): string {
return $this->extractDomain(\getenv('TEST_SERVER_FED_URL'));
}
/**
* @return string
* @throws Exception
@@ -77,18 +63,6 @@ class OcmContext implements Context {
return $this->invitationToken;
}
/**
* @param string $url
*
* @return string
*/
public function extractDomain($url): string {
if (!$url) {
return "localhost";
}
return parse_url($url)["host"];
}
/**
* @param string $user
* @param string $email
@@ -152,7 +126,10 @@ class OcmContext implements Context {
* @throws GuzzleException
*/
public function acceptInvitation(string $user, string $token = null): ResponseInterface {
$providerDomain = ($this->featureContext->getCurrentServer() === "LOCAL") ? $this->getFedOcisDomain() : $this->getOcisDomain();
$providerDomain = $this->featureContext->getLocalBaseUrlWithoutScheme();
if ($this->featureContext->getCurrentServer() === "LOCAL") {
$providerDomain = $this->featureContext->getRemoteBaseUrlWithoutScheme();
}
return OcmHelper::acceptInvitation(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),