1
0
mirror of https://github.com/owncloud/ocis.git synced 2026-10-23 23:29:02 +03:00

[tests-only][full-ci] test: add retry once for space creation wherever required (#12785)

test: add retry once for space creation

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
This commit is contained in:
Nalem7
2026-08-14 12:11:34 +05:45
committed by GitHub
parent 6dc967e583
commit 86105b86af
2 changed files with 15 additions and 2 deletions

View File

@@ -1929,11 +1929,12 @@ class SpacesContext implements Context {
}
/**
* @Given /^user "([^"]*)" has created a space "([^"]*)"(| in vault)? with the default quota using the Graph API$/
* @Given /^user "([^"]*)" has created a space "([^"]*)"(| in vault)?(| with retry) with the default quota using the Graph API$/
*
* @param string $user
* @param string $spaceName
* @param string $isVault
* @param string $withRetry
*
* @return void
*
@@ -1944,10 +1945,22 @@ class SpacesContext implements Context {
string $user,
string $spaceName,
string $isVault,
string $withRetry,
): void {
$space = ["name" => $spaceName];
$isVault = trim($isVault) === "in vault";
$withRetry = trim($withRetry) === "with retry";
// The user role may take some time to update
// This can cause an unauthorized error
// Retry once after 1 second
$response = $this->createSpace($user, $space, $isVault);
if ($withRetry && $response->getStatusCode() === 401) {
sleep(1); // Wait 1 second before retrying.
$response = $this->createSpace($user, $space, $isVault);
}
$this->featureContext->theHTTPStatusCodeShouldBe(
201,
"Expected response status code should be 201 (Created)",

View File

@@ -834,7 +834,7 @@ Feature: collaboration (wopi)
Scenario: user with Viewer role tries to create a odt file inside shared project space using wopi endpoint
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has created a space "new-space" with retry with the default quota using the Graph API
And user "Alice" has created a folder "testFolder" in space "new-space"
And user "Alice" has sent the following space share invitation:
| space | new-space |