ExpectDecorator
Playwright\Testing\ExpectDecorator
Decorator for Expect that automatically increments PHPUnit assertion count when available. This allows the Expect class to work independently (without PHPUnit) while still counting assertions properly when used within PHPUnit tests.
implements ExpectInterface
Methods
__construct()
function __construct( private readonly ExpectInterface $expect, private readonly ?object $testCase = null, )
toBeAttached()
voidfunction toBeAttached(): void
toBeVisible()
voidfunction toBeVisible(): void
toBeHidden()
voidfunction toBeHidden(): void
toHaveText()
voidfunction toHaveText(string $text): void
toContainText()
voidfunction toContainText(string $text): void
toHaveExactText()
voidfunction toHaveExactText(string $text): void
toHaveValue()
voidfunction toHaveValue(string $value): void
toHaveAttribute()
voidfunction toHaveAttribute(string $name, string $value): void
toBeChecked()
voidfunction toBeChecked(): void
toBeEnabled()
voidfunction toBeEnabled(): void
toBeDisabled()
voidfunction toBeDisabled(): void
toHaveCSS()
voidfunction toHaveCSS(string $name, string $value): void
toHaveId()
voidfunction toHaveId(string $id): void
toHaveClass()
voidfunction toHaveClass(string|array $class): void
toBeEmpty()
voidfunction toBeEmpty(): void
toHaveCount()
voidfunction toHaveCount(int $count): void
toBeFocused()
voidfunction toBeFocused(): void
toHaveFocus()
voidfunction toHaveFocus(): void
toHaveTitle()
voidfunction toHaveTitle(string $title): void
toHaveURL()
voidfunction toHaveURL(string $url): void
not()
selffunction not(): self
withTimeout()
selffunction withTimeout(int $timeoutMs): self
withPollInterval()
selffunction withPollInterval(int $pollIntervalMs): self