In your project’s plugins file: // cypress/plugins/index.jsĬonst extension loader = require('cypress-browser-extension-plugin/loader') module.exports = (on) => In your project’s supports file: // cypress/support/command.jsĬonst addExtensionCommands = require('cypress-browser-extension-plugin/commands') $ npm install -g –save-dev cypress-browser-extension-plugin.Extract the downloaded ZIP in a working directory.Īs we know cypress is a node module so to handle chrome extension we need to add an npm plugin by using the following command, which helps us to test our browser extension without messing with its code just for testing.In chrome browser add a chrome extension CRX Extractor and downloader which enable to download the extension zar.We have multiple ways to get this extension, but here I am using an extractor that enables us to download the extension on the click of our finger: Here we will use Grammarly dev tools chrome extension for this whole exercise. Cypress does not support custom protocols, Cypress only supports web pages with protocol HTTP or HTTPS. So before moving on, As we know chrome extension do have a qualified URL which we can automate by using cypress commands so the first question is, why we need to load an extension?Ĭhrome web store extension URL supports HTTP protocol, but what if we have a EUT (extension under test) unpacked version, normally these extensions supports chrome custom protocol which is chrome://extensions. Here we will see how do we load a chrome extension in cypress.io? In our previous blog Progressive Web App Testing with Cypress.io, we explained:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |