diff --git a/tests/acceptance/bootstrap/OcmContext.php b/tests/acceptance/bootstrap/OcmContext.php index 4105b0ae68d..bf41e1b54b7 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 71d9e378441..8d5d6bb1c9e 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 7c35d7f2062..64cae31adff 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,7 +120,21 @@ Feature: create invitation } """ - @email + + 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 @skip Scenario: federated user gets an email notification if their email was specified when creating the federation share invitation Given using server "LOCAL" When "Alice" has created the federation share invitation with email "brian@example.com" and description "a share invitation from Alice" @@ -133,6 +143,7 @@ Feature: create invitation Hi, 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