Skip to main content

SmartUI SDK Advanced Configuration Options


Welcome to the world of simplified visual testing with the SmartUI SDK.

This guide is designed to provide you with comprehensive information about the various configuration options available within the SmartUI SDK. Whether you're a new user seeking to customize your SmartUI integration or an experienced developer looking to optimize your testing workflows, this documentation will serve as your go-to resource for understanding and utilizing the configuration options effectively.

To generate the SmartUI SDK configuration file, please execute the following command:

npx smartui config:create .smartui.json

Configuration File Structure

The SmartUI configuration file follows a JSON structure. Below is a sample configuration file with detailed explanations of each option:

{
"web": {
"browsers": [
"chrome",
"firefox",
"safari",
"edge"
],
"viewports": [
[1920],
[1366],
[1028]
]
},
"mobile": {
"devices": [
"iPhone 14",
"Galaxy S24"
],
"fullPage": true,
"orientation": "portrait"
},
"waitForTimeout": 1000,
"waitForPageRender": 50000,
"enableJavaScript": false,
"allowedHostnames": ["cdn.xyz.com"]
}

Configuration Options

browsers

An array of browsers to capture screenshots from. Supported browsers include chrome, firefox, safari, and edge.

viewports

An array of arrays representing different screen resolutions for web browsers. Each inner array contains viewport sizes. Each web viewport is automatically rendered for each of the browser mentioned in the config.

For capturing fullpage screenshots

To capture a screenshot of the entire page, you only need to define the viewport width in your configuration settings. Specify the desired width parameters as demonstrated in the following example to ensure a fullpage capture.

Full Page Capture
    "viewports": [
[
1920
],
[
1366
],
[
360
]
],

For capturing viewport screenshots

To capture a screenshot of the content currently visible in your viewport, rather than the entire page, it's important to define the viewport's width and height in your configuration settings. Specify the desired width and height parameters as demonstrated in the following example to ensure that the screenshot encompasses only the viewport area.

Viewport Capture
    "viewports": [
[
1920,
1080
],
[
1366,
768
],
[
360,
640
]
],

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles