@elastic/synthetics 1.0.0-beta.4 → 1.0.0-beta.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/README.md +4 -3
  2. package/dist/cli.js +137 -160
  3. package/dist/cli.js.map +1 -1
  4. package/dist/common_types.d.ts +159 -31
  5. package/dist/common_types.d.ts.map +1 -1
  6. package/dist/config.d.ts +3 -5
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/config.js +7 -6
  9. package/dist/config.js.map +1 -1
  10. package/dist/core/browser-service.d.ts +1 -1
  11. package/dist/core/browser-service.d.ts.map +1 -1
  12. package/dist/core/browser-service.js +7 -6
  13. package/dist/core/browser-service.js.map +1 -1
  14. package/dist/core/expect.d.ts +25 -25
  15. package/dist/core/expect.d.ts.map +1 -1
  16. package/dist/core/expect.js.map +1 -1
  17. package/dist/core/gatherer.d.ts +4 -8
  18. package/dist/core/gatherer.d.ts.map +1 -1
  19. package/dist/core/gatherer.js +50 -15
  20. package/dist/core/gatherer.js.map +1 -1
  21. package/dist/core/index.d.ts +5 -1
  22. package/dist/core/index.d.ts.map +1 -1
  23. package/dist/core/index.js +23 -11
  24. package/dist/core/index.js.map +1 -1
  25. package/dist/core/logger.d.ts +0 -1
  26. package/dist/core/logger.d.ts.map +1 -1
  27. package/dist/core/logger.js +3 -16
  28. package/dist/core/logger.js.map +1 -1
  29. package/dist/core/runner.d.ts +12 -63
  30. package/dist/core/runner.d.ts.map +1 -1
  31. package/dist/core/runner.js +156 -90
  32. package/dist/core/runner.js.map +1 -1
  33. package/dist/core/transform.d.ts +37 -0
  34. package/dist/core/transform.d.ts.map +1 -0
  35. package/dist/core/transform.js +148 -0
  36. package/dist/core/transform.js.map +1 -0
  37. package/dist/dsl/index.js +5 -1
  38. package/dist/dsl/index.js.map +1 -1
  39. package/dist/dsl/journey.d.ts +9 -4
  40. package/dist/dsl/journey.d.ts.map +1 -1
  41. package/dist/dsl/journey.js +37 -9
  42. package/dist/dsl/journey.js.map +1 -1
  43. package/dist/dsl/monitor.d.ts +83 -0
  44. package/dist/dsl/monitor.d.ts.map +1 -0
  45. package/dist/dsl/monitor.js +108 -0
  46. package/dist/dsl/monitor.js.map +1 -0
  47. package/dist/dsl/step.d.ts +3 -2
  48. package/dist/dsl/step.d.ts.map +1 -1
  49. package/dist/dsl/step.js +6 -1
  50. package/dist/dsl/step.js.map +1 -1
  51. package/dist/formatter/javascript.d.ts +98 -0
  52. package/dist/formatter/javascript.d.ts.map +1 -0
  53. package/dist/formatter/javascript.js +298 -0
  54. package/dist/formatter/javascript.js.map +1 -0
  55. package/dist/generator/index.d.ts +24 -0
  56. package/dist/generator/index.d.ts.map +1 -0
  57. package/dist/generator/index.js +241 -0
  58. package/dist/generator/index.js.map +1 -0
  59. package/dist/{reporters/reporter.js → generator/utils.d.ts} +5 -3
  60. package/dist/generator/utils.d.ts.map +1 -0
  61. package/dist/generator/utils.js +84 -0
  62. package/dist/generator/utils.js.map +1 -0
  63. package/dist/helpers.d.ts +28 -3
  64. package/dist/helpers.d.ts.map +1 -1
  65. package/dist/helpers.js +152 -20
  66. package/dist/helpers.js.map +1 -1
  67. package/dist/index.d.ts +6 -7
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +5 -26
  70. package/dist/index.js.map +1 -1
  71. package/dist/loader.d.ts +34 -0
  72. package/dist/loader.d.ts.map +1 -0
  73. package/dist/loader.js +149 -0
  74. package/dist/loader.js.map +1 -0
  75. package/dist/locations/index.d.ts +45 -0
  76. package/dist/locations/index.d.ts.map +1 -0
  77. package/dist/locations/index.js +83 -0
  78. package/dist/locations/index.js.map +1 -0
  79. package/dist/{reporters/reporter.d.ts → locations/public-locations.d.ts} +12 -8
  80. package/dist/locations/public-locations.d.ts.map +1 -0
  81. package/dist/locations/public-locations.js +41 -0
  82. package/dist/locations/public-locations.js.map +1 -0
  83. package/dist/options.d.ts +41 -0
  84. package/dist/options.d.ts.map +1 -0
  85. package/dist/options.js +198 -0
  86. package/dist/options.js.map +1 -0
  87. package/dist/plugins/browser-console.d.ts +5 -4
  88. package/dist/plugins/browser-console.d.ts.map +1 -1
  89. package/dist/plugins/browser-console.js +44 -24
  90. package/dist/plugins/browser-console.js.map +1 -1
  91. package/dist/plugins/index.js +5 -1
  92. package/dist/plugins/index.js.map +1 -1
  93. package/dist/plugins/network.d.ts +20 -33
  94. package/dist/plugins/network.d.ts.map +1 -1
  95. package/dist/plugins/network.js +177 -216
  96. package/dist/plugins/network.js.map +1 -1
  97. package/dist/plugins/performance.d.ts +4 -19
  98. package/dist/plugins/performance.d.ts.map +1 -1
  99. package/dist/plugins/performance.js +6 -5
  100. package/dist/plugins/performance.js.map +1 -1
  101. package/dist/plugins/plugin-manager.d.ts +9 -5
  102. package/dist/plugins/plugin-manager.d.ts.map +1 -1
  103. package/dist/plugins/plugin-manager.js +46 -30
  104. package/dist/plugins/plugin-manager.js.map +1 -1
  105. package/dist/plugins/tracing.d.ts +6 -6
  106. package/dist/plugins/tracing.d.ts.map +1 -1
  107. package/dist/plugins/tracing.js +10 -7
  108. package/dist/plugins/tracing.js.map +1 -1
  109. package/dist/push/bundler.d.ts +35 -0
  110. package/dist/push/bundler.d.ts.map +1 -0
  111. package/dist/push/bundler.js +131 -0
  112. package/dist/push/bundler.js.map +1 -0
  113. package/dist/push/index.d.ts +9 -0
  114. package/dist/push/index.d.ts.map +1 -0
  115. package/dist/push/index.js +227 -0
  116. package/dist/push/index.js.map +1 -0
  117. package/dist/push/kibana_api.d.ts +56 -0
  118. package/dist/push/kibana_api.d.ts.map +1 -0
  119. package/dist/push/kibana_api.js +135 -0
  120. package/dist/push/kibana_api.js.map +1 -0
  121. package/dist/push/monitor.d.ts +51 -0
  122. package/dist/push/monitor.d.ts.map +1 -0
  123. package/dist/push/monitor.js +244 -0
  124. package/dist/push/monitor.js.map +1 -0
  125. package/dist/{parse_args.d.ts → push/plugin.d.ts} +9 -6
  126. package/dist/push/plugin.d.ts.map +1 -0
  127. package/dist/push/plugin.js +66 -0
  128. package/dist/push/plugin.js.map +1 -0
  129. package/dist/push/request.d.ts +45 -0
  130. package/dist/push/request.d.ts.map +1 -0
  131. package/dist/push/request.js +109 -0
  132. package/dist/push/request.js.map +1 -0
  133. package/dist/push/utils.d.ts +31 -0
  134. package/dist/push/utils.d.ts.map +1 -0
  135. package/dist/push/utils.js +64 -0
  136. package/dist/push/utils.js.map +1 -0
  137. package/dist/reporters/base.d.ts +14 -6
  138. package/dist/reporters/base.d.ts.map +1 -1
  139. package/dist/reporters/base.js +58 -50
  140. package/dist/reporters/base.js.map +1 -1
  141. package/dist/reporters/index.d.ts +18 -8
  142. package/dist/reporters/index.d.ts.map +1 -1
  143. package/dist/reporters/index.js.map +1 -1
  144. package/dist/reporters/json.d.ts +18 -62
  145. package/dist/reporters/json.d.ts.map +1 -1
  146. package/dist/reporters/json.js +149 -179
  147. package/dist/reporters/json.js.map +1 -1
  148. package/dist/reporters/junit.d.ts +7 -1
  149. package/dist/reporters/junit.d.ts.map +1 -1
  150. package/dist/reporters/junit.js +90 -95
  151. package/dist/reporters/junit.js.map +1 -1
  152. package/dist/sdk/lh-trace-processor.d.ts +35 -9
  153. package/dist/sdk/lh-trace-processor.d.ts.map +1 -1
  154. package/dist/sdk/lh-trace-processor.js +114 -53
  155. package/dist/sdk/lh-trace-processor.js.map +1 -1
  156. package/dist/sdk/trace-metrics.d.ts +4 -4
  157. package/dist/sdk/trace-metrics.d.ts.map +1 -1
  158. package/dist/sdk/trace-metrics.js +3 -4
  159. package/dist/sdk/trace-metrics.js.map +1 -1
  160. package/dist/sdk/trace-processor.d.ts +11 -3
  161. package/dist/sdk/trace-processor.d.ts.map +1 -1
  162. package/dist/sdk/trace-processor.js +17 -9
  163. package/dist/sdk/trace-processor.js.map +1 -1
  164. package/package.json +39 -24
  165. package/src/cli.ts +219 -151
  166. package/src/common_types.ts +192 -31
  167. package/src/config.ts +3 -6
  168. package/src/core/expect.ts +58 -24
  169. package/src/core/gatherer.ts +59 -24
  170. package/src/core/index.ts +36 -15
  171. package/src/core/logger.ts +1 -12
  172. package/src/core/runner.ts +151 -136
  173. package/src/core/transform.ts +160 -0
  174. package/src/dsl/journey.ts +39 -6
  175. package/src/dsl/monitor.ts +140 -0
  176. package/src/dsl/step.ts +9 -2
  177. package/src/formatter/javascript.ts +367 -0
  178. package/src/generator/index.ts +308 -0
  179. package/src/generator/utils.ts +84 -0
  180. package/src/helpers.ts +159 -13
  181. package/src/index.ts +22 -22
  182. package/src/loader.ts +167 -0
  183. package/src/locations/index.ts +95 -0
  184. package/src/{reporters/reporter.ts → locations/public-locations.ts} +12 -9
  185. package/src/options.ts +227 -0
  186. package/src/plugins/browser-console.ts +30 -8
  187. package/src/plugins/network.ts +208 -267
  188. package/src/plugins/performance.ts +6 -22
  189. package/src/plugins/plugin-manager.ts +49 -31
  190. package/src/plugins/tracing.ts +8 -9
  191. package/src/push/bundler.ts +112 -0
  192. package/src/push/index.ts +282 -0
  193. package/src/push/kibana_api.ts +191 -0
  194. package/src/push/monitor.ts +276 -0
  195. package/src/push/plugin.ts +66 -0
  196. package/src/push/request.ts +141 -0
  197. package/src/push/utils.ts +77 -0
  198. package/src/reporters/base.ts +63 -52
  199. package/src/reporters/index.ts +26 -3
  200. package/src/reporters/json.ts +188 -202
  201. package/src/reporters/junit.ts +98 -93
  202. package/src/sdk/lh-trace-processor.ts +132 -68
  203. package/src/sdk/trace-metrics.ts +8 -4
  204. package/src/sdk/trace-processor.ts +28 -13
  205. package/templates/.github/workflows/run-synthetics.yml +27 -0
  206. package/templates/README.md +21 -0
  207. package/templates/journeys/advanced-example-helpers.ts +54 -0
  208. package/templates/journeys/advanced-example.journey.ts +43 -0
  209. package/templates/journeys/example.journey.ts +18 -0
  210. package/templates/lightweight/heartbeat.yml +7 -0
  211. package/templates/synthetics.config.ts +35 -0
  212. package/CHANGELOG.md +0 -131
  213. package/NOTICE.txt +0 -221
  214. package/dist/parse_args.d.ts.map +0 -1
  215. package/dist/parse_args.js +0 -95
  216. package/dist/parse_args.js.map +0 -1
  217. package/dist/reporters/reporter.d.ts.map +0 -1
  218. package/dist/reporters/reporter.js.map +0 -1
  219. package/dist/tsconfig.tsbuildinfo +0 -1888
  220. package/src/parse_args.ts +0 -135
@@ -0,0 +1,27 @@
1
+ name: Elastic Synthetics Tests
2
+ on:
3
+ push:
4
+ branches: [main, master]
5
+ pull_request:
6
+ branches: [main, master]
7
+ schedule:
8
+ - cron: '* 0 * * *'
9
+ jobs:
10
+ test:
11
+ defaults:
12
+ run:
13
+ working-directory: ./advanced-examples
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v3
17
+ - uses: actions/setup-node@v3
18
+ with:
19
+ node-version: 18
20
+ - run: npm install
21
+ - run: "SYNTHETICS_JUNIT_FILE='junit-synthetics.xml' npx @elastic/synthetics . --reporter=junit"
22
+ - name: Publish Unit Test Results
23
+ uses: EnricoMi/publish-unit-test-result-action@v2
24
+ if: always()
25
+ with:
26
+ junit_files: '**/junit-*.xml'
27
+ check_name: Elastic Synthetics Tests
@@ -0,0 +1,21 @@
1
+ ## Get started with Elastic Synthetics!
2
+
3
+ Browse the directory structure here to see an example skeleton of an [Elastic Synthetics](https://www.elastic.co/observability/synthetic-monitoring) project.
4
+ Make sure to [read the docs](https://www.elastic.co/guide/en/observability/current/monitor-uptime-synthetics.html) as well if you're unfamiliar with Elastic Synthetics.
5
+
6
+ This directory was created with the command `npx @elastic/synthetics <target-directory>`, with `<target-directory>` being the name of the directory you'd like it to make.
7
+ You can always use this command to scafold new Synthetics projects.
8
+
9
+ Key places to look:
10
+
11
+ - The `synthetics.config.ts` file contains configuration for your project.
12
+ - The `journeys` directory contains both basic and more advanced examples of using synthetics. It tests a publicly hosted [Todos List](https://elastic.github.io/synthetics-demo/).
13
+ - The `.github` directory contains an example github action, demonstrating the use of a CI service for automatically running tests on merges and PR creation.
14
+
15
+ To run the tests locally, use the following command:
16
+
17
+ ```bash
18
+ npm run test
19
+ ```
20
+
21
+ Curious to learn more? [Read the docs](https://www.elastic.co/guide/en/observability/current/monitor-uptime-synthetics.html) to learn about pushing configurations to an Elastic cloud stack and more.
@@ -0,0 +1,54 @@
1
+ import { step, Page, expect } from '@elastic/synthetics';
2
+
3
+ // This file contains helper files for advanced-example.journey.ts
4
+ // The functions here let you write more concise tests and re-use functionality
5
+ // across tests.
6
+
7
+ export const loadAppStep = (page: Page, url: string) => {
8
+ step('launch app', async () => {
9
+ await page.goto(url);
10
+ });
11
+ };
12
+
13
+ export const addTaskStep = (page: Page, task: string) => {
14
+ step(`add task ${task}`, async () => {
15
+ const input = await page.locator('input.new-todo');
16
+ await input.type(task);
17
+ await input.press('Enter');
18
+ });
19
+ };
20
+
21
+ const todosSelector = 'ul.todo-list li.todo';
22
+
23
+ export const findTask = async (page: Page, task: string) => {
24
+ return await page.locator(`${todosSelector} >> text="${task}"`);
25
+ };
26
+
27
+ export const assertTaskListCountStep = async (page: Page, count: number) => {
28
+ step(`check that task list has exactly ${count} elements`, async () => {
29
+ const tasks = await page.locator(todosSelector);
30
+ expect(await tasks.count()).toBe(count);
31
+ });
32
+ };
33
+
34
+ export const checkForTaskStep = async (page: Page, task: string) => {
35
+ step(`check for task '${task}' in list`, async () => {
36
+ return findTask(page, task);
37
+ });
38
+ };
39
+
40
+ export const destroyTaskStep = async (page: Page, task: string) => {
41
+ step(`destroy task '${task}'`, async () => {
42
+ const label = await findTask(page, task);
43
+ // xpath indexes arrays starting at 1!!! Easy to forget!
44
+ const li = await label.locator('xpath=ancestor::li[1]');
45
+ const destroyButton = await li.locator('button');
46
+ // The destroy button is not visible until hovered. Setup a click test which
47
+ // will wait up to 30s for the button to be visible.
48
+ const clickFuture = destroyButton.click();
49
+ // now hover, making the destroy button clickable
50
+ await li.hover();
51
+ // now we are done
52
+ await clickFuture;
53
+ });
54
+ };
@@ -0,0 +1,43 @@
1
+ import { journey } from '@elastic/synthetics';
2
+ import {
3
+ loadAppStep,
4
+ addTaskStep,
5
+ assertTaskListCountStep,
6
+ checkForTaskStep,
7
+ destroyTaskStep,
8
+ } from './advanced-example-helpers';
9
+
10
+ // This file shows the use of re-usable functions, imported from
11
+ // `advanced-example-helpers.ts` to make writing tests that perform
12
+ // different combinations of similar functions simpler and with less
13
+ // duplication.
14
+
15
+ journey('addition and completion of single task', ({ page, params }) => {
16
+ const testText = "Don't put salt in your eyes";
17
+
18
+ loadAppStep(page, params.url);
19
+ addTaskStep(page, testText);
20
+ assertTaskListCountStep(page, 1);
21
+ checkForTaskStep(page, testText);
22
+ destroyTaskStep(page, testText);
23
+ assertTaskListCountStep(page, 0);
24
+ });
25
+
26
+ journey('adding and removing multiple tasks', ({ page, params }) => {
27
+ const testTasks = ['Task 1', 'Task 2', 'Task 3'];
28
+
29
+ loadAppStep(page, params.url);
30
+ testTasks.forEach(t => {
31
+ addTaskStep(page, t);
32
+ });
33
+
34
+ assertTaskListCountStep(page, 3);
35
+
36
+ // remove the middle task and check that it worked
37
+ destroyTaskStep(page, testTasks[1]);
38
+ assertTaskListCountStep(page, 2);
39
+
40
+ // add a new task and check it exists
41
+ addTaskStep(page, 'Task 4');
42
+ assertTaskListCountStep(page, 3);
43
+ });
@@ -0,0 +1,18 @@
1
+ import { journey, step, monitor, expect } from '@elastic/synthetics';
2
+
3
+ journey('My Example Journey', ({ page, params }) => {
4
+ // Only relevant for the push command to create
5
+ // monitors in Kibana
6
+ monitor.use({
7
+ id: 'example-monitor',
8
+ schedule: 10,
9
+ });
10
+ step('launch application', async () => {
11
+ await page.goto(params.url);
12
+ });
13
+
14
+ step('assert title', async () => {
15
+ const header = await page.locator('h1');
16
+ expect(await header.textContent()).toBe('todos');
17
+ });
18
+ });
@@ -0,0 +1,7 @@
1
+ - type: http
2
+ name: Todos Lightweight
3
+ id: todos-lightweight
4
+ enabled: true
5
+ urls: "https://elastic.github.io/synthetics-demo/"
6
+ schedule: '@every 3m'
7
+ timeout: 16s
@@ -0,0 +1,35 @@
1
+ import type { SyntheticsConfig } from '@elastic/synthetics';
2
+
3
+ export default env => {
4
+ const config: SyntheticsConfig = {
5
+ params: {
6
+ url: 'https://elastic.github.io/synthetics-demo/',
7
+ },
8
+ playwrightOptions: {
9
+ ignoreHTTPSErrors: false,
10
+ },
11
+ /**
12
+ * Configure global monitor settings
13
+ */
14
+ monitor: {
15
+ schedule: '{{schedule}}',
16
+ locations: ['{{locations}}'],
17
+ privateLocations: ['{{privateLocations}}'],
18
+ },
19
+ /**
20
+ * Project monitors settings
21
+ */
22
+ project: {
23
+ id: '{{id}}',
24
+ url: '{{url}}',
25
+ space: '{{space}}',
26
+ },
27
+ };
28
+ if (env !== 'development') {
29
+ /**
30
+ * Override configuration specific to environment
31
+ * Ex: config.params.url = ""
32
+ */
33
+ }
34
+ return config;
35
+ };
package/CHANGELOG.md DELETED
@@ -1,131 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## v1.0.0-beta.3 (2021-06-15)
6
-
7
- ### Features
8
-
9
- - Capture all core-vitals and user experience metrics like FPC, LCP, CLS, User
10
- timing metrics, etc via chrome tracing [#194](https://github.com/elastic/synthetics/pull/194)
11
- - Split the captured screenshot from each step in to 64 blocks to optimzie
12
- the storage when indexed the same block in Elaticsearch [#290](https://github.com/elastic/synthetics/pull/290)
13
- - Add support for filtering journeys by name and tags [#300](https://github.com/elastic/synthetics/issues/300)
14
- - Expose `expect` assetion method in the API [#201](https://github.com/elastic/synthetics/issues/201)
15
- - Update Cumulative Layout Shift(CLS) metric based on
16
- `maximum session window with 1 second gap, capped at 5 seconds`
17
- [#301](https://github.com/elastic/synthetics/issues/301)
18
- - Expose time taken to complete single step under
19
- `step.duration.us` [#302](https://github.com/elastic/synthetics/issues/301)
20
- - Expose new capabilities via `--capability` through CLI
21
- options [#295](https://github.com/elastic/synthetics/issues/295)
22
- - Add new flag `--rich-events` which mimicks heartbeat
23
- behaviour [#289](https://github.com/elastic/synthetics/pull/289).
24
- - Expose suite parameters from CLI and config file to
25
- all hooks and journeys callbacks[#272](https://github.com/elastic/synthetics/pull/272)
26
-
27
- ### Bug fixes
28
-
29
- - Move all of the trace events like FCP, LCP, User timings under
30
- `browser.relative_trace`[#303](https://github.com/elastic/synthetics/pulls/303)
31
- - Prioritize suite params from CLI over config file [#298](https://github.com/elastic/synthetics/pull/298)
32
- - Report errors from `before` and `after` hooks [#273](https://github.com/elastic/synthetics/pull/273)
33
-
34
- ## v1.0.0-beta.2 (2021-05-17)
35
-
36
- ### Features
37
-
38
- - Allow dynamic suite parameters configuration via `synthetics.config.{js|ts}`
39
- [#270](https://github.com/elastic/synthetics/issues/270)
40
-
41
- ### Performance Improvements
42
-
43
- - Improve execution time of test suites by spawning journeys in isolated context
44
- instead of launcing browser for each run [#274](https://github.com/elastic/synthetics/issues/274)
45
-
46
- ## v1.0.0-beta.1 (2021-05-04)
47
-
48
- ### Bug fixes
49
-
50
- - Exclude all data URI requests from network events [#267](https://github.com/elastic/synthetics/issues/267)
51
-
52
- ## v1.0.0-beta.0 (2021-04-23)
53
-
54
- ### Features
55
-
56
- - Default to JPEG images with quality 80 for individual step
57
- screenshots[#233](https://github.com/elastic/synthetics/issues/233)
58
-
59
- ### Bug fixes
60
-
61
- - Keep journey callback types to be synchronous to match with how steps are
62
- executed synchronously[#256](https://github.com/elastic/synthetics/issues/256)
63
- - Report correct page URL on navigation
64
- failures[#255](https://github.com/elastic/synthetics/issues/255)
65
-
66
- **NOTE: Playwright version is updated to 1.10.0**
67
-
68
- ## v0.0.1-alpha14 (2021-04-14)
69
-
70
- ### Features
71
-
72
- - Add support for custom reporters for the Synthetics runner
73
- [#254](https://github.com/elastic/synthetics/issues/254)
74
-
75
- ## v0.0.1-alpha13 (2021-04-08)
76
-
77
- ### Features
78
-
79
- - Remove duplicate payload fields and keep the network fields under ECS
80
- [#252](https://github.com/elastic/synthetics/issues/252)
81
-
82
- ### Bug fixes
83
-
84
- - Measure the network timings for aborted and inflight network requests
85
- correctly[#251](https://github.com/elastic/synthetics/pull/251)
86
-
87
- ## v0.0.1-alpha12 (2021-03-31)
88
-
89
- ### Features
90
-
91
- - Record transfer size and resource size for all network events
92
- [#220](https://github.com/elastic/synthetics/issues/220)
93
- - Report the number of journeys as part of the new `synthetics/metadata` event
94
- which would be used by heartbeat eventually for sharding [#247](https://github.com/elastic/synthetics/pull/247)
95
-
96
- ## v0.0.1-alpha11 (2021-03-10)
97
-
98
- ### Features
99
-
100
- - Expose driver type information from the agent [#239](https://github.com/elastic/synthetics/pull/239)
101
-
102
- Exposing the types allows developers to import the driver type information
103
- directly from the synthetics package instead of using via playwright specific
104
- packages which would result in inconsistent types (version mismatch or
105
- browser specific types).
106
-
107
- ## v0.0.1-alpha10 (2021-03-04)
108
-
109
- ### Features
110
-
111
- - Move all the ECS specific fields under `root_fields` [#164](https://github.com/elastic/synthetics/issues/164)
112
- - Add support for Junit reporter [#149](https://github.com/elastic/synthetics/issues/149)
113
- - Expose status field for `step/end` and `journey/end` [#230](https://github.com/elastic/synthetics/issues/230)
114
-
115
- ### Bug fixes
116
-
117
- - Disable chromium sandboxing by default
118
- [#225](https://github.com/elastic/synthetics/issues/225)
119
-
120
- ## v0.0.1-alpha9 (2021-02-01)
121
-
122
- ### Features
123
-
124
- - Add runtime seccomp profiler for the synthetics agent [#181](https://github.com/elastic/synthetics/issues/181)
125
-
126
- ### Bug fixes
127
-
128
- - Exit with non-zero code when any step/journey fails [#191](https://github.com/elastic/synthetics/issues/191)
129
- - Calculate blocking time properly for missing network data [#187](https://github.com/elastic/synthetics/issues/187)
130
- - Preserve typescript source fails without transpiling to older JS versions [#195](https://github.com/elastic/synthetics/issues/195)
131
- - Capture redirected requests in network timing data [#180](https://github.com/elastic/synthetics/issues/180)
package/NOTICE.txt DELETED
@@ -1,221 +0,0 @@
1
- @elastic/synthetics
2
- Copyright (c) 2020-present, Elasticsearch BV
3
-
4
-
5
- ---------------------------------------------------------------------------
6
- This product relies on `googlechrome/lighthouse`
7
-
8
- Copyright 2017 The Lighthouse Authors. All Rights Reserved.
9
-
10
- Apache License
11
- Version 2.0, January 2004
12
- http://www.apache.org/licenses/
13
-
14
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
15
-
16
- 1. Definitions.
17
-
18
- "License" shall mean the terms and conditions for use, reproduction,
19
- and distribution as defined by Sections 1 through 9 of this document.
20
-
21
- "Licensor" shall mean the copyright owner or entity authorized by
22
- the copyright owner that is granting the License.
23
-
24
- "Legal Entity" shall mean the union of the acting entity and all
25
- other entities that control, are controlled by, or are under common
26
- control with that entity. For the purposes of this definition,
27
- "control" means (i) the power, direct or indirect, to cause the
28
- direction or management of such entity, whether by contract or
29
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
30
- outstanding shares, or (iii) beneficial ownership of such entity.
31
-
32
- "You" (or "Your") shall mean an individual or Legal Entity
33
- exercising permissions granted by this License.
34
-
35
- "Source" form shall mean the preferred form for making modifications,
36
- including but not limited to software source code, documentation
37
- source, and configuration files.
38
-
39
- "Object" form shall mean any form resulting from mechanical
40
- transformation or translation of a Source form, including but
41
- not limited to compiled object code, generated documentation,
42
- and conversions to other media types.
43
-
44
- "Work" shall mean the work of authorship, whether in Source or
45
- Object form, made available under the License, as indicated by a
46
- copyright notice that is included in or attached to the work
47
- (an example is provided in the Appendix below).
48
-
49
- "Derivative Works" shall mean any work, whether in Source or Object
50
- form, that is based on (or derived from) the Work and for which the
51
- editorial revisions, annotations, elaborations, or other modifications
52
- represent, as a whole, an original work of authorship. For the purposes
53
- of this License, Derivative Works shall not include works that remain
54
- separable from, or merely link (or bind by name) to the interfaces of,
55
- the Work and Derivative Works thereof.
56
-
57
- "Contribution" shall mean any work of authorship, including
58
- the original version of the Work and any modifications or additions
59
- to that Work or Derivative Works thereof, that is intentionally
60
- submitted to Licensor for inclusion in the Work by the copyright owner
61
- or by an individual or Legal Entity authorized to submit on behalf of
62
- the copyright owner. For the purposes of this definition, "submitted"
63
- means any form of electronic, verbal, or written communication sent
64
- to the Licensor or its representatives, including but not limited to
65
- communication on electronic mailing lists, source code control systems,
66
- and issue tracking systems that are managed by, or on behalf of, the
67
- Licensor for the purpose of discussing and improving the Work, but
68
- excluding communication that is conspicuously marked or otherwise
69
- designated in writing by the copyright owner as "Not a Contribution."
70
-
71
- "Contributor" shall mean Licensor and any individual or Legal Entity
72
- on behalf of whom a Contribution has been received by Licensor and
73
- subsequently incorporated within the Work.
74
-
75
- 2. Grant of Copyright License. Subject to the terms and conditions of
76
- this License, each Contributor hereby grants to You a perpetual,
77
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
- copyright license to reproduce, prepare Derivative Works of,
79
- publicly display, publicly perform, sublicense, and distribute the
80
- Work and such Derivative Works in Source or Object form.
81
-
82
- 3. Grant of Patent License. Subject to the terms and conditions of
83
- this License, each Contributor hereby grants to You a perpetual,
84
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
85
- (except as stated in this section) patent license to make, have made,
86
- use, offer to sell, sell, import, and otherwise transfer the Work,
87
- where such license applies only to those patent claims licensable
88
- by such Contributor that are necessarily infringed by their
89
- Contribution(s) alone or by combination of their Contribution(s)
90
- with the Work to which such Contribution(s) was submitted. If You
91
- institute patent litigation against any entity (including a
92
- cross-claim or counterclaim in a lawsuit) alleging that the Work
93
- or a Contribution incorporated within the Work constitutes direct
94
- or contributory patent infringement, then any patent licenses
95
- granted to You under this License for that Work shall terminate
96
- as of the date such litigation is filed.
97
-
98
- 4. Redistribution. You may reproduce and distribute copies of the
99
- Work or Derivative Works thereof in any medium, with or without
100
- modifications, and in Source or Object form, provided that You
101
- meet the following conditions:
102
-
103
- (a) You must give any other recipients of the Work or
104
- Derivative Works a copy of this License; and
105
-
106
- (b) You must cause any modified files to carry prominent notices
107
- stating that You changed the files; and
108
-
109
- (c) You must retain, in the Source form of any Derivative Works
110
- that You distribute, all copyright, patent, trademark, and
111
- attribution notices from the Source form of the Work,
112
- excluding those notices that do not pertain to any part of
113
- the Derivative Works; and
114
-
115
- (d) If the Work includes a "NOTICE" text file as part of its
116
- distribution, then any Derivative Works that You distribute must
117
- include a readable copy of the attribution notices contained
118
- within such NOTICE file, excluding those notices that do not
119
- pertain to any part of the Derivative Works, in at least one
120
- of the following places: within a NOTICE text file distributed
121
- as part of the Derivative Works; within the Source form or
122
- documentation, if provided along with the Derivative Works; or,
123
- within a display generated by the Derivative Works, if and
124
- wherever such third-party notices normally appear. The contents
125
- of the NOTICE file are for informational purposes only and
126
- do not modify the License. You may add Your own attribution
127
- notices within Derivative Works that You distribute, alongside
128
- or as an addendum to the NOTICE text from the Work, provided
129
- that such additional attribution notices cannot be construed
130
- as modifying the License.
131
-
132
- You may add Your own copyright statement to Your modifications and
133
- may provide additional or different license terms and conditions
134
- for use, reproduction, or distribution of Your modifications, or
135
- for any such Derivative Works as a whole, provided Your use,
136
- reproduction, and distribution of the Work otherwise complies with
137
- the conditions stated in this License.
138
-
139
- 5. Submission of Contributions. Unless You explicitly state otherwise,
140
- any Contribution intentionally submitted for inclusion in the Work
141
- by You to the Licensor shall be under the terms and conditions of
142
- this License, without any additional terms or conditions.
143
- Notwithstanding the above, nothing herein shall supersede or modify
144
- the terms of any separate license agreement you may have executed
145
- with Licensor regarding such Contributions.
146
-
147
- 6. Trademarks. This License does not grant permission to use the trade
148
- names, trademarks, service marks, or product names of the Licensor,
149
- except as required for reasonable and customary use in describing the
150
- origin of the Work and reproducing the content of the NOTICE file.
151
-
152
- 7. Disclaimer of Warranty. Unless required by applicable law or
153
- agreed to in writing, Licensor provides the Work (and each
154
- Contributor provides its Contributions) on an "AS IS" BASIS,
155
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
156
- implied, including, without limitation, any warranties or conditions
157
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
158
- PARTICULAR PURPOSE. You are solely responsible for determining the
159
- appropriateness of using or redistributing the Work and assume any
160
- risks associated with Your exercise of permissions under this License.
161
-
162
- 8. Limitation of Liability. In no event and under no legal theory,
163
- whether in tort (including negligence), contract, or otherwise,
164
- unless required by applicable law (such as deliberate and grossly
165
- negligent acts) or agreed to in writing, shall any Contributor be
166
- liable to You for damages, including any direct, indirect, special,
167
- incidental, or consequential damages of any character arising as a
168
- result of this License or out of the use or inability to use the
169
- Work (including but not limited to damages for loss of goodwill,
170
- work stoppage, computer failure or malfunction, or any and all
171
- other commercial damages or losses), even if such Contributor
172
- has been advised of the possibility of such damages.
173
-
174
- 9. Accepting Warranty or Additional Liability. While redistributing
175
- the Work or Derivative Works thereof, You may choose to offer,
176
- and charge a fee for, acceptance of support, warranty, indemnity,
177
- or other liability obligations and/or rights consistent with this
178
- License. However, in accepting such obligations, You may act only
179
- on Your own behalf and on Your sole responsibility, not on behalf
180
- of any other Contributor, and only if You agree to indemnify,
181
- defend, and hold each Contributor harmless for any liability
182
- incurred by, or claims asserted against, such Contributor by reason
183
- of your accepting any such warranty or additional liability.
184
-
185
- END OF TERMS AND CONDITIONS
186
-
187
- APPENDIX: How to apply the Apache License to your work.
188
-
189
- To apply the Apache License to your work, attach the following
190
- boilerplate notice, with the fields enclosed by brackets "[]"
191
- replaced with your own identifying information. (Don't include
192
- the brackets!) The text should be enclosed in the appropriate
193
- comment syntax for the file format. We also recommend that a
194
- file or class name and description of purpose be included on the
195
- same "printed page" as the copyright notice for easier
196
- identification within third-party archives.
197
-
198
- Copyright [yyyy] [name of copyright owner]
199
-
200
- Licensed under the Apache License, Version 2.0 (the "License");
201
- you may not use this file except in compliance with the License.
202
- You may obtain a copy of the License at
203
-
204
- http://www.apache.org/licenses/LICENSE-2.0
205
-
206
- Unless required by applicable law or agreed to in writing, software
207
- distributed under the License is distributed on an "AS IS" BASIS,
208
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
- See the License for the specific language governing permissions and
210
- limitations under the License.
211
- ---------------------------------------------------------------------------
212
- This product relies on `expect`
213
-
214
- /**
215
- * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
216
- *
217
- * This source code is licensed under the MIT license found in the
218
- * LICENSE file in the root directory of this source tree.
219
- *
220
- */
221
- ---------------------------------------------------------------------------
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse_args.d.ts","sourceRoot":"","sources":["../src/parse_args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAkEzC,QAAA,MAAM,OAAO,6BAA8B,CAAC;AAC5C,QAAA,MAAM,OAAO,SAA4B,CAAC;AAwC1C,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,eAAe,OAAO,CAAC"}
@@ -1,95 +0,0 @@
1
- "use strict";
2
- /**
3
- * MIT License
4
- *
5
- * Copyright (c) 2020-present, Elastic NV
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in
15
- * all copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- * THE SOFTWARE.
24
- *
25
- */
26
- var _a;
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.options = void 0;
29
- const commander_1 = require("commander");
30
- const reporters_1 = require("./reporters");
31
- /* eslint-disable-next-line @typescript-eslint/no-var-requires */
32
- const { name, version } = require('../package.json');
33
- commander_1.program
34
- .name(`npx ${name}`)
35
- .usage('[options] [dir] [files] file')
36
- .option('-c, --config <path>', 'configuration path (default: synthetics.config.js)')
37
- .option('-s, --suite-params <jsonstring>', 'suite variables', '{}')
38
- .addOption(new commander_1.Option('--reporter <value>', `output repoter format`).choices(Object.keys(reporters_1.reporters)))
39
- .option('-d, --debug', 'print debug logs info')
40
- .option('--pattern <pattern>', 'RegExp file patterns to search inside directory')
41
- .option('--inline', 'Run inline journeys from heartbeat')
42
- .option('-r, --require <modules...>', 'module(s) to preload')
43
- .option('--no-headless', 'run browser in headful mode')
44
- .option('--sandbox', 'enable chromium sandboxing')
45
- .option('--rich-events', 'Mimics a heartbeat run')
46
- .option('--capability <features...>', 'Enable capabilities through feature flags')
47
- .addOption(new commander_1.Option('--screenshots [flag]', 'take screenshots at end of each step')
48
- .choices(['on', 'off', 'only-on-failure'])
49
- .default('on'))
50
- .option('--dry-run', "don't actually execute anything, report only registered journeys")
51
- .option('--match <name>', 'run only journeys with a name or tags that matches the glob')
52
- .option('--tags <name...>', 'run only journeys with the given tag(s), or globs')
53
- .option('--outfd <fd>', 'specify a file descriptor for logs. Default is stdout', parseInt)
54
- .option('--ws-endpoint <endpoint>', 'Browser WebSocket endpoint to connect to')
55
- .option('--pause-on-error', 'pause on error until a keypress is made in the console. Useful during development')
56
- .version(version)
57
- .description('Run synthetic tests');
58
- const command = commander_1.program.parse(process.argv);
59
- const options = command.opts();
60
- exports.options = options;
61
- /**
62
- * Group all events that can be consumed by heartbeat and
63
- * eventually by the Synthetics UI.
64
- */
65
- if (options.richEvents) {
66
- options.reporter = (_a = options.reporter) !== null && _a !== void 0 ? _a : 'json';
67
- options.ssblocks = true;
68
- options.network = true;
69
- }
70
- if (options.capability) {
71
- const supportedCapabilities = [
72
- 'trace',
73
- 'network',
74
- 'filmstrips',
75
- 'metrics',
76
- 'ssblocks',
77
- ];
78
- /**
79
- * trace - record chrome trace events(LCP, FCP, CLS, etc.) for all journeys
80
- * network - capture network information for all journeys
81
- * filmstrips - record detailed filmstrips for all journeys
82
- * metrics - capture performance metrics (DOM Nodes, Heap size, etc.) for each step
83
- * ssblocks - Dedupes the screenshots in to blocks to save storage space
84
- */
85
- for (const flag of options.capability) {
86
- if (supportedCapabilities.includes(flag)) {
87
- options[flag] = true;
88
- }
89
- else {
90
- console.warn(`Missing capability "${flag}", current supported capabilities are ${supportedCapabilities.join(', ')}`);
91
- }
92
- }
93
- }
94
- exports.default = command;
95
- //# sourceMappingURL=parse_args.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse_args.js","sourceRoot":"","sources":["../src/parse_args.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;;AAEH,yCAA4C;AAE5C,2CAAwC;AAExC,iEAAiE;AACjE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAErD,mBAAO;KACJ,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;KACnB,KAAK,CAAC,8BAA8B,CAAC;KACrC,MAAM,CACL,qBAAqB,EACrB,oDAAoD,CACrD;KACA,MAAM,CAAC,iCAAiC,EAAE,iBAAiB,EAAE,IAAI,CAAC;KAClE,SAAS,CACR,IAAI,kBAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,CAAC,OAAO,CAC/D,MAAM,CAAC,IAAI,CAAC,qBAAS,CAAC,CACvB,CACF;KACA,MAAM,CAAC,aAAa,EAAE,uBAAuB,CAAC;KAC9C,MAAM,CACL,qBAAqB,EACrB,iDAAiD,CAClD;KACA,MAAM,CAAC,UAAU,EAAE,oCAAoC,CAAC;KACxD,MAAM,CAAC,4BAA4B,EAAE,sBAAsB,CAAC;KAC5D,MAAM,CAAC,eAAe,EAAE,6BAA6B,CAAC;KACtD,MAAM,CAAC,WAAW,EAAE,4BAA4B,CAAC;KACjD,MAAM,CAAC,eAAe,EAAE,wBAAwB,CAAC;KACjD,MAAM,CACL,4BAA4B,EAC5B,2CAA2C,CAC5C;KACA,SAAS,CACR,IAAI,kBAAM,CAAC,sBAAsB,EAAE,sCAAsC,CAAC;KACvE,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC;KACzC,OAAO,CAAC,IAAI,CAAC,CACjB;KACA,MAAM,CACL,WAAW,EACX,kEAAkE,CACnE;KACA,MAAM,CACL,gBAAgB,EAChB,6DAA6D,CAC9D;KACA,MAAM,CACL,kBAAkB,EAClB,mDAAmD,CACpD;KACA,MAAM,CACL,cAAc,EACd,uDAAuD,EACvD,QAAQ,CACT;KACA,MAAM,CACL,0BAA0B,EAC1B,0CAA0C,CAC3C;KACA,MAAM,CACL,kBAAkB,EAClB,mFAAmF,CACpF;KACA,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,qBAAqB,CAAC,CAAC;AAEtC,MAAM,OAAO,GAAG,mBAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAa,CAAC;AAwCjC,0BAAO;AAtChB;;;GAGG;AACH,IAAI,OAAO,CAAC,UAAU,EAAE;IACtB,OAAO,CAAC,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,MAAM,CAAC;IAC9C,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CACxB;AAED,IAAI,OAAO,CAAC,UAAU,EAAE;IACtB,MAAM,qBAAqB,GAAG;QAC5B,OAAO;QACP,SAAS;QACT,YAAY;QACZ,SAAS;QACT,UAAU;KACX,CAAC;IACF;;;;;;OAMG;IACH,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,UAAU,EAAE;QACrC,IAAI,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YACxC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;SACtB;aAAM;YACL,OAAO,CAAC,IAAI,CACV,uBAAuB,IAAI,yCAAyC,qBAAqB,CAAC,IAAI,CAC5F,IAAI,CACL,EAAE,CACJ,CAAC;SACH;KACF;CACF;AAGD,kBAAe,OAAO,CAAC"}