Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test email html crawler and assertions #1

Open
kbond opened this issue Jan 18, 2021 · 0 comments
Open

Test email html crawler and assertions #1

kbond opened this issue Jan 18, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@kbond
Copy link
Member

kbond commented Jan 18, 2021

Would be nice to access the crawler and make assertions on the html:

$email->html()->crawler(); // Symfony\Component\DomCrawler\Crawler

$email->html() // same assertion API as zenstruck/browser
    ->assertSee('some text')
    ->assertNotSee('some text')
    ->assertSeeIn('h1', 'some text')
    ->assertNotSeeIn('h1', 'some text')
    ->assertSeeElement('h1')
    ->assertNotSeeElement('h1')
    ->assertElementCount('ul li', 2)
    ->assertElementAttributeContains('head meta[name=description]', 'content', 'my description')
    ->assertElementAttributeNotContains('head meta[name=description]', 'content', 'my description')
;
@kbond kbond added the enhancement New feature or request label Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant