Skip to content

Commit

Permalink
Extend notification tests scenario for different language (owncloud#6365
Browse files Browse the repository at this point in the history
)
  • Loading branch information
amrita-shrestha authored and 2403905 committed May 31, 2023
1 parent 7094891 commit d10fe11
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 27 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,5 @@ require (
)

replace github.com/cs3org/go-cs3apis => github.com/2403905/go-cs3apis v0.0.0-20230517122726-727045414fd1

replace github.com/cs3org/reva/v2 => github.com/2403905/reva/v2 v2.0.0-20230531095337-57e32e8ecc16
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/2403905/go-cs3apis v0.0.0-20230517122726-727045414fd1 h1:dOIG9lXUo5CAZbjlegvZpeTqfAlH+zn+0uXbtlZjCPY=
github.com/2403905/go-cs3apis v0.0.0-20230517122726-727045414fd1/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/2403905/reva/v2 v2.0.0-20230531095337-57e32e8ecc16 h1:XDhWRm0S1ET8X2lePYxXFQdLNykbGOT0Wi2tDVgAm4Y=
github.com/2403905/reva/v2 v2.0.0-20230531095337-57e32e8ecc16/go.mod h1:vMQqSn30fEPHO/GKC2WmGimlOPqvfSy4gdhRSpbvrWc=
github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k=
github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck=
Expand Down Expand Up @@ -629,8 +631,6 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo
github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4=
github.com/crewjam/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc=
github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA=
github.com/cs3org/reva/v2 v2.13.4-0.20230526111208-d62d1497abb9 h1:JuZPMzFl6Yr2PIlT7mIYJ+S++AS3PQoRcYyA1tsH2DI=
github.com/cs3org/reva/v2 v2.13.4-0.20230526111208-d62d1497abb9/go.mod h1:vMQqSn30fEPHO/GKC2WmGimlOPqvfSy4gdhRSpbvrWc=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
Expand Down
12 changes: 2 additions & 10 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,8 @@ Synchronization features like etag propagation, setting mtime and locking files

File and sync features in a shared scenario

#### [ocs sharing api always returns an empty exact list while searching for a sharee](https://github.com/owncloud/ocis/issues/4265)

- [coreApiSharees/sharees.feature:100](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharees/sharees.feature#L100)
- [coreApiSharees/sharees.feature:101](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharees/sharees.feature#L101)
- [coreApiSharees/sharees.feature:120](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharees/sharees.feature#L120)
- [coreApiSharees/sharees.feature:121](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharees/sharees.feature#L121)
- [coreApiSharees/sharees.feature:140](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharees/sharees.feature#L140)
- [coreApiSharees/sharees.feature:141](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharees/sharees.feature#L141)
- [coreApiSharees/sharees.feature:160](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharees/sharees.feature#L160)
- [coreApiSharees/sharees.feature:161](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharees/sharees.feature#L161)
#### Contain the remotes list in response to getting sharees while searching

- [coreApiSharees/sharees.feature:180](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharees/sharees.feature#L180)
- [coreApiSharees/sharees.feature:181](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiSharees/sharees.feature#L181)

Expand Down
43 changes: 43 additions & 0 deletions tests/acceptance/features/apiNotification/notification.feature
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,46 @@ Feature: Notification
| resource |
| textfile1.txt |
| my_data |


Scenario Outline: get a notification about a file share in various languages
Given user "Brian" has switched the system language to "<language>"
And user "Alice" has shared entry "textfile1.txt" with user "Brian" with permissions "17"
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
"""
{
"type": "object",
"required": [
"message"
],
"properties": {
"message": {
"type": "string",
"enum": [
"<message>"
]
}
}
}
"""
Examples:
| language | subject | message |
| de | Neue Freigabe | Alice Hansen hat textfile1.txt mit Ihnen geteilt |
| en | Resource shared | Alice Hansen shared textfile1.txt with you |
| es | Recurso compartido | Alice Hansen compartió textfile1.txt contigo |


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 "Brian" has accepted share "/<resource>" offered by user "Alice"
And user "Alice" has unshared entity "<resource>" shared to "Brian"
And user "Alice" has deleted entity "/<resource>"
When user "Brian" lists all notifications
Then the HTTP status code should be "200"
And the notifications should be empty
Examples:
| resource |
| textfile1.txt |
| my_data |
11 changes: 11 additions & 0 deletions tests/acceptance/features/bootstrap/NotificationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ public function userListAllNotifications(string $user):void {
$this->featureContext->setResponse($response);
}

/**
* @Then the notifications should be empty
*
* @return void
* @throws Exception
*/
public function theNotificationsShouldBeEmpty(): void {
$notifications = $this->featureContext->getJsonDecodedResponseBodyContent()->ocs->data;
Assert::assertNull($notifications, "response should not contain any notification");
}

/**
* @Then /^the JSON response should contain a notification message with the subject "([^"]*)" and the message-details should match$/
*
Expand Down
16 changes: 7 additions & 9 deletions tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -3354,16 +3354,16 @@ public function userDeletesFile(string $user, string $file):void {
}

/**
* @Given /^user "([^"]*)" has (deleted|unshared) (file|folder) "([^"]*)"$/
* @Given /^user "([^"]*)" has (deleted|unshared) (?:file|folder|entity) "([^"]*)"$/
*
* @param string $user
* @param string $deletedOrUnshared
* @param string $fileOrFolder
* @param string $entry
*
* @return void
* @throws Exception
*/
public function userHasDeletedFile(string $user, string $deletedOrUnshared, string $fileOrFolder, string $entry):void {
public function userHasDeletedFile(string $user, string $deletedOrUnshared, string $entry):void {
$user = $this->getActualUsername($user);
$this->userDeletesFile($user, $entry);
// If the file or folder was there and got deleted then we get a 204
Expand All @@ -3380,30 +3380,28 @@ public function userHasDeletedFile(string $user, string $deletedOrUnshared, stri

$this->theHTTPStatusCodeShouldBe(
["204"],
"HTTP status code was not 204 while trying to $deleteText $fileOrFolder '$entry' for user '$user'"
"HTTP status code was not 204 while trying to $deleteText resource '$entry' for user '$user'"
);
$this->emptyLastHTTPStatusCodesArray();
}

/**
* @Given /^user "([^"]*)" has (deleted|unshared) the following (files|folders|resources)$/
* @Given /^user "([^"]*)" has (deleted|unshared) the following (?:files|folders|resources)$/
*
* @param string $user
* @param string $deletedOrUnshared
* @param string $fileOrFolder
* @param TableNode $table
*
* @return void
* @throws Exception
*/
public function userHasDeletedFollowingFiles(string $user, string $deletedOrUnshared, string $fileOrFolder, TableNode $table):void {
public function userHasDeletedFollowingFiles(string $user, string $deletedOrUnshared, TableNode $table):void {
$this->verifyTableNodeColumns($table, ["path"]);
$paths = $table->getHash();

foreach ($paths as $file) {
$this->userHasDeletedFile($user, $deletedOrUnshared, $fileOrFolder, $file["path"]);
$this->userHasDeletedFile($user, $deletedOrUnshared, $file["path"]);
}
$this->emptyLastHTTPStatusCodesArray();
}

/**
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1
github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1
github.com/cs3org/go-cs3apis/cs3/tx/v1beta1
github.com/cs3org/go-cs3apis/cs3/types/v1beta1
# github.com/cs3org/reva/v2 v2.13.4-0.20230526111208-d62d1497abb9
# github.com/cs3org/reva/v2 v2.13.4-0.20230526111208-d62d1497abb9 => github.com/2403905/reva/v2 v2.0.0-20230531095337-57e32e8ecc16
## explicit; go 1.19
github.com/cs3org/reva/v2/cmd/revad/internal/grace
github.com/cs3org/reva/v2/cmd/revad/runtime
Expand Down Expand Up @@ -2160,3 +2160,4 @@ stash.kopano.io/kgol/oidc-go
## explicit; go 1.13
stash.kopano.io/kgol/rndm
# github.com/cs3org/go-cs3apis => github.com/2403905/go-cs3apis v0.0.0-20230517122726-727045414fd1
# github.com/cs3org/reva/v2 => github.com/2403905/reva/v2 v2.0.0-20230531095337-57e32e8ecc16

0 comments on commit d10fe11

Please sign in to comment.