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: docs/playwright-visual-regression.md
+195Lines changed: 195 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -251,6 +251,201 @@ For additional information about Playwright framework please explore the documen
251
251
252
252
**Handling Dynamic Data** - In case if you have any dynamic elements that are not in the same position across test runs, you can ignore or select a specific area to be removed from the comparison. For accessing such HTML DOM Config and Options, click [here](/support/docs/html-dom-smartui-options/#configuration-for-playwright).
253
253
254
+
## Best Practices
255
+
256
+
### 1. Capability Configuration
257
+
258
+
- Always set `visual: true` in your capabilities to enable SmartUI
259
+
- Use consistent project and build names across test runs
260
+
- Set meaningful test names for better organization
261
+
262
+
**Example:**
263
+
```javascript
264
+
constcapabilities= {
265
+
browserName:'Chrome',
266
+
browserVersion:'latest',
267
+
platformName:'Windows 10',
268
+
'LT:Options': {
269
+
username:process.env.LT_USERNAME,
270
+
accessKey:process.env.LT_ACCESS_KEY,
271
+
visual:true,
272
+
name:'Homepage Visual Test',
273
+
build:'Release 1.0',
274
+
'smartUI.project':'MyProject',
275
+
'smartUI.build':'Build-1.0'
276
+
}
277
+
};
278
+
```
279
+
280
+
### 2. Screenshot Timing
281
+
282
+
- Wait for page elements to load before capturing screenshots
283
+
- Use Playwright's wait methods for dynamic content
0 commit comments