Skip to content

Commit

Permalink
add tests to check activites of space after updating public share link
Browse files Browse the repository at this point in the history
Signed-off-by: prashant-gurung899 <[email protected]>
  • Loading branch information
prashant-gurung899 committed Oct 1, 2024
1 parent d549f48 commit 39571a7
Show file tree
Hide file tree
Showing 2 changed files with 766 additions and 0 deletions.
46 changes: 46 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,50 @@ 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
*
* @param string $spaceName
* @param string $user
* @param string $password
*
* @return void
*/
public function thePublicTriesToCheckTheActivitiesOfSpaceOwnedByUserWithPassword(string $spaceName, string $user, string $password): void {
$spaceId = $this->spacesContext->getSpaceIdByName($user, $spaceName);
$password = $this->featureContext->getActualPassword($password);
$response = GraphHelper::getActivities(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
"public",
$password,
$spaceId
);
$this->featureContext->setResponse($response);
}

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

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

0 comments on commit 39571a7

Please sign in to comment.