简体   繁体   中英

How to test page header tags like meta tag, description etc with laravel dusk browser test?

I want to test the description and the meta tag of a page with a Laravel Dusk browser test. How can I do this? I saw a spider test, but I could not get it work. How can I do this?

I tried a test like this: https://medium.com/@tushargugnani_54389/crawling-website-using-laravel-dusk-spider-bbbbe487a21

您可以将assertSourceHas()与代码的HTML结合使用:

$browser->assertSourceHas('<meta name="description" content="Lorem ipsum.">');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM