Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 # Buildtools unit tests | |
2 | |
3 ## Introduction | |
4 | |
5 Unit tests for buildtools, using the pytest framework. | |
6 | |
7 ## Approach | |
8 | |
9 In order to test the buildtools capability of creating WebExtension-packages | |
10 for Chrome, Edge and Firefox, an example configuration for each platform is | |
11 provided. | |
12 Running the tests calls the same API as the cli would, except for releases | |
13 (we don't want to trigger our releaseAutomation during tests) - in this case, | |
14 a build is manually created and verified) | |
kzar
2017/10/16 11:17:28
Nit: Missing full stop, same below.
tlucas
2017/10/17 12:45:42
Done - Although i couldn't find the one below.
| |
15 | |
16 Each extension is build with different parameters, the resulting package and | |
17 it's content is compared against provided expected results: | |
18 | |
19 - Release or build-only, with or without a specific build-number (Edge) | |
20 - Release, build-only or developement environment, with or without a specifc | |
21 build-number (Chrome, Firefox), with or without a predefined signing key | |
22 (Chrome) | |
23 | |
24 The expected results for each manifest are provided with the files in | |
25 `expecteddata/`. | |
26 | |
27 ## Test cases | |
28 | |
29 _(covered platforms are referred to as C=Chrome, E=Edge, F=Firefox)_ | |
kzar
2017/10/16 11:17:29
Nit: Please capitalise "Covered".
tlucas
2017/10/17 12:45:43
Done.
| |
30 | |
31 - Metadata inheritance (EF) | |
32 - correct package filename (CEF) | |
kzar
2017/10/16 11:17:26
Nit: "Correct"
tlucas
2017/10/17 12:45:46
Done.
| |
33 - Printed warning about non-square icons (CF) | |
34 - Presence of javascript unit test files in developement environment (CF) | |
kzar
2017/10/16 11:17:27
Nit: "JavaScript", same below.
tlucas
2017/10/17 12:45:45
Done.
| |
35 - Absence of javascript unit test files in build-only or release (CF) | |
36 - Inlcusion of defined contentScripts into the manifest (CF) | |
37 - Packaging (and moving) of included icons / scripts / htmls (CEF) | |
kzar
2017/10/16 11:17:25
Nit: "HTML files"
tlucas
2017/10/17 12:45:44
Done.
| |
38 - Presence of files for all configured locales (CEF) | |
39 - Correct import of translations with or without placeholders, with or without | |
40 access keys (CEF) | |
41 - Translation presence and validity for the Chrome Web Store (C) | |
42 - Packaging of modularized script files (CEF) | |
43 - Adherence to provided build-number in the manifest (CEF) | |
44 - Other content in the manifest (CEF) | |
45 - Correct encrypted signature of the package (C) | |
46 | |
47 ## Requirements | |
48 | |
49 - [Tox](https://pypi.python.org/pypi/tox) (>= 2.7.0) | |
50 | |
51 _(Tox will take care of installing the other dependencies such as flake8 and | |
52 flake8-abp inside a virtualenv.)_ | |
53 | |
54 ## Usage | |
55 | |
56 To run the tests simply run | |
57 | |
58 ``` | |
59 $ tox | |
60 ``` | |
61 | |
62 in the buildtools' root folder. | |
63 | |
64 ## Coverage | |
65 | |
66 Pytest will create a coverage report as output to the terminal, using the | |
67 pytest plugin `pytest-cov`. | |
68 | |
69 In order to get an html report you can add `--cov-report=html` to the | |
70 pytest-command in tox.ini. | |
71 | |
72 For more information please refer to the | |
73 [coverage documentation](https://coverage.readthedocs.io/) | |
OLD | NEW |