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.