Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix batch move modification e2e test #19391

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

pedesen
Copy link
Contributor

@pedesen pedesen commented Jun 14, 2024

Description

This stabilizes the batch move modification e2e test.

Root cause

  • After the migration is triggered, FE polls for /api/batch-operations to check if the operation is finished
  • After the operation is finished, FE fetches the statistics once from api/process-instances/statistics
  • In some cases the operation is finished, but the statistics data is not updated yet on BE side, so FE fetches old statistics
  • In the test there is an assertion that statistics badges in the diagram are updated accordingly
  • In the test the updated data is not fetched and the badges are showing the old data.

In the e2e test we had a mechanism which is supposed to refresh the page every 2 seconds, which didn't work properly

   await expect
      .poll(
        async () => {
          await page.reload();
          ...
        },
        {intervals: [2000], timeout: 30000},
      )
      .toBe(...);

Solution

Instead of trying to refresh the page until the data is visible in the UI, there is now a polling on the /api/process-instances/statistics API endpoint to ensure data is updated, followed by the assertion on the statistics badges in the UI.

Outcome

The batchMoveModification.spec.ts passed in the following test runs:

Related issues

closes #18149

@github-actions github-actions bot added the component/operate Related to the Operate component/team label Jun 14, 2024
@pedesen pedesen force-pushed the fe-18149-fix-batch-modification-e2e-test branch from 64c00f4 to 1bbcc94 Compare June 19, 2024 09:04
@pedesen pedesen marked this pull request as ready for review June 19, 2024 11:46
Copy link
Contributor

@vitorwtavares vitorwtavares left a comment

Choose a reason for hiding this comment

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

This doesn't seem like it was easy to debug, great job! 😄

@pedesen pedesen added this pull request to the merge queue Jun 20, 2024
Merged via the queue into main with commit 25cf180 Jun 20, 2024
33 of 34 checks passed
@pedesen pedesen deleted the fe-18149-fix-batch-modification-e2e-test branch June 20, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/operate Related to the Operate component/team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix E2E test: batchMoveModification.spec.ts > Move Operation
2 participants