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

Handling failed assertions #39

Open
ju5t opened this issue Feb 16, 2025 · 0 comments
Open

Handling failed assertions #39

ju5t opened this issue Feb 16, 2025 · 0 comments

Comments

@ju5t
Copy link
Contributor

ju5t commented Feb 16, 2025

At the moment when an assertion fails it throws a ProcessFailedException. This helps when debugging PR's, but it's probably not something we'd like to do for the first release of this package.

A solution could be to try/catch it:

try {
    $process = new Process(['npx', 'playwright', 'test', '--reporter=json']);

    $process->mustRun();

    $output = $process->getOutput();
} catch (ProcessFailedException) {
    return new TestResult(false);
}

Doing this in the worker would solve it; but it returns a pretty obscure error:

Failed asserting that false is true

I haven't made the PR for this just yet because of it, but also curious what others think of it.

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

No branches or pull requests

1 participant