如何使用cypress.io处理PayPal弹出窗口上的元素 [英] How to handle elements on PayPal popup with cypress.io

查看:586
本文介绍了如何使用cypress.io处理PayPal弹出窗口上的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要自动化一个端到端测试,包括使用PayPal购买订单.该测试包括验证购买订单后出现的屏幕中的某些元素. 我目前正在使用cypress.io. 我知道赛普拉斯建议不要访问第三方网站但在此测试中,我需要与PayPal进行交互. 我无法处理它.

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.

使用cypress.io时是否可以与PayPal弹出窗口进行交互?

Is there any workaround to interact with the PayPal popup when using cypress.io?

推荐答案

除非您正在测试Paypal本身,否则应避免这样做.赛普拉斯提出这些建议是有原因的.您冒着错误进行财务交易的风险,而贝宝(Paypal)不会对您在其实时服务器上运行应用程序测试表示友好.

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.

如果您确实需要测试应用程序的工作方式,则应模拟Paypal API,以确保一切正常.要使其正常运行,可能需要进行大量工作.

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.

如果您想测试与Paypal的某种iframe交互性,将会很困难,因为浏览器中的安全层很可能会阻止跨域活动.

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.

这篇关于如何使用cypress.io处理PayPal弹出窗口上的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆