You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+30-11Lines changed: 30 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -62,18 +62,30 @@ Worker objects are extended [browser objects](#browser-objects) which contain th
62
62
*`status`: A string representing the current status of the worker.
63
63
* Possible statuses: `"running"`, `"queue"`.
64
64
65
-
#### screenshot objects
65
+
#### screenshot job objects
66
66
67
-
A "screenshot object" is a configuration object to run a screenshot job.
67
+
Screenshot job objects are plain objects which contain the following properties:
68
68
69
-
It is a plain object with properties defined on [BrowserStack's Screenshot API reference](https://www.browserstack.com/screenshots/api#generate-screenshots).
69
+
*`job_id`: The id of the job.
70
+
*`state`: The state of the job.
71
+
*`win_res`: The screen resolution for browsers running on Windows. May be one of: `"1024x768"`, `"1280x1024"`.
72
+
*`mac_res`: The screen resolution for browsers running on Mac OS X. May be one of: `"1024x768"`, `"1280x960"`, `"1280x1024"`, `"1600x1200"`, `"1920x1080"`.
73
+
*`orientation`: The screen orientation for devices. May be one of: `"portrait"`, `"landscape"`.
74
+
*`quality`: The quality of the screenshot. May be one of: `"original"`, `"compressed"`.
75
+
*`wait_time`: The number of seconds to wait before taking the screenshot. May be one of: `2`, `5`, `10`, `15`, `20`, `60`.
76
+
*`local`: Boolean indicating whether a local testing connection should be used.
77
+
*`browsers`: A collection of [browser objects](#browser-objects) indicating which browsers and devices to take screenshots with.
70
78
79
+
### screenshot state objects
71
80
72
-
#### job objects
81
+
Screenshot state objects are extended [browser objects](#browser-objects) which contain the following additional properties:
73
82
74
-
A "job object" is a screenshot job object, commonly used to keep track of the screenshots requested using a [screenshot object](#screenshot-objects). They may also be displayed in the web interface on the BrowserStack website.
75
-
76
-
It is a plain object with properties defined on [BrowserStack's Screenshot API reference](https://www.browserstack.com/screenshots/api#screenshots-states).
83
+
*`id`: The id of the screenshot object.
84
+
*`state`: The state of the screenshot.
85
+
*`url`: The URL of the page the screenshot was generated from.
86
+
*`thumb_url`: The URL for the screenshot thumbnail.
87
+
*`image_url`: The URL for the full-size screenshot.
88
+
*`created_at`: The timestamp indicating when the screenshot was generated.
77
89
78
90
### REST API v4
79
91
@@ -203,17 +215,24 @@ Gets the list of available browsers.
203
215
204
216
Creates a job to take screenshots.
205
217
206
-
*`options`: A hash of settings for the screenshots. See [screenshot objects](#screenshot-objects) for details.
207
-
*`callback` (`function( error, browsers )`): A callback to invoke when the API call is complete.
208
-
* `browsers`: An array of [browser objects](#browser-objects).
218
+
*`options`: A hash of settings for the screenshots. See [screenshot job objects](#screenshot-job-objects) for details.
219
+
* `browsers`: A collection of [browser objects](#browser-objects) indicating which browsers and devices to take screenshots with.
220
+
* `win_res` (optional): Only required if taking a screenshot on Windows. Defaults to `"1024x768"`.
221
+
* `mac_res` (optional): Only required if taking a screenshot on Mac OS X. Defaults to "1024x768"`.
222
+
* `orientation` (optional): Defaults to `"portrait"`.
223
+
* `quality` (optional): Defaults to `"compressed"`.
224
+
* `wait_time` (optional): Defaults to `5`.
225
+
* `local` (optional): Defaults to `false`.
226
+
*`callback` (`function( error, job )`): A callback to invoke when the API call is complete.
227
+
* `job`: A [screenshot job object](#screenshot-job-objects) containing [screenshot state objects](#screenshot-state-objects) in place of [browser objects](#browser-objects).
209
228
210
229
#### screenshotClient.getJob( id, callback )
211
230
212
231
Gets details about the current status of a screenshot job.
213
232
214
233
*`id`: The id of the job.
215
234
*`callback` (`function( error, job )`): A callback to invoke when the API call is complete.
216
-
* `job`: A [job object](#job-objects).
235
+
* `job`: A [screenshot job object](#screenshot-job-objects) containing [screenshot state objects](#screenshot-state-objects) in place of [browser objects](#browser-objects).
0 commit comments