|
|
@@ -154,3 +154,68 @@ generateTests( {
|
|
|
}
|
|
|
} );
|
|
|
```
|
|
|
+
|
|
|
+## Adding new tests
|
|
|
+
|
|
|
+### To an existing group
|
|
|
+
|
|
|
+1. Create new fixtures directory in a group to which you plan to add tests (e.g. `_data/link/new-use-case/`).
|
|
|
+2. Add all necessary fixture files to the above directory:
|
|
|
+ * original input file - `new-use-case.docx`
|
|
|
+ * input fixture - `input.word2016.html` (to acquire clipboard data you may use `integration.html` manual test which prints `text/html` on paste)
|
|
|
+ * normalized output fixture - `normalized.word2016.html`
|
|
|
+ * model output fixture - `model.word2016.html`
|
|
|
+ * any browser specific fixtures
|
|
|
+3. Add new fixtures to groups `index.js` file.
|
|
|
+
|
|
|
+That's all, added fixtures will be now used to generate normalization and integration test.
|
|
|
+
|
|
|
+### To a new tests group
|
|
|
+
|
|
|
+1. Create new group directory for example `_data/new-group/`.
|
|
|
+2. Create new fixtures directories (one per input fixture file), each containing:
|
|
|
+ * original input file - `new-use-case.docx`
|
|
|
+ * input fixture - `input.word2016.html` (to acquire clipboard data you may use `integration.html` manual test which prints `text/html` on paste)
|
|
|
+ * normalized output fixture - `normalized.word2016.html`
|
|
|
+ * model output fixture - `model.word2016.html`
|
|
|
+ * any browser specific fixtures
|
|
|
+3. Create group `index.js` file in `_data/new-group/index.js` importing all necessary fixtures.
|
|
|
+4. Add new group to fixtures util `_utils/fixtures.js`:
|
|
|
+
|
|
|
+
|
|
|
+```
|
|
|
+// Import fixtures.
|
|
|
+import { fixtures as newGroup, browserFixtures as newGroupBrowser } from '../_data/new-group/index.js';
|
|
|
+
|
|
|
+// Generic fixtures.
|
|
|
+export const fixtures = {
|
|
|
+ 'new-group': newGroup
|
|
|
+};
|
|
|
+
|
|
|
+// Browser specific fixtures.
|
|
|
+export const browserFixtures = {
|
|
|
+ 'new-group': newGroupBrowser
|
|
|
+};
|
|
|
+```
|
|
|
+
|
|
|
+5. Add `generateTests()` function call in `data/normalization.js` to generate normalization and in `data/integration.js`
|
|
|
+to generate integration tests:
|
|
|
+
|
|
|
+```
|
|
|
+// normalization.js
|
|
|
+generateTests( {
|
|
|
+ input: 'new-group',
|
|
|
+ type: 'normalization',
|
|
|
+ browsers: [ 'chrome', 'firefox', 'safari', 'edge' ]
|
|
|
+ editorConfig: { ... }
|
|
|
+} );
|
|
|
+
|
|
|
+// integration.js
|
|
|
+generateTests( {
|
|
|
+ input: 'new-group',
|
|
|
+ type: 'integration',
|
|
|
+ browsers: [ 'chrome', 'firefox', 'safari', 'edge' ]
|
|
|
+ editorConfig: { ... }
|
|
|
+} );
|
|
|
+
|
|
|
+```
|