[full-ci] [tests-only] Added api test for sharing spaces to group (#5023)
This commit is contained in:
@@ -167,3 +167,24 @@ Feature: Share spaces
|
|||||||
| editor | viewer |
|
| editor | viewer |
|
||||||
| viewer | manager |
|
| viewer | manager |
|
||||||
| viewer | editor |
|
| viewer | editor |
|
||||||
|
|
||||||
|
|
||||||
|
Scenario Outline: A user shares a space with a group
|
||||||
|
Given group "group2" has been created
|
||||||
|
And the administrator has added a user "Brian" to the group "group2" using GraphApi
|
||||||
|
And the administrator has added a user "Bob" to the group "group2" using GraphApi
|
||||||
|
When user "Alice" shares a space "share space" to group "group2" with role "<role>"
|
||||||
|
Then the HTTP status code should be "200"
|
||||||
|
And the user "Brian" should have a space called "share space" with these key and value pairs:
|
||||||
|
| key | value |
|
||||||
|
| driveType | project |
|
||||||
|
| name | share space |
|
||||||
|
And the user "Bob" should have a space called "share space" with these key and value pairs:
|
||||||
|
| key | value |
|
||||||
|
| driveType | project |
|
||||||
|
| name | share space |
|
||||||
|
Examples:
|
||||||
|
| role |
|
||||||
|
| manager |
|
||||||
|
| editor |
|
||||||
|
| viewer |
|
||||||
|
|||||||
@@ -1353,7 +1353,7 @@ class SpacesContext implements Context {
|
|||||||
"Expected response status code should be 200"
|
"Expected response status code should be 200"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @When /^user "([^"]*)" sets the file "([^"]*)" as a (description|space image)\s? in a special section of the "([^"]*)" space$/
|
* @When /^user "([^"]*)" sets the file "([^"]*)" as a (description|space image)\s? in a special section of the "([^"]*)" space$/
|
||||||
*
|
*
|
||||||
@@ -1775,11 +1775,12 @@ class SpacesContext implements Context {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @When /^user "([^"]*)" shares a space "([^"]*)" to user "([^"]*)" with role "([^"]*)"$/
|
* @When /^user "([^"]*)" shares a space "([^"]*)" to user "([^"]*)" with role "([^"]*)"$/
|
||||||
|
* @When /^user "([^"]*)" shares a space "([^"]*)" to group "([^"]*)" with role "([^"]*)"$/
|
||||||
* @When /^user "([^"]*)" updates the space "([^"]*)" for user "([^"]*)" changing the role to "([^"]*)"$/
|
* @When /^user "([^"]*)" updates the space "([^"]*)" for user "([^"]*)" changing the role to "([^"]*)"$/
|
||||||
*
|
*
|
||||||
* @param string $user
|
* @param string $user
|
||||||
* @param string $spaceName
|
* @param string $spaceName
|
||||||
* @param string $userRecipient
|
* @param string $recipient
|
||||||
* @param string $role
|
* @param string $role
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
@@ -1788,7 +1789,7 @@ class SpacesContext implements Context {
|
|||||||
public function sendShareSpaceRequest(
|
public function sendShareSpaceRequest(
|
||||||
string $user,
|
string $user,
|
||||||
string $spaceName,
|
string $spaceName,
|
||||||
string $userRecipient,
|
string $recipient,
|
||||||
string $role
|
string $role
|
||||||
): void {
|
): void {
|
||||||
$space = $this->getSpaceByName($user, $spaceName);
|
$space = $this->getSpaceByName($user, $spaceName);
|
||||||
@@ -1799,7 +1800,7 @@ class SpacesContext implements Context {
|
|||||||
$body = [
|
$body = [
|
||||||
"space_ref" => $space['id'],
|
"space_ref" => $space['id'],
|
||||||
"shareType" => 7,
|
"shareType" => 7,
|
||||||
"shareWith" => $userRecipient,
|
"shareWith" => $recipient,
|
||||||
"role" => $role // role overrides the permissions parameter
|
"role" => $role // role overrides the permissions parameter
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user