diff --git a/build/integration/features/bootstrap/Activity.php b/build/integration/features/bootstrap/Activity.php new file mode 100644 index 00000000000..466b2dde14e --- /dev/null +++ b/build/integration/features/bootstrap/Activity.php @@ -0,0 +1,30 @@ +sendRequestForJSON('GET', '/apps/activity/api/v2/activity'); + $this->theHTTPStatusCodeShouldBe('200'); + $data = json_decode($this->response->getBody()->getContents(), true); + $activities = $data['ocs']['data']; + $lastActivity = array_pop($activities); + foreach ($activity->getRowsHash() as $key => $value) { + Assert::assertEquals($value, $lastActivity[$key]); + } + } +} diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index 57d18757212..a8c232d6fe7 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -192,8 +192,8 @@ trait BasicStructure { $options = []; if ($this->currentUser === 'admin') { $options['auth'] = ['admin', 'admin']; - } elseif (strpos($this->currentUser, 'guest') !== 0) { - $options['auth'] = [$this->currentUser, self::TEST_PASSWORD]; + } elseif (strpos($this->currentUser, 'anonymous') !== 0) { + $options['auth'] = [$this->currentUser, $this->regularUser]; } if ($body instanceof TableNode) { $fd = $body->getRowsHash(); diff --git a/build/integration/features/bootstrap/SharingContext.php b/build/integration/features/bootstrap/SharingContext.php index d2f1a2446ae..8ef617adbfb 100644 --- a/build/integration/features/bootstrap/SharingContext.php +++ b/build/integration/features/bootstrap/SharingContext.php @@ -17,6 +17,7 @@ class SharingContext implements Context, SnippetAcceptingContext { use Trashbin; use AppConfiguration; use CommandLine; + use Activity; protected function resetAppConfigs() { $this->deleteServerConfig('core', 'shareapi_default_permissions'); diff --git a/build/integration/sharing_features/sharing-activity.feature b/build/integration/sharing_features/sharing-activity.feature index 67f2d9fd79b..5757b210134 100644 --- a/build/integration/sharing_features/sharing-activity.feature +++ b/build/integration/sharing_features/sharing-activity.feature @@ -14,7 +14,7 @@ Feature: sharing | notify_setting_batchtime | 0 | | activity_digest | 0 | - Scenario: Creating a new mail share + Scenario: Creating a new mail share and check activity Given dummy mail server is listening And As an "user0" When creating a share with @@ -24,8 +24,13 @@ Feature: sharing Then the OCS status code should be "100" And the HTTP status code should be "200" And last share can be downloaded + Then last activity should be + | app | files_sharing | + | type | public_links | + | object_type | files | + | object_name | /welcome.txt | - Scenario: Creating a new public share + Scenario: Creating a new public share and check activity Given user "user0" exists And As an "user0" When creating a share with @@ -34,3 +39,8 @@ Feature: sharing Then the OCS status code should be "100" And the HTTP status code should be "200" And last link share can be downloaded + Then last activity should be + | app | files_sharing | + | type | public_links | + | object_type | files | + | object_name | /welcome.txt |