Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add and use Chrome Extensions with Cypress.io?

I'm currently dealing with a an X-Frame-Options issue being blocked when running my Cypress.io tests. I cannot change the server setup to modify the X-Frame settings. Somebody mentioned to me that I should try a chrome extension called "Ignore X-Frame headers."

I have the extension installed on my non-Cypress Chrome, but how do I install it for use in my Cypress.io tests? If I go into developer tools while running a Cypress test, I can see that no extensions are loaded for Cypress/Chrome.

Any ideas on how or IF I can do this? I'm using a Mac.

like image 436
tonyrocks Avatar asked Mar 28 '19 14:03

tonyrocks


2 Answers

You could try to install the extension through Cypress chrome (and enable it).

like image 148
jsdeveloper Avatar answered Feb 02 '23 00:02

jsdeveloper


You can use the before:browser:launch event to load a Chrome extension.

More information on how to use this event here.

like image 44
Diogo Rocha Avatar answered Feb 01 '23 23:02

Diogo Rocha