presidium 3.3.3 → 3.4.0

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.
@@ -141,6 +141,33 @@ class GoogleChromeDevToolsPage {
141
141
  this.websocket = websocket
142
142
  }
143
143
 
144
+ /**
145
+ * @name Page.enable
146
+ *
147
+ * @docs
148
+ * ```coffeescript [specscript]
149
+ * Page.enable(options {
150
+ * sessionId: string,
151
+ * }) -> data Promise<{}>
152
+ * ```
153
+ *
154
+ * Enables Page events for the current target.
155
+ *
156
+ * Arguments:
157
+ * * `options`
158
+ * * `sessionId` - the session ID.
159
+ *
160
+ * Return:
161
+ * * `data` - promise of an empty object.
162
+ *
163
+ * ```javascript
164
+ * await googleChromeDevTools.Page.enable()
165
+ * ```
166
+ */
167
+ enable(options = {}) {
168
+ return _Method.call(this, 'Page.enable', options)
169
+ }
170
+
144
171
  /**
145
172
  * @name Page.navigate
146
173
  *
@@ -176,6 +203,98 @@ class GoogleChromeDevToolsPage {
176
203
  navigate(options = {}) {
177
204
  return _Method.call(this, 'Page.navigate', options)
178
205
  }
206
+
207
+ /**
208
+ * @name Page.handleJavaScriptDialog
209
+ *
210
+ * @docs
211
+ * ```coffeescript [specscript]
212
+ * Page.handleJavaScriptDialog(options {
213
+ * sessionId: string,
214
+ * accept: boolean,
215
+ * promptText: string,
216
+ * }) -> data Promise<{}>
217
+ * ```
218
+ *
219
+ * Handles (accepts or dismisses) a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).
220
+ *
221
+ * Arguments:
222
+ * * `options`
223
+ * * `sessionId` - the session ID.
224
+ * * `accept` - whether to accept or dismiss the dialog.
225
+ * * `promptText` - the text to enter into the dialog prompt before accepting.
226
+ *
227
+ * Return:
228
+ * * `data` - promise of an empty object.
229
+ *
230
+ * ```javascript
231
+ * await googleChromeDevTools.Page.handleJavaScriptDialog({
232
+ * url: 'http://localhost:3000/',
233
+ * })
234
+ * ```
235
+ */
236
+ handleJavaScriptDialog(options = {}) {
237
+ return _Method.call(this, 'Page.handleJavaScriptDialog', options)
238
+ }
239
+
240
+ /**
241
+ * @name Event: Page.javascriptDialogOpening
242
+ *
243
+ * @docs
244
+ * ```coffeescript [specscript]
245
+ * emit('Page.javascriptDialogOpening', data {
246
+ * url: string,
247
+ * frameId: string,
248
+ * message: string,
249
+ * type: 'alert'|'confirm'|'prompt'|'beforeunload',
250
+ * hasBrowserHandler: boolean,
251
+ * })
252
+ * ```
253
+ *
254
+ * The `DOM.attributeModified` event. Emitted when an attribute of an element is modified.
255
+ *
256
+ * Event Data:
257
+ * `data`
258
+ * * `url` - the frame URL.
259
+ * * `frameId` - the frame ID.
260
+ * * `message` - message displayed by the dialog.
261
+ * * `type` - the dialog type.
262
+ * * `hasBrowserHandler` - whether the browser is capable of acting on the given dialog.
263
+ *
264
+ * ```javascript
265
+ * googleChromeDevTools.on('Page.javascriptDialogOpening', data => {
266
+ * console.log('dialog opening', data)
267
+ * })
268
+ * ```
269
+ */
270
+
271
+ /**
272
+ * @name Event: Page.javascriptDialogClosed
273
+ *
274
+ * @docs
275
+ * ```coffeescript [specscript]
276
+ * emit('Page.javascriptDialogClosed', data {
277
+ * frameId: string,
278
+ * result: boolean,
279
+ * userInput: string,
280
+ * })
281
+ * ```
282
+ *
283
+ * The `DOM.attributeModified` event. Emitted when an attribute of an element is modified.
284
+ *
285
+ * Event Data:
286
+ * `data`
287
+ * * `frameId` - the frame ID.
288
+ * * `result` - whether the dialog was confirmed.
289
+ * * `userInput` - the user input if the dialog was a prompt.
290
+ *
291
+ * ```javascript
292
+ * googleChromeDevTools.on('Page.javascriptDialogClosed', data => {
293
+ * console.log('dialog closed', data)
294
+ * })
295
+ * ```
296
+ */
297
+
179
298
  }
180
299
 
181
300
  class GoogleChromeDevToolsDOM {
@@ -292,6 +292,10 @@ class GoogleChromeForTesting {
292
292
  process.exit(1)
293
293
  })
294
294
 
295
+ cmd.on('exit', code => {
296
+ console.log(`${chromeFilepath} exited with code ${code}`)
297
+ })
298
+
295
299
  process.on('SIGTERM', () => {
296
300
  cmd.kill()
297
301
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presidium",
3
- "version": "3.3.3",
3
+ "version": "3.4.0",
4
4
  "description": "A library for creating web services",
5
5
  "author": "Richard Tong",
6
6
  "license": "MIT",