david001's avatar

how to verify placeholder laravel dusk

Hi, I want to verify placeholder with Laravel dusk, This is my approach and it is not working. Anyone can help me ? Thanks

<input type="text" id="first_name" placeholder="first name">
   ->assertSee('input[placeholder="#first_name"]','first name');
0 likes
8 replies
bugsysha's avatar

Not sure if it will work but I see that you've made a few mistakes. The selector is not valid and you are using the wrong assertion.

->assertSeeIn('input#first_name[placeholder]','first name');

// or

->assertSeeIn('input#first_name','first name');
bugsysha's avatar

Then try following:

->assertSeee('placeholder="first name"');
bugsysha's avatar

Is that located in a blade or in the vue (something else) file?

bugsysha's avatar
bugsysha
Best Answer
Level 61

Then this has to work:

->assertAttribute('#first_name', 'placeholder', 'first name');

Please or to participate in this conversation.