Dusk: How can I do a search and check for a value returned from Datatables (yajara)

Published 5 months ago by SapporoGuy

Here is what I have tried so far

                    ->waitForText('Search')
                    ->type('search', $default_category_name)
                    ->assertInputValue('search', '')
                    ->assertSee($default_category_name);

But would get a textarea error ... wth?

                    ->waitForText('Search')
                    ->script('window.scrollTo(0,document.body.scrollHeight);')
                    ->waitForText('Last')
                    ->click('#data-table-default-category_last')
//                    ->clickLink('Last')
                    ->assertSee($default_category_name);

But would get an array error.

What I am trying to do is a search on a datatables data.

also, why doesn't dusk/phpunit know that a page is actually beyond the resolution (meaning it needs to scroll)?

Thanks

SapporoGuy

I am not sure what went on here but this is how I solved it.

                    ->waitForText('Search')
                    ->type('input.form-control.input-sm', $default_category_name)
                    ->waitForText('Showing')
                    ->assertSeeLink($default_category_name);

for some reason I needed to declare the class since dusk was not seeing the search type.

Please sign in or create an account to participate in this conversation.