Skip to content

api-test: replace sleeps with WaitHelper poll for async state - #3239

Merged
v-scharf merged 2 commits into
mainfrom
test/wait-until-poll-helper
Aug 5, 2026
Merged

api-test: replace sleeps with WaitHelper poll for async state#3239
v-scharf merged 2 commits into
mainfrom
test/wait-until-poll-helper

Conversation

@v-scharf

@v-scharf v-scharf commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

fixed:

[FAILED] Total unexpected failed scenarios:
- apiSearchContent/extractedProps.feature:298
- apiSearchContent/extractedProps.feature:426

Tests were failed because property extraction is asynchronous and sleep(2) didn't help

Scenario: GET extracted properties of an image file (Shares space)                                             # /woodpecker/src/github.com/opencloud-eu/opencloud/tests/acceptance/features/apiSearchContent/extractedProps.feature:426
    Given user "Brian" has been created with default attributes                                                  # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And user "Alice" has uploaded a file "filesForUpload/testavatar.jpg" to "testavatar.jpg" in space "Personal" # SpacesContext::userHasUploadedAFileToInSpaceUsingTheWebdavApi()
    And user "Alice" has sent the following resource share invitation:                                           # SharingNgContext::userHasSentTheFollowingResourceShareInvitation()
      | resource        | testavatar.jpg |
      | space           | Personal       |
      | sharee          | Brian          |
      | shareType       | user           |
      | permissionsRole | Viewer         |
    And user "Brian" has a share "testavatar.jpg" synced                                                         # SharingNgContext::userHasShareSynced()
      │ [INFO] Wait for share sync status...
    When user "Brian" gets the file "testavatar.jpg" from space "Shares" using the Graph API                     # SpacesContext::userGetsTheDriveItemInSpace()
    Then the HTTP status code should be "200"                                                                    # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And the JSON data of the response should match                                                               # FeatureContext::theJsonDataOfTheResponseShouldMatch()
      """
        {
          "type": "object",
          "required": [
            "image",
            "location",
            "photo"
          ],
          "properties": {
            "image": {
              "type": "object",
              "required": [ "height", "width" ],
              "properties": {
                "height": {
                  "const": 500
                },
                "width": {
                  "const": 1402
                }
              }
            },
            "location": {
              "type": "object",
              "required": [ "latitude", "longitude" ],
              "properties": {
                "latitude": {
                  "const": 52.437804
                },
                "longitude": {
                  "const": 13.341866
                }
              }
            },
            "photo": {
              "type": "object",
              "required": [
                "cameraMake",
                "cameraModel",
                "fNumber",
                "focalLength",
                "orientation"
              ],
              "properties": {
                "cameraMake": {
                  "const": "NIKON"
                },
                "cameraModel": {
                  "const": "COOLPIX P6000"
                },
                "fNumber": {
                  "const": 4.5
                },
                "focalLength": {
                  "const": 6
                },
                "orientation": {
                  "const": 1
                }
              }
            }
          }
        }
      """
      JSON Schema validation failed:
      1. {root}->required:
      	 - Required property missing: id
      	   Received: eTag, file, id, lastModifiedDateTime, name, parentReference, size, webUrl

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@v-scharf
v-scharf requested a review from saw-jan August 4, 2026 13:19

@saw-jan saw-jan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@v-scharf
v-scharf merged commit 76ff13b into main Aug 5, 2026
53 of 54 checks passed
@v-scharf
v-scharf deleted the test/wait-until-poll-helper branch August 5, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants