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()

void
function toBeAttached(): void

toBeVisible()

void
function toBeVisible(): void

toBeHidden()

void
function toBeHidden(): void

toHaveText()

void
function toHaveText(string $text): void

toContainText()

void
function toContainText(string $text): void

toHaveExactText()

void
function toHaveExactText(string $text): void

toHaveValue()

void
function toHaveValue(string $value): void

toHaveAttribute()

void
function toHaveAttribute(string $name, string $value): void

toBeChecked()

void
function toBeChecked(): void

toBeEnabled()

void
function toBeEnabled(): void

toBeDisabled()

void
function toBeDisabled(): void

toHaveCSS()

void
function toHaveCSS(string $name, string $value): void

toHaveId()

void
function toHaveId(string $id): void

toHaveClass()

void
function toHaveClass(string|array $class): void

toBeEmpty()

void
function toBeEmpty(): void

toHaveCount()

void
function toHaveCount(int $count): void

toBeFocused()

void
function toBeFocused(): void

toHaveFocus()

void
function toHaveFocus(): void

toHaveTitle()

void
function toHaveTitle(string $title): void

toHaveURL()

void
function toHaveURL(string $url): void

not()

self
function not(): self

withTimeout()

self
function withTimeout(int $timeoutMs): self

withPollInterval()

self
function withPollInterval(int $pollIntervalMs): self