 Issue 29328998:
  Issue 132 - Add REAMDE to adblockplustests repository  (Closed)
    
  
    Issue 29328998:
  Issue 132 - Add REAMDE to adblockplustests repository  (Closed) 
  | Left: | ||
| Right: | 
| LEFT | RIGHT | 
|---|---|
| 1 # Adblock Plus Tests | 1 # Adblock Plus Tests | 
| 2 | 2 | 
| 3 ## Introduction | 3 ## Introduction | 
| 4 | 4 | 
| 5 The `adblockplustests` repository contains the test suite for the Adblock Plus | 5 The `adblockplustests` repository contains the test suite for the Adblock Plus | 
| 6 Firefox extension `adblockplus`. This test suite is itself a separate Firefox | 6 extension in Firefox. This test suite is itself a separate Firefox extension | 
| 
Wladimir Palant
2015/10/09 17:35:01
"for the Adblock Plus Firefox extension `adblockpl
 
kzar
2015/10/12 11:06:07
Done.
 | |
| 7 extension which interacts with the Adblock Plus extension in order to test it. | 7 which interacts with the Adblock Plus extension in order to test it. | 
| 8 (It is therefore assumed that the tests should pass when the latest available | 8 (It is therefore assumed that the tests should pass when the latest available | 
| 9 revisions of `adblockplus` and `adblockplustests` are used in combination.) | 9 revisions of `adblockplus` and `adblockplustests` are used in combination.) | 
| 10 | 10 | 
| 11 Some of the tests in this test suite are also re-used by the Chrome/Opera/Safari | 11 Some of the tests in this test suite are also reused by the Chrome/Opera/Safari | 
| 12 version of Adblock Plus `adblockpluschrome`. They are included in the | 12 version of Adblock Plus. Please see the `adblockpluschrome` repository for | 
| 13 repository as a dependency, and they are run from within the extension using its | 13 details on how to run the tests there. | 
| 14 in-built test runner. (The dependency is managed by the `ensure_dependencies.py` | |
| 15 script and the expected revision of `adblockplustests` is therefore specified | |
| 16 explicitly.) | |
| 
Wladimir Palant
2015/10/09 17:35:01
Please don't document technical details, these can
 
kzar
2015/10/12 11:06:08
Done.
 | |
| 17 | 14 | 
| 18 | 15 | 
| 19 ## Usage | 16 ## Usage | 
| 20 | |
| 21 ### Firefox | |
| 22 | 17 | 
| 23 To test your changes to Adblock Plus for Firefox you will need to build and | 18 To test your changes to Adblock Plus for Firefox you will need to build and | 
| 24 install both your modified version of the extension and the test suite. For | 19 install both your modified version of the extension and the test suite. For | 
| 25 each project you will need to type the following: | 20 each project you will need to type the following: | 
| 26 | 21 | 
| 27 ./build.py build | 22 ./build.py build | 
| 28 | 23 | 
| 29 This will create a build with a name in the form | 24 This will create a build with a name in the form | 
| 30 `adblockplus[tests]-1.2.3.nnnn.xpi`, which you can then manually add to Firefox. | 25 `adblockplus[tests]-1.2.3.nnnn.xpi`, which you can then manually add to Firefox. | 
| 31 | 26 | 
| 32 Alternatively, to speed up the process, you can install the | 27 Alternatively, to speed up the process, you can install the | 
| 33 [Extension Auto-Installer](https://addons.mozilla.org/addon/autoinstaller) | 28 [Extension Auto-Installer](https://addons.mozilla.org/addon/autoinstaller) | 
| 34 extension. Assuming that Extension Auto-Installer is configured to use port 8888 | 29 extension. Assuming that Extension Auto-Installer is configured to use port 8888 | 
| 35 (the default value), you can build and install in one step by running: | 30 (the default value), you can build and install in one step by running: | 
| 36 | 31 | 
| 37 ./build.py autoinstall 8888 | 32 ./build.py autoinstall 8888 | 
| 38 | 33 | 
| 39 Once both the Adblock Plus and Adblock Plus Tests extensions have been built and | 34 Once both the Adblock Plus and Adblock Plus Tests extensions have been built and | 
| 40 installed you can run the test suite by opening the Firefox Add-ons Manager, | 35 installed you can run the test suite by opening the Firefox Add-ons Manager, | 
| 41 pressing the "Preferences" button for the Adblock Plus Tests extension and then | 36 pressing the "Preferences" button for the Adblock Plus Tests extension and then | 
| 42 pressing the "Run" button. | 37 pressing the "Run" button. | 
| 43 | 38 | 
| 44 Things to note: | 39 Things to note: | 
| 45 | 40 | 
| 46 - The test suite can take some time to run, sometimes several minutes. | 41 - The test suite can take some time to run, sometimes several minutes. | 
| 47 - If you re-install the Adblock Plus Tests extension you will need to re-load | 42 - If you re-install the Adblock Plus Tests extension you will need to re-load | 
| 48 the preferences page before pressing "Run" again. Otherwise the tests will not | 43 the preferences page before pressing "Run" again. Otherwise the tests will not | 
| 49 re-start. | 44 re-start. | 
| 50 - The final storage tests often get stuck. | 45 - Some tests are currently known to fail (sometimes depending on your browser | 
| 51 - Some tests will fail intermittently with a `NS_ERROR_FAILURE` message. | 46 version and configuration). It is recommended to run the test suite first, | 
| 52 - Several `Content policy: HTML embed (Java)` tests are currently failing. | 47 before making any changes, to check which tests are expected to fail. | 
| 
Wladimir Palant
2015/10/09 17:35:01
I'd not document specific test failures, these can
 
kzar
2015/10/12 11:06:08
Done.
 | |
| 53 | |
| 54 | |
| 55 ### Chrome | |
| 
Sebastian Noack
2015/10/09 12:00:09
IMO this section is irrelevant and redundant here.
 
kzar
2015/10/09 14:39:42
Yea, maybe you're right. I wasn't sure either way
 
Wladimir Palant
2015/10/09 17:35:01
I agree with Sebastian, this is unnecessary. The n
 
kzar
2015/10/12 11:06:07
Done.
 | |
| 56 | |
| 57 To test your changes to Adblock Plus for Chrome, go to the extension's options | |
| 58 page, open the JavaScript Console and type: | |
| 59 | |
| 60 location.href = "qunit/index.html"; | |
| 61 | |
| 62 The unit tests should then run automatically in the page. For more information | |
| 63 about building and testing the Chrome extension please refer to [the project's | |
| 64 README file](https://hg.adblockplus.org/adblockpluschrome/file/tip/README.md). | |
| LEFT | RIGHT |