#aaditya23-testing-google-pay

1 messages · Page 1 of 1 (latest)

surreal oracle
#

Hi 👋 I'm not familiar with Cypress, is that a browser-driving test framework like Selenium?

obsidian bone
#

Yeah

#

So basically it spins up a fresh chromium browser and runs all the tests on it.

surreal oracle
#

Gotcha, and if you hit your site normally, does Google Pay render as expected?

obsidian bone
#

it works fine when im running normally

surreal oracle
#

I'm not certain, but my suspicion is that Cypress is starting an incognito session, to avoid cookie/session conflicts, which block chromium from accessing your saved payment methods which blocks Google Pay from displaying.

obsidian bone
surreal oracle
#

Yeah, that's going to make things tricky. If that profile is persistent then you might be able to save a card to it. If not you'll either need to find a way to allow Cypress to access your saved cards, or, as you mentioned initially, mock the payment request so you can provide a fabricated response.

obsidian bone
#

Okay. So ill figure out how to mock the payment request API then .
What API call can i look for in the Network tab ?

surreal oracle
obsidian bone
#

I did go through this. I'll it out and see.
Thanks