Skip to content

feature: add HTML matching methods#2147

Merged
BobrImperator merged 1 commit intomainmatter:masterfrom
cvx:has-html
Nov 10, 2024
Merged

feature: add HTML matching methods#2147
BobrImperator merged 1 commit intomainmatter:masterfrom
cvx:has-html

Conversation

@cvx
Copy link
Contributor

@cvx cvx commented Nov 10, 2024

Examples:

assert.dom('h1').hasHtml('A <b>great</b> thing');
assert.dom('section').doesNotHaveHtml('<b>fantastic</b>');

assert.dom('#title').includesHtml('<b>nice</b>');
assert.dom('#title').doesNotIncludeHtml('<i>nope</i>');

closes #2025

Examples:

```js
assert.dom('h1').hasHtml('A <b>great</b> thing');
assert.dom('section').doesNotHaveHtml('<b>fantastic</b>');

assert.dom('#title').includesHtml('<b>nice</b>');
assert.dom('#title').doesNotIncludeHtml('<i>nope</i>');
```

closes mainmatter#2025
Copy link
Contributor

@BobrImperator BobrImperator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks heaps

@BobrImperator BobrImperator merged commit 8c618e0 into mainmatter:master Nov 10, 2024
@github-actions github-actions bot mentioned this pull request Nov 10, 2024
@MrChocolatine
Copy link

These are really cool additions. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add hasHtml to assert an element has specific HTML

3 participants