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] test.fail() skips test that should be failed and expects other test to fail #29104

Closed
elena-golovkova opened this issue Jan 22, 2024 · 0 comments · Fixed by #29112
Closed

Comments

@elena-golovkova
Copy link

elena-golovkova commented Jan 22, 2024

System info

  • Playwright Version: [v1.41.1]
  • Operating System: [Windows 11.]
  • Browser: [Chromium]
  • Other info:

Source code

Steps
Precondition: test.describe with 2 tests. One should pass, other should fail.

  1. Mark test that should fail as test.fail()
  2. Run test file
import { test } from '@playwright/test';

test.describe('Describe', () => {
  test('should pass', async ({ page }) => {
    await page.goto('https://playwright.dev/');
  });

  test.fail('should fail', async ({ page }) => {
    await page.goto('https://playwright.dev/');
    await page.locator('.class').click();
  });
});

Expected
1 test pass, 1 test marked as fail

Actual
Only one test in the report (should pass test). And it marked as failed with error message: Expected to fail, but passed (Image is attached).
[Describe actual behavior]
failtest

@elena-golovkova elena-golovkova changed the title [BUG] test.fail() skips test that should be failed anf expects other test to fail [BUG] test.fail() skips test that should be failed and expects other test to fail Jan 22, 2024
yury-s added a commit to yury-s/playwright that referenced this issue Jan 23, 2024
yury-s added a commit to yury-s/playwright that referenced this issue Jan 23, 2024
yury-s added a commit that referenced this issue Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant