new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Playwright · Test runner API · all subjects

test-reporter-api

14 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

TestRun class overview

The TestRun class is available during Reporter.preprocess and controls which tests will run and their expected status. Setup and teardown projects cannot be changed via TestRun.

TestRun.exclude method

The exclude method removes a test or suite from the run. Excluded tests do not appear in the report and their bodies are not executed. The root suite cannot be excluded. Takes a test parameter of type TestCase or Suite.

TestRun.fail method

The fail method marks a test or every test in a suite as 'should fail'. Playwright runs the tests and ensures they are actually failing, which is useful for documenting broken functionality until it is fixed. It takes a test parameter (TestCase or Suite) and an optional reason parameter (string) that is surfaced as the annotation description.

TestRun.fixme method

The fixme method marks a test or every test in a suite as fixme. The test bodies are not executed and the tests are reported as skipped, with the intention to fix them. It takes a test parameter (TestCase or Suite) and an optional reason parameter (string) that is surfaced as the annotation description.

TestRun.skip method

The skip method skips a test or every test in a suite. The test bodies are not executed and the tests are reported as skipped. It takes a test parameter (TestCase or Suite) and an optional reason parameter (string) that is surfaced as the annotation description.

TestRun.skipSharding method

The skipSharding method disables Playwright's built-in shard filter for the run, leaving sharding to the reporter. Reporters typically implement their own sharding by calling TestRun.exclude on out-of-shard tests.

TestRun API availability

TestRun was introduced in v1.62 and is available as a JavaScript API.

TestError.cause property

TestError.cause is an optional property of type TestError that represents the error cause. It is set when there is a cause for the error. The cause will be undefined if there is no cause or if the cause is not an instance of Error. Available since v1.49.

TestError.message property

TestError.message is an optional property of type string that contains the error message. It is set when an Error or its subclass has been thrown. Available since v1.10.

TestError.stack property

TestError.stack is an optional property of type string that contains the error stack trace. It is set when an Error or its subclass has been thrown. Available since v1.10.

TestError.value property

TestError.value is an optional property of type string that represents the value that was thrown. It is set when anything except an Error or its subclass has been thrown. Available since v1.10.

TestError.location property

TestError.location is an optional property of type Location that indicates the error location in the source code. Available since v1.30.

TestError.snippet property

TestError.snippet is an optional property of type string that contains a source code snippet with the error highlighted. Available since v1.33.

TestError class overview

TestError is a class that provides information about an error thrown during test execution. It has properties for the error message, stack trace, thrown value, error cause, source code location, and a code snippet showing the error. Available since v1.10.

Give your agent this brain