How to handle elements on PayPal popup with cypress.io

南楼画角 提交于 2020-01-25 06:47:08

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/59667218/how-to-handle-elements-on-paypal-popup-with-cypress-io

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!