diff --git a/tests/acceptance/bootstrap/OcmContext.php b/tests/acceptance/bootstrap/OcmContext.php index 4105b0ae68..bf41e1b54b 100644 --- a/tests/acceptance/bootstrap/OcmContext.php +++ b/tests/acceptance/bootstrap/OcmContext.php @@ -70,8 +70,12 @@ class OcmContext implements Context { /** * @return string + * @throws Exception */ public function getLastFederatedInvitationToken():string { + if (empty($this->invitationToken)) { + throw new Exception(__METHOD__ . " token not found"); + } return $this->invitationToken; } @@ -107,8 +111,6 @@ class OcmContext implements Context { $responseData = \json_decode($response->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR); if (isset($responseData["token"])) { $this->invitationToken = $responseData["token"]; - } else { - throw new Exception(__METHOD__ . " response doesn't contain token"); } return $response; } diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 71d9e37844..8d5d6bb1c9 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -259,10 +259,6 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiOcm/share.feature:12](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L12) - [apiOcm/share.feature:91](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/share.feature#L91) -#### [OCM. user cannot see invite description and inviteUser email](https://github.com/owncloud/ocis/issues/9591) - -- [apiOcm/createInvitation.feature:63](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiOcm/createInvitation.feature#L63) - #### [OCM. admin cannot get federated users if he hasn't connection with them ](https://github.com/owncloud/ocis/issues/9829) tests/acceptance/features/apiOcm/searchFederationUsers.feature diff --git a/tests/acceptance/features/apiOcm/createInvitation.feature b/tests/acceptance/features/apiOcm/createInvitation.feature index 7c35d7f206..b7cdf20aee 100755 --- a/tests/acceptance/features/apiOcm/createInvitation.feature +++ b/tests/acceptance/features/apiOcm/createInvitation.feature @@ -60,7 +60,7 @@ Feature: create invitation """ @issue-9591 - Scenario: user creates invitation with email and description + Scenario: user creates invitation with valid email and description Given using server "LOCAL" When "Alice" creates the federation share invitation with email "brian@example.com" and description "a share invitation from Alice" Then the HTTP status code should be "200" @@ -71,8 +71,7 @@ Feature: create invitation "required": [ "expiration", "token", - "description", - "recipient" + "description" ], "properties": { "expiration": { @@ -85,9 +84,6 @@ Feature: create invitation }, "description": { "const": "a share invitation from Alice" - }, - "description": { - "const": "brian@example.com" } } } @@ -124,6 +120,20 @@ Feature: create invitation } """ + + Scenario Outline: user creates invitation with valid/invalid email + Given using server "LOCAL" + When "Alice" creates the federation share invitation with email "" and description "a share invitation from Alice" + Then the HTTP status code should be "" + Examples: + | email | code | + | user@subdomain.example.longdomain | 200 | + | user.bob+123@domain.test-123.com | 200 | + | user.example.com | 400 | + | user@.com | 400 | + | @domain.com | 400 | + | user@domain..com | 400 | + @email Scenario: federated user gets an email notification if their email was specified when creating the federation share invitation Given using server "LOCAL" @@ -134,8 +144,8 @@ Feature: create invitation Alice Hansen (alice@example.org) wants to start sharing collaboration resources with you. Please visit your federation provider and use the following details: - Token: %fed_invitation_token% - ProviderDomain: https://ocis-server:9200 + Token: %fed_invitation_token% + ProviderDomain: https://ocis-server:9200 """ @env-config