[tests-only][full-ci] updating given step for sharing and env in docs for starting email service (#9081)

* updating given step for sharing and env in docs for starting email service

* addressing review

* fixing the given steps of sharing
This commit is contained in:
Sabin Panta
2024-05-09 12:25:57 +05:45
committed by GitHub
parent 8ddd82fcd5
commit fff20ac8db
8 changed files with 85 additions and 34 deletions

View File

@@ -362,6 +362,7 @@ PROXY_ENABLE_BASIC_AUTH=true \
NOTIFICATIONS_SMTP_HOST=localhost \
NOTIFICATIONS_SMTP_PORT=2500 \
NOTIFICATIONS_SMTP_INSECURE=true \
NOTIFICATIONS_SMTP_SENDER="owncloud <noreply@example.com>" \
ocis/bin/ocis server
```

View File

@@ -198,6 +198,7 @@ default:
- FilesVersionsContext:
- SettingsContext:
- OcisConfigContext:
- SharingNgContext:
apiAntivirus:
paths:

View File

@@ -35,6 +35,7 @@ services:
NOTIFICATIONS_SMTP_HOST: email
NOTIFICATIONS_SMTP_PORT: 2500
NOTIFICATIONS_SMTP_INSECURE: "true"
NOTIFICATIONS_SMTP_SENDER: "owncloud <noreply@example.com>"
# antivirus
ANTIVIRUS_SCANNER_TYPE: "clamav"

View File

@@ -10,8 +10,18 @@ Feature: Delete notification
| Brian |
And user "Alice" has uploaded file with content "other data" to "/textfile1.txt"
And user "Alice" has created folder "my_data"
And user "Alice" has shared folder "my_data" with user "Brian"
And user "Alice" has shared file "/textfile1.txt" with user "Brian"
And user "Alice" has sent the following resource share invitation:
| resource | my_data |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Alice" has sent the following resource share invitation:
| resource | textfile1.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
Scenario: delete a notification

View File

@@ -165,9 +165,11 @@ Feature: Email notification
Scenario: user gets an email notification when space admin unshares a space
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has shared a space "new-space" with settings:
| shareWith | Brian |
| role | editor |
And user "Alice" has sent the following space share invitation:
| space | new-space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Viewer |
When user "Alice" unshares a space "new-space" to user "Brian"
Then the HTTP status code should be "200"
And user "Brian" should have received the following email from user "Alice" about the share of project space "new-space"

View File

@@ -14,7 +14,12 @@ Feature: Notification
Scenario Outline: user gets a notification of resource sharing
Given user "Alice" has shared entry "<resource>" with user "Brian"
Given user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Resource shared" and the message-details should match
@@ -127,8 +132,13 @@ Feature: Notification
Scenario Outline: user gets a notification of unsharing resource
Given user "Alice" has shared entry "<resource>" with user "Brian"
And user "Alice" has unshared entity "<resource>" shared to "Brian"
Given user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Alice" has removed the access of user "Brian" from resource "<resource>" of space "Personal"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Resource unshared" and the message-details should match
@@ -242,7 +252,12 @@ Feature: Notification
Scenario Outline: get a notification about a file share in various languages
Given user "Brian" has switched the system language to "<language>" using the <api> API
And user "Alice" has shared entry "textfile1.txt" with user "Brian"
And user "Alice" has sent the following resource share invitation:
| resource | textfile1.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "<subject>" and the message-details should match
@@ -272,7 +287,12 @@ Feature: Notification
@env-config
Scenario: get a notification about a file share in default languages
Given the config "OCIS_DEFAULT_LANGUAGE" has been set to "de"
And user "Alice" has shared entry "textfile1.txt" with user "Brian"
And user "Alice" has sent the following resource share invitation:
| resource | textfile1.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Neue Freigabe" and the message-details should match
@@ -295,8 +315,13 @@ Feature: Notification
Scenario Outline: notifications related to a resource get deleted when the resource is deleted
Given user "Alice" has shared entry "<resource>" with user "Brian"
And user "Alice" has unshared entity "<resource>" shared to "Brian"
Given user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Alice" has removed the access of user "Brian" from resource "<resource>" of space "Personal"
And user "Alice" has deleted entity "/<resource>"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"

View File

@@ -11,12 +11,14 @@ Feature: Notification
| Carol |
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "notification checking" with the default quota using the Graph API
And user "Alice" has sent the following space share invitation:
| space | notification checking |
| sharee | Brian |
| shareType | user |
| permissionsRole | Space Editor |
Scenario: get a notification of space shared
Given user "Alice" has shared a space "notification checking" with settings:
| shareWith | Brian |
| role | editor |
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Space shared" and the message-details should match
@@ -146,10 +148,7 @@ Feature: Notification
Scenario: get a notification of space unshared
Given user "Alice" has shared a space "notification checking" with settings:
| shareWith | Brian |
| role | editor |
And user "Alice" has unshared a space "notification checking" shared with "Brian"
Given user "Alice" has removed the access of user "Brian" from space "notification checking"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "Removed from Space" and the message-details should match
@@ -279,10 +278,7 @@ Feature: Notification
Scenario: get a notification of space disabled
Given user "Alice" has shared a space "notification checking" with settings:
| shareWith | Brian |
| role | editor |
And user "Alice" has disabled a space "notification checking"
Given user "Alice" has disabled a space "notification checking"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And there should be "2" notifications
@@ -414,9 +410,6 @@ Feature: Notification
Scenario Outline: get a notification about a space share in various languages
Given user "Brian" has switched the system language to "<language>" using the Graph API
And user "Alice" has shared a space "notification checking" with settings:
| shareWith | Brian |
| role | editor |
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the JSON response should contain a notification message with the subject "<subject>" and the message-details should match
@@ -443,10 +436,7 @@ Feature: Notification
Scenario: all notification related to space get deleted when the sharer deletes that resource
Given user "Alice" has shared a space "notification checking" with settings:
| shareWith | Brian |
| role | editor |
And user "Alice" has unshared a space "notification checking" shared with "Brian"
Given user "Alice" has removed the access of user "Brian" from space "notification checking"
And user "Alice" has disabled a space "notification checking"
And user "Alice" has deleted a space "notification checking"
When user "Brian" lists all notifications
@@ -455,10 +445,7 @@ Feature: Notification
Scenario: user doesn't get any notification after being removed from space
Given user "Alice" has shared a space "notification checking" with settings:
| shareWith | Brian |
| role | editor |
And user "Alice" has unshared a space "notification checking" shared with "Brian"
Given user "Alice" has removed the access of user "Brian" from space "notification checking"
And user "Alice" has disabled a space "notification checking"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"

View File

@@ -765,6 +765,30 @@ class SharingNgContext implements Context {
);
}
/**
* @Given /^user "([^"]*)" has removed the access of (user|group) "([^"]*)" from (?:file|folder|resource) "([^"]*)" of space "([^"]*)"$/
*
* @param string $sharer
* @param string $recipientType (user|group)
* @param string $recipient can be both user or group
* @param string $resource
* @param string $space
*
* @return void
* @throws JsonException
* @throws GuzzleException
*/
public function userHasRemovedAccessOfUserOrGroupFromResourceOfSpace(
string $sharer,
string $recipientType,
string $recipient,
string $resource,
string $space
): void {
$response = $this->removeAccessToSpaceItem($sharer, $recipientType, $space, $resource);
$this->featureContext->theHTTPStatusCodeShouldBe(204, "", $response);
}
/**
* @When /^user "([^"]*)" removes the access of (user|group) "([^"]*)" from (?:file|folder|resource) "([^"]*)" of space "([^"]*)" using the Graph API$/
*