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

[BUG] Step is marked as failed despite it's passed (when try/catch block is used) #23979

Closed
Sysqwerty opened this issue Jun 30, 2023 · 0 comments · Fixed by #24054
Closed

[BUG] Step is marked as failed despite it's passed (when try/catch block is used) #23979

Sysqwerty opened this issue Jun 30, 2023 · 0 comments · Fixed by #24054
Assignees
Labels

Comments

@Sysqwerty
Copy link

Sysqwerty commented Jun 30, 2023

System info

  • Playwright Version: [v1.35.0]
  • Operating System: [All]
  • Browser: [All]

Source code

widgetLoadingContainer - Locator of an UI element (could be single or many)

public async waitLoadersHidden() {
        try {
            await this.widgetLoadingContainer.first().waitFor();
        } catch (error) {}

        for (const dot of await this.widgetLoadingContainer.all()) {
            await dot.waitFor({ state: 'hidden' });
        }
    }

Here we wait for first element is visible (default action time = 5 seconds)
Once first element is 'visible' -> we take all of them and wait each one has 'hidden' state immediately
If element wasn't 'visible' during 5 seconds -> we take all of them and wait each one has 'hidden' state
Sometimes element(s) is not visible and it's ok.
But in this cases try is failed -> the step is also marked as 'failed' in the reporting (when by fact it's passed).

Steps

  • [Run a test with step that has failed action/verification surrounding with try/catch block]

Expected

The step is marked as passed

Actual

The step is marked as failed

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants