I need to automate an end to end test that include purchase an order with PayPal. This test includes validate some elements in a screen that appears once the order is purchased. I'm currently trying with cypress.io. I know cypress recommend against visiting 3rd party sites but I need to interact with PayPal in this test. I have not been able to deal with it.
Is there any workaround to interact with the PayPal popup when using cypress.io?
Unless you are testing PayPal itself, you should avoid doing this. Cypress make these recommendations for a reason. You run the risk of mistakenly doing financial transactions, and PayPal won't take kindly to you running your app tests against their live server.
If you really need to test how your app works, you should mock up the PayPal API's, so that you can make sure everything works as expected. This might be quite a bit of work to make it behave properly.
If you want to test out some kind of iframe interactivity with PayPal, it's going to be difficult, as the security layer in the browser is likely to prevent cross-domain activity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With