Our team is using Playwright projects and has multiple projects (e.g. "main" and "new"). In CI, we are adding logic to only run a subset of playwright tests. The subset is determined from the pull request diff and which e2e tests cover the areas with changed files.
The problem we are encountering is sometimes when we select a subset of tests there ends up being 0 tests in a given project e.g. there are 0 tests in the "new" project to run. We kick off separate playwright commands to run tests in our different projects. The command to run tests in the "new" project fails with an error: "No tests found". This is expected in our case. How do we tell Playwright to pass when there are 0 tests in a project?
Playwright has an option --pass-with-no-tests
for just this purpose. When specified, it allows the test suite to pass even if there are 0 tests in the suite. See docs here: https://playwright.dev/docs/test-cli