Skip to content

[CssSelector] Support has CSS selector #53162

Open
@janopae

Description

@janopae

Description

The has CSS selecter selects the parent of an element that complies to a certain CSS selector. This would be incredibly useful for tests.

https://developer.mozilla.org/en-US/docs/Web/CSS/:has

Example

$tableRowContainingEntity = $table->filter("tr:has(td:contains(\"{$entity->geTitle()}\"))");
self::assertNotEmpty($tableRowContainingEntity);

$secondCell = $tableRowContainingEntity->filter(':nth-child(1)');
self::assertEquals($entity->getDescription(), $secondCell->text());

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions