leak-inspector
leak-inspector copied to clipboard
Write tests for critical functionality
We should have tests covering (at least) the basic functionality such as sniff detection and leaky request blocking. The simplest way could be to use Selenium, similar to Privacy Badger: https://github.com/EFForg/privacybadger/tree/master/tests
Unfortunately Playwright doesn't (yet) support Firefox add-ons: https://github.com/microsoft/playwright/issues/7297
I've been working on an add-on to run tests ... check it out: leak-inspector-tests
Thank you @grundt. Sorry for the delay due to holidays.
While I understand some of the advantages of using an add-on, I wonder if a fully automated solution is possible, so we can run CI tests against the repo. If you don't have the bandwidth, feel free to leave it as is. Your add-on code will already be very useful even if we choose to go another direction. Thanks so much.
Maybe someone better adept at unit test frameworks can get the ball rolling in that direction.
On a different matter, can you @gunesacar comment on how you'd feel about making modifications to LeakInspector in the way proposed here (i.e. placing LeakInspector "state" somewhere that's accessible from the browser context, solely to support testing)
I could envision expanding beyond just the "badge" state, to also include "popup" state, plus the sniff and leak details, making all of those more easily testable.
On a different matter, can you @gunesacar comment on how you'd feel about making modifications to LeakInspector in the way proposed here (i.e. placing LeakInspector "state" somewhere that's accessible from the browser context, solely to support testing)
I could envision expanding beyond just the "badge" state, to also include "popup" state, plus the sniff and leak details, making all of those more easily testable.
I like that it allows testing the badge state and has potential to do more. I've mixed feelings about exposing additional state -- even though I know that it'll only work on sites in the matches
list (localtest.me
?). I wonder how other extensions are testing similar features.