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

Add tests #7

Open
2 tasks
cxw42 opened this issue Mar 13, 2018 · 10 comments
Open
2 tasks

Add tests #7

cxw42 opened this issue Mar 13, 2018 · 10 comments

Comments

@cxw42
Copy link
Collaborator

cxw42 commented Mar 13, 2018

Per discussion with @gregsadetsky. It would be nice to have some!

  • Consolidate the list of sites people have reported here and on the Web Store
    • Report these sites via the wiki page
    • Edit To clarify, this thread is not the place to report specific sites :) . This thread is for figuring out how we are going to implement the tests.
  • Add tests to detect when the extension stops working on those sites

It's tricky, though, since we can't access (or even navigate to!) the pertinent settings page (link here - go there and try clicking! see what happens).

We can, however, loop over a list of testcases (e.g., document.querySelector('.wiki-content table') in the wiki page) and, for each:

  • open that site in a new window
  • onload (i.e., after our content script has run), check to see if we touched the page
  • if not, report an error

I have used Jasmine, which I believe would not have a problem with this type of test. It has asynchronous support, so we could bounce messages through the background between a Jasmine popup and the windows it creates.

Better ideas welcome!

@snowbound
Copy link

I briefly had this installed but noticed that it has issues with bleepingcomputer.com where if you search for anything on the site then bleepingcomputer.com is added to your search engines.

@cxw42
Copy link
Collaborator Author

cxw42 commented Mar 13, 2018

@snowbound Thanks for reporting! The branch from #6, or the current Chrome Web Store version (0.0.1)? The #6 version works for me on bleepingcomputer.

@snowbound
Copy link

I downloaded it via https://github.com/gregsadetsky/chrome-dont-add-custom-search-engines and loaded it via UnPacked extension in Chrome via Developer Mode. I went to Bleeping Computer, entered garbage in their search box. Went into Chrome's Search Engine list and bleepingconputer.com was in the list.

@cxw42
Copy link
Collaborator Author

cxw42 commented Mar 14, 2018

@snowbound OK - that's the old version, which is known to fail. Thanks for confirming! The pull-6 version (zip) should work if you unload the version you have, and then load the pull-6 version unpacked.

For the record, thanks to @gregsadetsky for finding this article showing that Selenium can access chrome://* pages. He says "we'd have to see if the automated testing sites out there (travis, circle ci, etc.) support this."

@cxw42
Copy link
Collaborator Author

cxw42 commented Apr 4, 2018

@gregsadetsky Any objection to a gh-pages branch to hold tests? I ran a combinatorial test suite here and would like to move it out of my personal site and put it in better condition to automate. Source.

@gregsadetsky
Copy link
Owner

@cxw42 great idea, go for it! thank you!

@cxw42
Copy link
Collaborator Author

cxw42 commented Apr 5, 2018

@gregsadetsky I added the gh-pages branch. Would you please turn it on in the settings? Thanks!

@gregsadetsky
Copy link
Owner

sorry, what do you mean by turn it on? I see that "Your GitHub Pages site is currently being built from the gh-pages branch" but I'm not sure which URL this repo would appear on

it's a bit of a mess, as my gregsadetsky.github.io points to another repo right now

thoughts?

@cxw42
Copy link
Collaborator Author

cxw42 commented Aug 16, 2018

OK - how about this different approach? A test extension so that pressing a button will perform searches on all the known problematic sites. After you press that button, you can visit chrome://settings/searchEngines to see if any were added.

Implementation outline:

  • In the main source tree, two extensions: the usual one, and a test extension.
  • The test extension pulls a test plan via XHR from the main repo (not the wiki --- we need stronger control to drive automated actions)
  • The test extension, when activated, opens a tab for each site listed in the test plan.
  • The test extension's content script, when loaded on a site, performs a search by issuing clicks or other events listed in the test plan for that site.

This was referenced Feb 9, 2019
@cxw42
Copy link
Collaborator Author

cxw42 commented Feb 10, 2019

I am updating the wiki page to list full Query URL rather than just site. That way we will have a database on which to run automated tests.

@cxw42 cxw42 mentioned this issue Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants