0

I am compiling a test case related to bootstrap daterange-picker in Laravel Dusk. In my test case I need to select two dates and click on apply button.

My code looks like:

$browser
    ->within('.drp-calendar .left', function ($browser) {
        $browser->within('.table-condensed', function ($browser) {
           $browser->within('tbody', function ($browser) {
             $browser->script("$('td[data-title=\\'r1c0\\']').click()");
            });
        });
    })
    ->within('.drp-calendar .right', function ($browser) {
        $browser->within('.table-condensed', function ($browser) {
           $browser->within('tbody', function ($browser) {
             $browser->script("$('td[data-title=\\'r3c4\\']').click()");
            });
        });
    })
    ->click('.drp-buttons > .applyBtn');

I am not getting any error but when apply button is clicked it is not selecting the desired dates. Or you can say the JQuery part is not click. Since I'm using external bootstrap package so I am unable to define dusk selectors, to achieve this I'm trying to click through data attributes.

EDIT

I took screenshot just above the jQuery statement and I can see my calendar is properly visible.

enter image description here

Any suggestions are welcomed. Thanks

4

0 回答 0