Skip to content

Commit 3c02eb3

Browse files
hamza221st3iny
authored andcommitted
test(integration): delete default contact before running autocompletion
Signed-off-by: Hamza <[email protected]>
1 parent c32c26e commit 3c02eb3

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

build/integration/collaboration_features/autocomplete.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Feature: autocomplete
4747
| key | email |
4848
| value | autocomplete@example.com |
4949
And there is a contact in an addressbook
50+
And delete example content
5051
Then get email autocomplete for "example"
5152
| id | source |
5253
| autocomplete | users |
@@ -68,6 +69,7 @@ Feature: autocomplete
6869
| key | email |
6970
| value | autocomplete@example.com |
7071
And there is a contact in an addressbook
72+
And delete example content
7173
And parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
7274
When parameter "shareapi_restrict_user_enumeration_full_match" of app "core" is set to "no"
7375
Then get email autocomplete for "example"

build/integration/features/bootstrap/CollaborationContext.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,23 @@ private function getAutocompleteWithType(int $type, string $search, TableNode $f
6363
}, $suggestions, $formData->getHash()));
6464
}
6565

66+
/**
67+
* @Given /^delete example content$/
68+
*/
69+
public function deleteExampleContact(): void {
70+
$this->usingNewDavPath();
71+
try {
72+
$destination = '/users/admin/contacts/default.vcf';
73+
$this->response = $this->makeDavRequest($this->currentUser, 'DELETE', $destination, []);
74+
} catch (\GuzzleHttp\Exception\ServerException $e) {
75+
// 5xx responses cause a server exception
76+
$this->response = $e->getResponse();
77+
} catch (\GuzzleHttp\Exception\ClientException $e) {
78+
// 4xx responses cause a client exception
79+
$this->response = $e->getResponse();
80+
}
81+
}
82+
6683
/**
6784
* @Given /^there is a contact in an addressbook$/
6885
*/

0 commit comments

Comments
 (0)