Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write tests for critical functionality #14

Open
gunesacar opened this issue May 23, 2022 · 4 comments
Open

Write tests for critical functionality #14

gunesacar opened this issue May 23, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@gunesacar
Copy link
Collaborator

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: microsoft/playwright#7297

@gunesacar gunesacar added the help wanted Extra attention is needed label May 23, 2022
@grundt
Copy link
Contributor

grundt commented Jun 10, 2022

I've been working on an add-on to run tests ... check it out: leak-inspector-tests

@gunesacar
Copy link
Collaborator Author

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.

@grundt
Copy link
Contributor

grundt commented Jun 30, 2022

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.

@gunesacar
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants