Service Options
Service options are the options that can be set when the service is instantiated and will be used for each method call.
// wdio.conf.(js|ts)
export const config = {
// ...
// =====
// Setup
// =====
services: [
[
"visual",
{
// The options
},
],
],
// ...
};
Default Options
addressBarShadowPadding
- Type:
number
- Mandatory: No
- Default:
6
- Supported: Web
The padding needs to be added to the address bar on iOS and Android to do a proper cutout of the viewport.
autoElementScroll
- Type:
boolean
- Mandatory: No
- Default:
true
- Supported: Web, Hybrid App (Webview)
This option allows you to disable the automatic scrolling of the element into the view when an element screenshot is created.
addIOSBezelCorners
- Type:
boolean
- Mandatory: No
- Default:
false
- Supported: Web, Hybrid App (Webview), Native App
Add bezel corners and notch/dynamic island to the screenshot for iOS devices.
- iPhone X:
iphonex
- iPhone XS:
iphonexs
- iPhone XS Max:
iphonexsmax
- iPhone XR:
iphonexr
- iPhone 11:
iphone11
- iPhone 11 Pro:
iphone11pro
- iPhone 11 Pro Max:
iphone11promax
- iPhone 12:
iphone12
- iPhone 12 Mini:
iphone12mini
- iPhone 12 Pro:
iphone12pro
- iPhone 12 Pro Max:
iphone12promax
- iPhone 13:
iphone13
- iPhone 13 Mini:
iphone13mini
- iPhone 13 Pro:
iphone13pro
- iPhone 13 Pro Max:
iphone13promax
- iPhone 14:
iphone14
- iPhone 14 Plus:
iphone14plus
- iPhone 14 Pro:
iphone14pro
- iPhone 14 Pro Max:
iphone14promax
iPads: - iPad Mini 6th Generation:
ipadmini
- iPad Air 4th Generation:
ipadair
- iPad Air 5th Generation:
ipadair
- iPad Pro (11-inch) 1st Generation:
ipadpro11
- iPad Pro (11-inch) 2nd Generation:
ipadpro11
- iPad Pro (11-inch) 3rd Generation:
ipadpro11
- iPad Pro (12.9-inch) 3rd Generation:
ipadpro129
- iPad Pro (12.9-inch) 4th Generation:
ipadpro129
- iPad Pro (12.9-inch) 5th Generation:
ipadpro129
autoSaveBaseline
- Type:
boolean
- Mandatory: No
- Default:
true
- Supported: Web, Hybrid App (Webview), Native App
If no baseline image is found during the comparison the image is automatically copied to the baseline folder.
baselineFolder
- Type:
string|()=> string
- Mandatory: No
- Default:
.path/to/testfile/__snapshots__/
- Supported: Web, Hybrid App (Webview), Native App
The directory that will hold all the baseline images that are used during the comparison. If not set, the default value will be used which will store the files in a __snapshots__/
-folder next to the spec that executes the visual tests. A function that returns a string
can also be used to set the baselineFolder
value:
{
baselineFolder: path.join(process.cwd(), 'foo', 'bar', 'baseline')
},
// OR
{
baselineFolder: () => {
// Do some magic here
return path.join(process.cwd(), 'foo', 'bar', 'baseline');
}
}