Sauce Labs
All commands are only supported on Chrome using Sauce Labs Extended Debugging capabilities. You can enable these by setting the following Sauce options:
#
getPageLogsGet webpage specific log information based on the last page load.
Sauce Labs command. More details can be found in the official protocol docs.
#
Usage#
ParametersName | Type | Details |
---|---|---|
type | string | log type (e.g. sauce:network', 'sauce:performance') |
#
Examples#
Returns- <object> log: log output of desired type (see example)
#
throttleNetworkWith network conditioning you can test your site on a variety of network connections, including Edge, 3G, and even offline. You can throttle the data throughput, including the maximum download and upload throughput, and use latency manipulation to enforce a minimum delay in connection round-trip time (RTT).
Sauce Labs command. More details can be found in the official protocol docs.
#
Usage#
ParametersName | Type | Details |
---|---|---|
condition | string, object | network condition to set (e.g. 'online', 'offline', 'GPRS', 'Regular 2G', 'Good 2G', 'Regular 3G', 'Good 3G', 'Regular 4G', 'DSL', 'Wifi') |
#
Examples#
throttleCPUYou can throttle the CPU in DevTools to understand how your page performs under that constraint.
Sauce Labs command. More details can be found in the official protocol docs.
#
Usage#
ParametersName | Type | Details |
---|---|---|
rate | number | Rate on how much the CPU should get throttled. |
#
Examples#
interceptRequestAllows modifying any request made by the browser. You can blacklist, modify, or redirect these as required for your tests.
Sauce Labs command. More details can be found in the official protocol docs.
#
Usage#
ParametersName | Type | Details |
---|---|---|
rule | object | A rule describing the request interception. |
#
Examples#
assertPerformanceAssert against the performance baseline of your app.
Sauce Labs command. More details can be found in the official protocol docs.
#
Usage#
ParametersName | Type | Details |
---|---|---|
name | string | Name of the job you created your baseline with. |
metrics optional | string[] | Name of metrics you want to assert agains the baseline. |
#
Example#
Returns- <object> hasRegression: An object containing the result as well as metrics about the result.
#
jankinessCheckPerform a scroll test that evaluates the jankiness of the application.
Sauce Labs command. More details can be found in the official protocol docs.
#
Usage#
Example#
Returns- <object> testResults: An object containing the score as well as metrics around how smooth the UX of the page was during the test.
#
mockRequestMocks a network resource.
Sauce Labs command. More details can be found in the official protocol docs.
#
Usage#
ParametersName | Type | Details |
---|---|---|
url | string | URL glob to match url to mock. |
filterOptions optional | object | Additional filter options for url to mock (e.g. headers, method). |
#
Returns- <object> mockId: An object containing the id of a mock resource.
#
getMockCallsReceive request information about requests that match the mocked resource.
Sauce Labs command. More details can be found in the official protocol docs.
#
Usage#
ParametersName | Type | Details |
---|---|---|
mockId | String | the id of a mock |
#
Returns- <object> requests: A list of request information.
#
clearMockCallsClear list of mock calls.
Sauce Labs command. More details can be found in the official protocol docs.
#
Usage#
ParametersName | Type | Details |
---|---|---|
mockId | String | the id of a mock |
restore optional | boolean | Set to true if mock should be restored as well. |
#
respondMockRespond if mock matches a specific resource.
Sauce Labs command. More details can be found in the official protocol docs.
#
Usage#
ParametersName | Type | Details |
---|---|---|
mockId | String | the id of a mock |
payload optional | object | Information on mock response. |