laracoft's avatar

Call to undefined method Pest\Browser\Api\Webpage::withinIframe()

https://pestphp.com/docs/browser-testing#content-withiniframe

Why do I get the error?

// pestphp/pest                                 4.1.0    
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Pest\Browser\Api\PendingAwaitablePage;

test('example', function () {
    $page = visit('https://example.com')
        ->press('Get tickets');

    $page->withinIframe('.iframe-container', function (PendingAwaitablePage $page) {
        $page->type('frame-input', 'Hello iframe')
            ->click('frame-button');
    });
});
0 likes
2 replies
Nakov's avatar
Nakov
Best Answer
Level 73

Looks like their documentation is wrong. You can try withinFrame instead of withinIframe

laracoft's avatar

thanks, I was about to ask why I can't find an instance of withinIframe in all my folders

Please or to participate in this conversation.