Skip to content

Conversation

@anon-pradip
Copy link

@anon-pradip anon-pradip commented Jul 21, 2025

Description

CI is being flaky wile creating .txt file: https://ci.opencloud.eu/repos/3/pipeline/2357/314

Scenario: Upload files in personal space # tests/e2e/cucumber/features/smoke/upload.feature:14
    Given "Admin" creates following user using API
      │ id    │
      │ Alice │
    And "Alice" logs in
    And "Alice" opens the "files" app
    Given "Alice" creates the following resources
      │ resource          │ type    │ content             │
      │ new-lorem-big.txt │ txtFile │ new lorem big file  │
      │ lorem.txt         │ txtFile │ lorem file          │
      │ textfile.txt      │ txtFile │ some random content │
      │ comma,.txt        │ txtFile │ comma               │
      │ test#file.txt     │ txtFile │ some content        │
      │ test#folder       │ folder  │                     │
    ✖ failed
      locator.waitFor: Timeout 30000ms exceeded.
      Call log:
        - waiting for locator(':is(#files-files-table, .oc-tiles-item, #files-shared-with-me-accepted-section, .files-table) [data-test-resource-name="comma,.txt"]') to be visible

          at editTextDocument (/woodpecker/src/github.com/opencloud-eu/opencloud/webTestRunner/tests/e2e/support/objects/app-files/resource/actions.ts:433:65)
          at async createNewFileOrFolder (/woodpecker/src/github.com/opencloud-eu/opencloud/webTestRunner/tests/e2e/support/objects/app-files/resource/actions.ts:247:13)
          at async Module.createResources (/woodpecker/src/github.com/opencloud-eu/opencloud/webTestRunner/tests/e2e/support/objects/app-files/resource/actions.ts:421:5)
          at async Resource.create (/woodpecker/src/github.com/opencloud-eu/opencloud/webTestRunner/tests/e2e/support/objects/app-files/resource/index.ts:10:9)
          at async World.<anonymous> (/woodpecker/src/github.com/opencloud-eu/opencloud/webTestRunner/tests/e2e/cucumber/steps/ui/resources.ts:11:9)

This is also flaky in local environment because:

  • we pass the file name along with extension (like lorem.txt) from test step
  • but the resource name input field while creating a new resource already comes with the extension of chosen file type.
  • this creates the file name with two extensions like lorem.txt.txt
flakiness.mp4

What we have used is: await page.locator(resourceNameInput).fill(name) but the .fill() method of playwright is flaky in itself: microsoft/playwright#36395

So as a fix, this PR adds await page.locator(resourceNameInput).selectText() to select all what exists in the resource input field and then only fills what comes from the test step (i.e resource name with extension) so that we can only have what is sent from the test step, which removes the creation of double file extensions.

Related Issue

  • Fixes <issue_link>

How Has This Been Tested?

  • test environment:
    Locally I have tested this change for up-to 20 iterations without getting any failures.

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

Copilot AI review requested due to automatic review settings July 21, 2025 13:09

This comment was marked as outdated.

@anon-pradip anon-pradip self-assigned this Jul 21, 2025
@anon-pradip anon-pradip force-pushed the test/fix-flakiness-while-filling-resource-name branch from 84b20d2 to 2ccd32f Compare July 21, 2025 13:31
@anon-pradip anon-pradip requested a review from Copilot July 21, 2025 13:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes flakiness in e2e tests when creating text files by addressing issues with resource name input handling. The fix prevents double file extensions and improves the reliability of the file creation process.

  • Adds selectText() call before filling the resource name input to clear existing content
  • Prevents creation of files with double extensions (e.g., lorem.txt.txt)
  • Improves test stability by ensuring clean input field state

@ScharfViktor
Copy link
Contributor

Oh, I see that a similar fix was already made here: #982
Since that PR was merged first, I think we can close this one. Thanks!

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.

3 participants