@elastic/synthetics 1.0.0-beta.30 → 1.0.0-beta.33

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 (99) hide show
  1. package/dist/cli.js +51 -26
  2. package/dist/cli.js.map +1 -1
  3. package/dist/common_types.d.ts +4 -1
  4. package/dist/common_types.d.ts.map +1 -1
  5. package/dist/core/expect.d.ts +25 -25
  6. package/dist/core/expect.d.ts.map +1 -1
  7. package/dist/core/expect.js.map +1 -1
  8. package/dist/core/gatherer.d.ts.map +1 -1
  9. package/dist/core/gatherer.js +3 -1
  10. package/dist/core/gatherer.js.map +1 -1
  11. package/dist/core/runner.d.ts.map +1 -1
  12. package/dist/core/runner.js +4 -3
  13. package/dist/core/runner.js.map +1 -1
  14. package/dist/dsl/index.js +5 -1
  15. package/dist/dsl/index.js.map +1 -1
  16. package/dist/dsl/journey.d.ts +2 -1
  17. package/dist/dsl/journey.d.ts.map +1 -1
  18. package/dist/dsl/journey.js +5 -1
  19. package/dist/dsl/journey.js.map +1 -1
  20. package/dist/dsl/monitor.d.ts +2 -1
  21. package/dist/dsl/monitor.d.ts.map +1 -1
  22. package/dist/dsl/monitor.js +2 -2
  23. package/dist/dsl/monitor.js.map +1 -1
  24. package/dist/generator/index.d.ts +11 -3
  25. package/dist/generator/index.d.ts.map +1 -1
  26. package/dist/generator/index.js +98 -27
  27. package/dist/generator/index.js.map +1 -1
  28. package/dist/generator/utils.d.ts +2 -1
  29. package/dist/generator/utils.d.ts.map +1 -1
  30. package/dist/generator/utils.js +27 -4
  31. package/dist/generator/utils.js.map +1 -1
  32. package/dist/helpers.d.ts +10 -5
  33. package/dist/helpers.d.ts.map +1 -1
  34. package/dist/helpers.js +41 -10
  35. package/dist/helpers.js.map +1 -1
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/loader.js +11 -3
  39. package/dist/loader.js.map +1 -1
  40. package/dist/locations/index.d.ts +45 -0
  41. package/dist/locations/index.d.ts.map +1 -0
  42. package/dist/locations/index.js +90 -0
  43. package/dist/locations/index.js.map +1 -0
  44. package/dist/{dsl/locations.d.ts → locations/public-locations.d.ts} +1 -1
  45. package/dist/locations/public-locations.d.ts.map +1 -0
  46. package/dist/{dsl/locations.js → locations/public-locations.js} +1 -1
  47. package/dist/locations/public-locations.js.map +1 -0
  48. package/dist/options.d.ts +7 -0
  49. package/dist/options.d.ts.map +1 -1
  50. package/dist/options.js +21 -1
  51. package/dist/options.js.map +1 -1
  52. package/dist/plugins/index.js +5 -1
  53. package/dist/plugins/index.js.map +1 -1
  54. package/dist/push/bundler.d.ts.map +1 -1
  55. package/dist/push/bundler.js +12 -3
  56. package/dist/push/bundler.js.map +1 -1
  57. package/dist/push/index.d.ts +12 -1
  58. package/dist/push/index.d.ts.map +1 -1
  59. package/dist/push/index.js +137 -8
  60. package/dist/push/index.js.map +1 -1
  61. package/dist/push/monitor.d.ts +7 -0
  62. package/dist/push/monitor.d.ts.map +1 -1
  63. package/dist/push/monitor.js +23 -7
  64. package/dist/push/monitor.js.map +1 -1
  65. package/dist/push/plugin.d.ts.map +1 -1
  66. package/dist/push/plugin.js +11 -2
  67. package/dist/push/plugin.js.map +1 -1
  68. package/dist/push/request.d.ts +8 -7
  69. package/dist/push/request.d.ts.map +1 -1
  70. package/dist/push/request.js +22 -22
  71. package/dist/push/request.js.map +1 -1
  72. package/dist/tsconfig.tsbuildinfo +1 -1
  73. package/package.json +9 -9
  74. package/src/cli.ts +79 -59
  75. package/src/common_types.ts +4 -0
  76. package/src/core/expect.ts +58 -24
  77. package/src/core/gatherer.ts +9 -2
  78. package/src/core/runner.ts +5 -6
  79. package/src/dsl/journey.ts +8 -1
  80. package/src/dsl/monitor.ts +2 -1
  81. package/src/generator/index.ts +138 -34
  82. package/src/generator/utils.ts +29 -3
  83. package/src/helpers.ts +40 -12
  84. package/src/index.ts +1 -0
  85. package/src/loader.ts +11 -2
  86. package/src/locations/index.ts +108 -0
  87. package/src/{dsl/locations.ts → locations/public-locations.ts} +0 -0
  88. package/src/options.ts +38 -0
  89. package/src/push/bundler.ts +7 -2
  90. package/src/push/index.ts +177 -10
  91. package/src/push/monitor.ts +38 -9
  92. package/src/push/plugin.ts +6 -1
  93. package/src/push/request.ts +27 -34
  94. package/templates/journeys/advanced-example-helpers.ts +9 -9
  95. package/templates/journeys/advanced-example.journey.ts +6 -6
  96. package/templates/journeys/example.journey.ts +1 -1
  97. package/templates/synthetics.config.ts +2 -1
  98. package/dist/dsl/locations.d.ts.map +0 -1
  99. package/dist/dsl/locations.js.map +0 -1
package/src/push/index.ts CHANGED
@@ -23,24 +23,71 @@
23
23
  *
24
24
  */
25
25
 
26
+ import { join } from 'path';
27
+ import { existsSync } from 'fs';
28
+ import { readFile, writeFile } from 'fs/promises';
29
+ import { prompt } from 'enquirer';
30
+ import { bold, yellow } from 'kleur/colors';
26
31
  import {
27
- createMonitors,
28
32
  ok,
29
33
  formatAPIError,
30
34
  formatFailedMonitors,
31
35
  formatNotFoundError,
36
+ formatStaleMonitors,
32
37
  } from './request';
38
+ import { buildMonitorSchema, createMonitors, MonitorSchema } from './monitor';
39
+ import { ProjectSettings } from '../generator';
33
40
  import { Monitor } from '../dsl/monitor';
34
- import { PushOptions } from '../common_types';
35
- import { buildMonitorSchema } from './monitor';
36
- import { progress, error, done } from '../helpers';
41
+ import {
42
+ progress,
43
+ apiProgress,
44
+ write,
45
+ error,
46
+ SYNTHETICS_PATH,
47
+ aborted,
48
+ indent,
49
+ safeNDJSONParse,
50
+ done,
51
+ } from '../helpers';
52
+ import type { PushOptions } from '../common_types';
37
53
 
38
54
  export async function push(monitors: Monitor[], options: PushOptions) {
55
+ if (monitors.length === 0) {
56
+ throw 'No Monitors found';
57
+ }
58
+ const duplicates = trackDuplicates(monitors);
59
+ if (duplicates.size > 0) {
60
+ throw error(formatDuplicateError(duplicates));
61
+ }
62
+
39
63
  progress(`preparing all monitors`);
40
64
  const schemas = await buildMonitorSchema(monitors);
65
+
66
+ progress(`creating all monitors`);
67
+ for (const schema of schemas) {
68
+ await pushMonitors({ schemas: [schema], keepStale: true, options });
69
+ }
70
+
71
+ progress(`deleting all stale monitors`);
72
+ await pushMonitors({ schemas, keepStale: false, options });
73
+ done('Pushed');
74
+ }
75
+
76
+ export async function pushMonitors({
77
+ schemas,
78
+ keepStale,
79
+ options,
80
+ }: {
81
+ schemas: MonitorSchema[];
82
+ keepStale: boolean;
83
+ options: PushOptions;
84
+ }) {
41
85
  try {
42
- progress(`creating all monitors`);
43
- const { body, statusCode } = await createMonitors(schemas, options);
86
+ const { body, statusCode } = await createMonitors(
87
+ schemas,
88
+ options,
89
+ keepStale
90
+ );
44
91
  if (statusCode === 404) {
45
92
  throw formatNotFoundError(await body.text());
46
93
  }
@@ -48,12 +95,132 @@ export async function push(monitors: Monitor[], options: PushOptions) {
48
95
  const { error, message } = await body.json();
49
96
  throw formatAPIError(statusCode, error, message);
50
97
  }
51
- const { failedMonitors } = await body.json();
52
- if (failedMonitors.length > 0) {
53
- throw formatFailedMonitors(failedMonitors);
98
+ body.setEncoding('utf-8');
99
+ for await (const data of body) {
100
+ // Its kind of hacky for now where Kibana streams the response by
101
+ // writing the data as NDJSON events (data can be interleaved), we
102
+ // distinguish the final data by checking if the event was a progress vs complete event
103
+ const chunks = safeNDJSONParse(data);
104
+ for (const chunk of chunks) {
105
+ if (typeof chunk === 'string') {
106
+ // TODO: add progress back for all states once we get the fix
107
+ // on kibana side
108
+ keepStale && apiProgress(chunk);
109
+ continue;
110
+ }
111
+ const { failedMonitors, failedStaleMonitors } = chunk;
112
+ if (failedMonitors && failedMonitors.length > 0) {
113
+ throw formatFailedMonitors(failedMonitors);
114
+ }
115
+ if (failedStaleMonitors.length > 0) {
116
+ write(yellow(formatStaleMonitors(failedStaleMonitors)));
117
+ }
118
+ }
54
119
  }
55
- done('Pushed');
56
120
  } catch (e) {
57
121
  error(e);
58
122
  }
59
123
  }
124
+
125
+ function trackDuplicates(monitors: Monitor[]) {
126
+ const monitorMap: Map<string, Monitor> = new Map();
127
+ const duplicates: Set<Monitor> = new Set();
128
+ for (const monitor of monitors) {
129
+ const id = monitor.config.id;
130
+ if (monitorMap.has(id)) {
131
+ duplicates.add(monitorMap.get(id));
132
+ duplicates.add(monitor);
133
+ }
134
+ monitorMap.set(id, monitor);
135
+ }
136
+ return duplicates;
137
+ }
138
+
139
+ export function formatDuplicateError(monitors: Set<Monitor>) {
140
+ let outer = bold(`Aborted: Duplicate monitors found\n`);
141
+
142
+ let inner = '';
143
+ for (const monitor of monitors) {
144
+ const { config, source } = monitor;
145
+ inner += `* ${config.id} - ${source.file}:${source.line}:${source.column}\n`;
146
+ }
147
+ outer += indent(inner);
148
+ return outer;
149
+ }
150
+
151
+ const PROJECT_SETTINGS_PATH = join(SYNTHETICS_PATH, 'project.json');
152
+ const INSTALLATION_HELP = `Run 'npx @elastic/synthetics init' to create project with default settings.`;
153
+
154
+ export async function loadSettings() {
155
+ if (!existsSync(PROJECT_SETTINGS_PATH)) {
156
+ throw error(`Aborted. Synthetics project not set up.
157
+
158
+ ${INSTALLATION_HELP}`);
159
+ }
160
+
161
+ const contents = await readFile(PROJECT_SETTINGS_PATH, 'utf-8');
162
+ return JSON.parse(contents) as ProjectSettings;
163
+ }
164
+
165
+ export function validateSettings(opts: PushOptions) {
166
+ const INVALID = 'Aborted. Invalid synthetics project settings.';
167
+
168
+ let reason = '';
169
+ if (!opts.project) {
170
+ reason = 'Set project id via CLI as `--project <id>`';
171
+ } else if (!opts.locations && !opts.privateLocations) {
172
+ reason = `Set default location for all monitors via
173
+ - CLI as '--locations <values...> or --privateLocations <values...>'
174
+ - Synthetics config file 'monitors.locations' | 'monitors.privateLocations' field`;
175
+ } else if (!opts.schedule) {
176
+ reason = `Set default schedule in minutes for all monitors via
177
+ - CLI as '--schedule <mins>'
178
+ - Synthetics config file 'monitors.schedule' field`;
179
+ }
180
+
181
+ if (!reason) return;
182
+
183
+ throw error(`${INVALID}
184
+
185
+ ${reason}
186
+
187
+ ${INSTALLATION_HELP}`);
188
+ }
189
+
190
+ async function overrideSettings(project: string) {
191
+ const settings = JSON.parse(await readFile(PROJECT_SETTINGS_PATH, 'utf-8'));
192
+ settings.project = project;
193
+
194
+ await writeFile(
195
+ PROJECT_SETTINGS_PATH,
196
+ JSON.stringify(settings, null, 2),
197
+ 'utf-8'
198
+ );
199
+ }
200
+
201
+ export async function catchIncorrectSettings(
202
+ settings: ProjectSettings,
203
+ options: PushOptions
204
+ ) {
205
+ let override = !settings.project;
206
+ if (settings.project && settings.project !== options.project) {
207
+ if (typeof process.env.TEST_OVERRIDE != null) {
208
+ override = Boolean(process.env.TEST_OVERRIDE);
209
+ } else {
210
+ // Add an extra line to make it easier to read the prompt
211
+ write('');
212
+ ({ override } = await prompt<{ override: boolean }>({
213
+ type: 'confirm',
214
+ name: 'override',
215
+ message: `Monitors were pushed under the '${settings.project}' project. Are you sure you want to push them under the new '${options.project}' (note that this will duplicate the monitors, the old ones being orphaned)`,
216
+ initial: false,
217
+ }));
218
+ }
219
+ if (!override) {
220
+ throw aborted('Push command Aborted');
221
+ }
222
+ }
223
+ if (override) {
224
+ await overrideSettings(options.project);
225
+ }
226
+ }
@@ -23,12 +23,14 @@
23
23
  *
24
24
  */
25
25
 
26
- import { mkdir } from 'fs/promises';
26
+ import { mkdir, rm } from 'fs/promises';
27
27
  import { join } from 'path';
28
28
  import { Bundler } from './bundler';
29
- import { CACHE_PATH } from '../helpers';
30
- import { LocationsMap } from '../dsl/locations';
29
+ import { sendRequest } from './request';
30
+ import { removeTrailingSlash, SYNTHETICS_PATH } from '../helpers';
31
+ import { LocationsMap } from '../locations/public-locations';
31
32
  import { Monitor, MonitorConfig } from '../dsl/monitor';
33
+ import { PushOptions } from '../common_types';
32
34
 
33
35
  export type MonitorSchema = Omit<MonitorConfig, 'locations'> & {
34
36
  content: string;
@@ -36,19 +38,23 @@ export type MonitorSchema = Omit<MonitorConfig, 'locations'> & {
36
38
  filter: Monitor['filter'];
37
39
  };
38
40
 
39
- function translateLocation(locations: MonitorConfig['locations']) {
40
- return locations.map(loc => LocationsMap[loc]).filter(Boolean);
41
+ export type APISchema = {
42
+ project: string;
43
+ keep_stale: boolean;
44
+ monitors: MonitorSchema[];
45
+ };
46
+
47
+ function translateLocation(locations?: MonitorConfig['locations']) {
48
+ if (!locations) return [];
49
+ return locations.map(loc => LocationsMap[loc] || loc).filter(Boolean);
41
50
  }
42
51
 
43
52
  export async function buildMonitorSchema(monitors: Monitor[]) {
44
- if (monitors.length == 0) {
45
- throw new Error('No Monitors found');
46
- }
47
53
  /**
48
54
  * Set up the bundle artifacts path which can be used to
49
55
  * create the bundles required for uploading journeys
50
56
  */
51
- const bundlePath = join(CACHE_PATH, 'bundles');
57
+ const bundlePath = join(SYNTHETICS_PATH, 'bundles');
52
58
  await mkdir(bundlePath, { recursive: true });
53
59
  const bundler = new Bundler();
54
60
  const schemas: MonitorSchema[] = [];
@@ -64,5 +70,28 @@ export async function buildMonitorSchema(monitors: Monitor[]) {
64
70
  filter: filter,
65
71
  });
66
72
  }
73
+
74
+ await rm(bundlePath, { recursive: true });
67
75
  return schemas;
68
76
  }
77
+
78
+ export async function createMonitors(
79
+ monitors: MonitorSchema[],
80
+ options: PushOptions,
81
+ keepStale: boolean
82
+ ) {
83
+ const schema: APISchema = {
84
+ project: options.project,
85
+ keep_stale: keepStale,
86
+ monitors,
87
+ };
88
+
89
+ return await sendRequest({
90
+ url:
91
+ removeTrailingSlash(options.url) +
92
+ `/s/${options.space}/api/synthetics/service/project/monitors`,
93
+ method: 'PUT',
94
+ auth: options.auth,
95
+ body: JSON.stringify(schema),
96
+ });
97
+ }
@@ -49,8 +49,13 @@ export type PluginData = {
49
49
  export type PluginCallback = (data: PluginData) => void;
50
50
 
51
51
  export function MultiAssetPlugin(callback: PluginCallback): esbuild.Plugin {
52
+ // Check that the path isn't in an external package by making sure it's at a standard
53
+ // local filesystem location
52
54
  const isBare = (str: string) => {
53
- if (str.startsWith('/') || str.startsWith('./') || str.startsWith('../')) {
55
+ // Note that we use `isAbsolute` to handle UNC/windows style paths like C:\path\to\thing
56
+ // This is not necessary for relative directories since `.\file` is not supported as an import
57
+ // nor is `~/path/to/file`.
58
+ if (path.isAbsolute(str) || str.startsWith('./') || str.startsWith('../')) {
54
59
  return true;
55
60
  }
56
61
  return false;
@@ -24,54 +24,37 @@
24
24
  */
25
25
 
26
26
  import { bold } from 'kleur/colors';
27
- import { request } from 'undici';
28
- import { PushOptions } from '../common_types';
27
+ import { Dispatcher, request } from 'undici';
29
28
  import { indent, symbols } from '../helpers';
30
- import { MonitorSchema } from './monitor';
31
29
 
32
30
  /* eslint-disable @typescript-eslint/no-var-requires */
33
31
  const { version } = require('../../package.json');
34
32
 
35
- export type APISchema = {
36
- project: string;
37
- keep_stale: boolean;
38
- monitors: MonitorSchema[];
33
+ export type APIRequestOptions = {
34
+ url: string;
35
+ method: Dispatcher.HttpMethod;
36
+ auth: string;
37
+ body?: string;
39
38
  };
40
39
 
41
- function getAPIUrl(options: PushOptions) {
42
- // remove trialing / as well
43
- return (
44
- options.url.replace(/\/+$/, '') +
45
- `/s/${options.space}/api/synthetics/service/project/monitors`
46
- );
47
- }
48
-
49
- export function ok(statusCode: number) {
50
- return statusCode >= 200 && statusCode <= 299;
51
- }
52
-
53
- export async function createMonitors(
54
- monitors: MonitorSchema[],
55
- options: PushOptions
56
- ) {
57
- const schema: APISchema = {
58
- project: options.project,
59
- keep_stale: false,
60
- monitors,
61
- };
62
-
63
- return await request(getAPIUrl(options), {
64
- method: 'PUT',
65
- body: JSON.stringify(schema),
40
+ export async function sendRequest(options: APIRequestOptions) {
41
+ return await request(options.url, {
42
+ method: options.method,
43
+ body: options.body,
66
44
  headers: {
67
45
  authorization: `ApiKey ${options.auth}`,
68
46
  'content-type': 'application/json',
69
47
  'user-agent': `Elastic/Synthetics ${version}`,
70
48
  'kbn-xsrf': 'true',
71
49
  },
50
+ headersTimeout: 60 * 1000
72
51
  });
73
52
  }
74
53
 
54
+ export function ok(statusCode: number) {
55
+ return statusCode >= 200 && statusCode <= 299;
56
+ }
57
+
75
58
  export type APIMonitorError = {
76
59
  id?: string;
77
60
  reason: string;
@@ -98,8 +81,8 @@ export function formatAPIError(
98
81
  return outer;
99
82
  }
100
83
 
101
- export function formatFailedMonitors(errors: APIMonitorError[]) {
102
- let outer = bold(`${symbols['failed']} Error\n`);
84
+ function formatMonitorError(errors: APIMonitorError[]) {
85
+ let outer = '';
103
86
  for (const error of errors) {
104
87
  const monitorId = error.id ? `: monitor(${error.id})` : '';
105
88
  let inner = bold(`> ${error.reason}${monitorId}\n`);
@@ -109,3 +92,13 @@ export function formatFailedMonitors(errors: APIMonitorError[]) {
109
92
  }
110
93
  return outer;
111
94
  }
95
+
96
+ export function formatFailedMonitors(errors: APIMonitorError[]) {
97
+ const heading = bold(`${symbols['failed']} Error\n`);
98
+ return heading + formatMonitorError(errors);
99
+ }
100
+
101
+ export function formatStaleMonitors(errors: APIMonitorError[]) {
102
+ const heading = bold(`${symbols['warning']} Warnings\n`);
103
+ return heading + formatMonitorError(errors);
104
+ }
@@ -12,7 +12,7 @@ export const loadAppStep = (page: Page, url: string) => {
12
12
 
13
13
  export const addTaskStep = (page: Page, task: string) => {
14
14
  step(`add task ${task}`, async () => {
15
- const input = await page.$('input.new-todo');
15
+ const input = await page.locator('input.new-todo');
16
16
  await input.type(task);
17
17
  await input.press('Enter');
18
18
  });
@@ -21,12 +21,13 @@ export const addTaskStep = (page: Page, task: string) => {
21
21
  const todosSelector = 'ul.todo-list li.todo';
22
22
 
23
23
  export const findTask = async (page: Page, task: string) => {
24
- return await page.waitForSelector(`${todosSelector} >> text="${task}"`);
24
+ return await page.locator(`${todosSelector} >> text="${task}"`);
25
25
  };
26
26
 
27
- export const assertTaskListSizeStep = async (page: Page, size: number) => {
28
- step(`check that task list has exactly ${size} elements`, async () => {
29
- expect((await page.$$(todosSelector)).length).toBe(size);
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);
30
31
  });
31
32
  };
32
33
 
@@ -40,14 +41,13 @@ export const destroyTaskStep = async (page: Page, task: string) => {
40
41
  step(`destroy task '${task}'`, async () => {
41
42
  const label = await findTask(page, task);
42
43
  // xpath indexes arrays starting at 1!!! Easy to forget!
43
- const li = await label.$('xpath=ancestor::li[1]');
44
- const destroyButton = await li.$('button');
45
-
44
+ const li = await label.locator('xpath=ancestor::li[1]');
45
+ const destroyButton = await li.locator('button');
46
46
  // The destroy button is not visible until hovered. Setup a click test which
47
47
  // will wait up to 30s for the button to be visible.
48
48
  const clickFuture = destroyButton.click();
49
49
  // now hover, making the destroy button clickable
50
- li.hover();
50
+ await li.hover();
51
51
  // now we are done
52
52
  await clickFuture;
53
53
  });
@@ -2,7 +2,7 @@ import { journey } from '@elastic/synthetics';
2
2
  import {
3
3
  loadAppStep,
4
4
  addTaskStep,
5
- assertTaskListSizeStep,
5
+ assertTaskListCountStep,
6
6
  checkForTaskStep,
7
7
  destroyTaskStep,
8
8
  } from './advanced-example-helpers';
@@ -17,10 +17,10 @@ journey('addition and completion of single task', ({ page, params }) => {
17
17
 
18
18
  loadAppStep(page, params.url);
19
19
  addTaskStep(page, testText);
20
- assertTaskListSizeStep(page, 1);
20
+ assertTaskListCountStep(page, 1);
21
21
  checkForTaskStep(page, testText);
22
22
  destroyTaskStep(page, testText);
23
- assertTaskListSizeStep(page, 0);
23
+ assertTaskListCountStep(page, 0);
24
24
  });
25
25
 
26
26
  journey('adding and removing multiple tasks', ({ page, params }) => {
@@ -31,13 +31,13 @@ journey('adding and removing multiple tasks', ({ page, params }) => {
31
31
  addTaskStep(page, t);
32
32
  });
33
33
 
34
- assertTaskListSizeStep(page, 3);
34
+ assertTaskListCountStep(page, 3);
35
35
 
36
36
  // remove the middle task and check that it worked
37
37
  destroyTaskStep(page, testTasks[1]);
38
- assertTaskListSizeStep(page, 2);
38
+ assertTaskListCountStep(page, 2);
39
39
 
40
40
  // add a new task and check it exists
41
41
  addTaskStep(page, 'Task 4');
42
- assertTaskListSizeStep(page, 3);
42
+ assertTaskListCountStep(page, 3);
43
43
  });
@@ -12,7 +12,7 @@ journey('My Example Journey', ({ page, params }) => {
12
12
  });
13
13
 
14
14
  step('assert title', async () => {
15
- const header = await page.$('h1');
15
+ const header = await page.locator('h1');
16
16
  expect(await header.textContent()).toBe('todos');
17
17
  });
18
18
  });
@@ -13,7 +13,8 @@ export default env => {
13
13
  */
14
14
  monitor: {
15
15
  schedule: '{{schedule}}',
16
- locations: ["'{{locations}}'"],
16
+ locations: ['{{locations}}'],
17
+ privateLocations: ['{{privateLocations}}'],
17
18
  },
18
19
  };
19
20
  if (env !== 'development') {
@@ -1 +0,0 @@
1
- {"version":3,"file":"locations.d.ts","sourceRoot":"","sources":["../../src/dsl/locations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,eAAO,MAAM,YAAY;;;;;;;;;;;CAWxB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"locations.js","sourceRoot":"","sources":["../../src/dsl/locations.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,sDAAsD;AACzC,QAAA,YAAY,GAAG;IAC1B,KAAK,EAAE,mBAAmB;IAC1B,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,mBAAmB;IAC9B,cAAc,EAAE,wBAAwB;IACxC,cAAc,EAAE,gBAAgB;IAChC,OAAO,EAAE,gBAAgB;IACzB,WAAW,EAAE,2BAA2B;IACxC,MAAM,EAAE,sBAAsB;IAC9B,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;CACtB,CAAC"}