0

I have a chrome extension which I'd like to E2E test (simulate some basic user interactions).

Using Cypress, I was able to load my app but couldn't interact with it (i.e. go to the app url using the chrome-extension:// protocol).

Then I found out that Cypress (like many others testing frameworks) is not able to approach the chrome:// protcol, yet, as far as I get it, I need the chrome.runtime api to be included somehow for my app to behave as expected (e.g. interact with background page or use the local storage) and that can't be achived by simply clicking my popup.html file on the other hand.

I feel like I'm missing something here. How should I test my Chrome extension with ease? There must be some good practice for it, launching and treat it like a usual webpage.

Thanks

Tamir Nakar
  • 693
  • 1
  • 7
  • 14
  • 1
    Does this answer your question? [Detect and test Chrome Extension using Puppeteer](https://stackoverflow.com/questions/48089670/detect-and-test-chrome-extension-using-puppeteer) – voiarn Jan 01 '22 at 14:34
  • Thanks voiarn, I already read this, and tried puppeteer, but encountered some other problems. I'd like to know if there is a more straightforward way – Tamir Nakar Jan 01 '22 at 14:38
  • Thanks voiarn, I did something wrong the last time I used pupeteer. Its indeed the easiest way to test e2e chrome extensitons. – Tamir Nakar Jan 14 '22 at 21:35

1 Answers1

0

OK.

So after countless tryouts I've came to a conclusion that the best testing platform for browser extensions - offering a straight-forward way to load the extension (and also use the chrome:// protocol) is indeed - puppeteer (tried cypress and selenium as well)

Tamir Nakar
  • 693
  • 1
  • 7
  • 14