Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci] add tests to check activites of space after updating public share link #10160

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions tests/acceptance/bootstrap/GraphContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/
class GraphContext implements Context {
private FeatureContext $featureContext;
private SpacesContext $spacesContext;

/**
* application Entity
Expand All @@ -47,6 +48,7 @@ public function before(BeforeScenarioScope $scope): void {
$environment = $scope->getEnvironment();
// Get all the contexts you need in this context from here
$this->featureContext = $environment->getContext('FeatureContext');
$this->spacesContext = $environment->getContext('SpacesContext');
}

/**
Expand Down Expand Up @@ -2891,6 +2893,47 @@ public function userListsTheActivitiesOfSpaceUsingTheGraphApi(string $user, stri
$this->featureContext->setResponse($response);
}

/**
* @When the public tries to check the activities of space :spaceName owned by user :user with password :password using the Graph API
*
* @param string $spaceName
* @param string $user
* @param string $password
*
* @return void
*/
public function thePublicTriesToCheckTheActivitiesOfSpaceOwnedByUserWithPasswordUsingGraphApi(string $spaceName, string $user, string $password): void {
$response = GraphHelper::getActivities(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
"public",
$this->featureContext->getActualPassword($password),
$this->spacesContext->getSpaceIdByName($user, $spaceName)
);
$this->featureContext->setResponse($response);
}

/**
* @When /^the public tries to check the activities of (?:folder|file) "([^"]*)" from space "([^"]*)" owned by user "([^"]*)" with password "([^"]*)" using the Graph API$/
*
* @param string $resource
* @param string $space
* @param string $owner
* @param string $password
*
* @return void
*/
public function thePublicTriesToCheckTheActivitiesOfResourceFromSpaceOwnedByUserWithPasswordUsingGraphApi(string $resource, string $space, string $owner, string $password): void {
$response = GraphHelper::getActivities(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
"public",
$this->featureContext->getPasswordForUser($owner),
$this->spacesContext->getResourceId($owner, $space, $resource)
);
$this->featureContext->setResponse($response);
}

/**
* @When /^user "([^"]*)" lists the activities of (?:folder|file) "([^"]*)" from space "([^"]*)" with (depth|limit) "([^"]*)" using the Graph API/
*
Expand Down
Loading