i'm setting up an phpunit test to walk trough a checkout. Now im struggling with the stripe iFrame. How can i access it?
I've created a DuskServiceProvider and registered it in AppServiceProvider.
public function boot()
{
Browser::macro('reloadPage', function ($element = null) {
$this->script('location.reload()');
return $this;
});
Browser::macro('switchFrame', function ($frame) {
$this->driver->switchTo()->defaultContent()->switchTo()->frame($frame);
return $this;
});
Browser::macro('switchToParentFrame', function () {
$this->driver->switchTo()->defaultContent()->switchTo()->defaultContent();
return $this;
});
}
this is the method where the error comes from. The "waitFor" waits for the Frame.
public function paymentNewCostumer()
{
$this->browse(function (Browser $browser) {
$browser
->assertSee('WÄHLE DEINE ZAHLUNGSART')
->waitFor('iframe[name=__privateStripeFrame5]')
$browser->switchFrame('__privateStripeFrame5');
//do some stuff in frame..
});
}
after that i should be able inserting some credit card information in those field but got the following error..
Tests\Browser\Packages\Checkout\CheckoutDesktopNewCostumerTest::testNewCostumerDesktop Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session/5180c633d44eca82adb0c51f7ace803e/log with params: {"type":"browser"}
Operation timed out after 30000 milliseconds with 0 bytes received
/home/vagrant/faaren/backend/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:297 /home/vagrant/faaren/backend/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:565 /home/vagrant/faaren/backend/vendor/facebook/webdriver/lib/Remote/RemoteExecuteMethod.php:40 /home/vagrant/faaren/backend/vendor/facebook/webdriver/lib/WebDriverOptions.php:156 /home/vagrant/faaren/backend/vendor/laravel/dusk/src/Browser.php:306 /home/vagrant/faaren/backend/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:154 /home/vagrant/faaren/backend/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/faaren/backend/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:155 /home/vagrant/faaren/backend/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:77 /home/vagrant/faaren/backend/tests/Browser/Packages/Checkout/CheckoutDesktopNewCostumerTest.php:99 /home/vagrant/faaren/backend/tests/Browser/Packages/Checkout/CheckoutDesktopNewCostumerTest.php:55 /home/vagrant/faaren/backend/tests/Browser/Packages/Checkout/CheckoutDesktopNewCostumerTest.php:30