Skip to content

Commit

Permalink
Merge pull request #10160 from owncloud/tests-public-link-change-api-…
Browse files Browse the repository at this point in the history
…activities

[tests-only][full-ci] add tests to check activites of space after updating public share link
  • Loading branch information
prashant-gurung899 authored Oct 3, 2024
2 parents 26ac43c + 234a1ff commit c4884e4
Show file tree
Hide file tree
Showing 2 changed files with 763 additions and 0 deletions.
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

0 comments on commit c4884e4

Please sign in to comment.