+
+## Step 4: Create and Configure SmartUI Config
+You can now configure your project configurations on using various available options to run your tests with the SmartUI integration. To generate the configuration file, please execute the following command:
+
+```bash
+npx smartui config:create .smartui.json
+```
+Once, the configuration file will be created, you will be seeing the default configuration pre-filled in the configuration file:
+
+```javascript title="/smartui-sdk-project/.smartui.json"
+{
+ "web": {
+ "browsers": [
+ "chrome",
+ "firefox",
+ "safari",
+ "edge"
+ ],
+ "viewports": [
+ [
+ 1920
+ ],
+ [
+ 1366
+ ],
+ [
+ 1028
+ ]
+ ] // Full Page screenshots are captured by default for web viewports
+ },
+ "mobile": {
+ "devices": [
+ "iPhone 14", //iPhone 14 viewport
+ "Galaxy S24" //Galaxy S24 viewport
+ ],
+ "fullPage": true, //Full Page is true by default for mobile viewports
+ "orientation": "portrait" //Change to "landscape" for landscape snapshot
+ },
+ "waitForTimeout": 1000, //Optional (Should only be used in case lazy-loading/async components are present)
+ "waitForPageRender": 50000, //Optional (Should only be used in case of websites which take more than 30s to load)
+ "enableJavaScript": false, //Enable javascript for all the screenshots of the project
+ "allowedHostnames": [] //Additional hostnames to capture assets from
+}
+```
+:::info Advanced options in SmartUI configuration
+- For capturing fullpage or viewport screenshots, please refer to this [documentation](/docs/smartui-sdk-config-options/#12-viewports)
+- For the list of available mobile viewports, please refer to this [documentation](/docs/smartui-sdk-config-options/#list-of-supported-device-viewports)
+- For more information about SmartUI config global options, please refer to this [documentation](/docs/smartui-sdk-config-options/#3-global-options-optional).
+:::
+
+## Step 5: Adding SmartUI function to take screenshot
+You can incorporate SmartUI into your custom `Selenium` automation test (any platform) script by adding the `smartuiSnapshot` function in the required segment of selenium script of which we would like to take the screenshot, as shown below:
+
+```java
+import io.github.lambdatest.*; //Importing the lambdatest-java SDK
+//Rest of your code here
+
+@Test
+ public void basicTest() throws Exception {
+ String spanText;
+ System.out.println("Loading URL");
+
+ driver.get("
\ No newline at end of file
diff --git a/sidebars.js b/sidebars.js
index 1deee0c3b..92508680e 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -2681,105 +2681,112 @@ module.exports = {
type: "doc",
id: "smart-visual-regression-testing",
},
- items: ["smartui-running-your-first-test", "smartui-guided-walkthrough"],
+ items: ["smartui-running-your-first-test", "smartui-guided-walkthrough", "smartui-cli-git-branching-strategy", "smartui-cli-env-variables"],
},
{
type: "category",
collapsed: true,
- label: "Core Concepts",
- items: [
- "smartui-cli-git-branching-strategy",
- "smartui-cli-env-variables",
- ]
- },
- {
- type: "category",
- collapsed: true,
- label: "CLI Setup and Configurations",
+ label: "Languages and Frameworks",
items: [
{
type: "category",
collapsed: true,
- label: "Languages and Frameworks",
+ label: "SDK",
items: [
{
type: "category",
+ label: "Selenium",
collapsed: true,
- label: "SDK",
items: [
{
- type: "category",
- label: "Selenium",
- collapsed: true,
- items: [
- {
- type: "doc",
- label: "Java",
- id: "smartui-selenium-java-sdk",
- },
- {
- type: "doc",
- label: "Javascript",
- id: "smartui-selenium-js-sdk",
- },
- {
- type: "doc",
- label: "C#",
- id: "smartui-selenium-csharp-sdk",
- },
- {
- type: "doc",
- label: "Python",
- id: "smartui-selenium-python-sdk",
- },
- {
- type: "doc",
- label: "Ruby",
- id: "smartui-selenium-ruby-sdk",
- },
- ],
+ type: "doc",
+ label: "Java",
+ id: "smartui-selenium-java-sdk",
},
{
- type: "category",
- label: "Playwright",
- collapsed: true,
- // id: "smart-visual-regression-testing",
- items: [
- {
- type: "doc",
- label: "Javascript",
- id: "smartui-playwright-sdk",
- },
- {
- type: "doc",
- label: "Java",
- id: "smartui-playwright-python-sdk",
- },
- ],
+ type: "doc",
+ label: "Javascript",
+ id: "smartui-selenium-js-sdk",
},
- "smartui-puppeteer-sdk",
- "smartui-testcafe-sdk",
- "smartui-cypress-sdk",
- "smartui-appium-sdk",
- "smartui-wdio-sdk",
- ]
+ {
+ type: "doc",
+ label: "C#",
+ id: "smartui-selenium-csharp-sdk",
+ },
+ {
+ type: "doc",
+ label: "Python",
+ id: "smartui-selenium-python-sdk",
+ },
+ {
+ type: "doc",
+ label: "Ruby",
+ id: "smartui-selenium-ruby-sdk",
+ },
+ ],
},
{
type: "category",
+ label: "Playwright",
collapsed: true,
- label: "Stabilize Your Screenshots",
+ // id: "smart-visual-regression-testing",
items: [
- "smartui-freeze-animations",
- "smartui-handle-dynamic-data",
- "smartui-handle-videos",
- "smartui-handle-lazy-loading",
- "smartui-handle-sticky-elements"
- ]
+ {
+ type: "doc",
+ label: "Javascript",
+ id: "smartui-playwright-sdk",
+ },
+ {
+ type: "doc",
+ label: "Java",
+ id: "smartui-playwright-python-sdk",
+ },
+ ],
},
- "smartui-cli-responsive-dom",
- "smartui-sdk-fetch-results",
+ "smartui-puppeteer-sdk",
+ "smartui-testcafe-sdk",
+ "smartui-cypress-sdk",
+ "smartui-appium-sdk",
+ "smartui-wdio-sdk",
+ ]
+ },
+ {
+ type: "category",
+ collapsed: true,
+ label: "Stabilize Your Screenshots",
+ items: [
+ "smartui-freeze-animations",
+ "smartui-handle-dynamic-data",
+ "smartui-handle-videos",
+ "smartui-handle-lazy-loading",
+ "smartui-handle-sticky-elements"
]
},
+ "smartui-cli-responsive-dom",
+ "smartui-sdk-fetch-results",
+ "smartui-sdk-config-options",
+ "smartui-pdf-comparison",
+ {
+ type: "category",
+ collapsed: true,
+ label: "Lambda Hooks",
+ items: [
+ "selenium-visual-regression",
+ "smart-ui-cypress",
+ "playwright-visual-regression",
+ "puppeteer-visual-regression",
+ "smartui-k6-setup",
+ "appium-visual-regression",
+ "espresso-visual-regression",
+ ]
+ },
+ ]
+ },
+ {
+ type: "category",
+ collapsed: true,
+ label: "CLI Configurations",
+ items: [
"smartui-cli",
"smartui-cli-figma",
{
@@ -2808,7 +2815,6 @@ module.exports = {
"smartui-git-branching-strategy"
]
},
- "smartui-sdk-config-options",
]
},
{
@@ -2860,25 +2866,6 @@ module.exports = {
"smart-ui-build-options",
]
},
- {
- type: "doc",
- label: "Smart PDF Comparison",
- id: "smartui-pdf-comparison",
- },
- {
- type: "category",
- collapsed: true,
- label: "Lambda Hooks",
- items: [
- "selenium-visual-regression",
- "smart-ui-cypress",
- "playwright-visual-regression",
- "puppeteer-visual-regression",
- "smartui-k6-setup",
- "appium-visual-regression",
- "espresso-visual-regression",
- ]
- },
],
],