-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwdio-formatImageName.conf.ts
34 lines (32 loc) · 1.73 KB
/
wdio-formatImageName.conf.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { baseConfig } from "./wdio.base.conf";
import type { ClassOptions } from 'webdriver-image-comparison';
// https://github.com/webdriverio/visual-testing/blob/f4d9e654a746d09e9ca2567ffe69200c161cc14b/packages/visual-service/src/types.ts#L62
type VisualServiceOptions = ClassOptions;
export const config: WebdriverIO.Config = {
...baseConfig,
services: [
[
"visual",
{
/**
* `browserName`: The name of the browser in the provided capabilities
* `browserVersion`: The version of the browser provided in the capabilities
* `deviceName`: The device name from the capabilities
* `dpr`: The device pixel ratio
* `height`: The height of the screen
*
* `logName`: The logName from capabilities
* ^^^^^^^^^^^ NOTE: IT WOULD BE GOOD TO HAVE A LINK TO wdio-ics:options HERE
* REPORTED: https://github.com/webdriverio/visual-testing/issues/729
*
* `mobile`: This will add _app, or the browser name after the deviceName to distinguish app screenshots from browser screenshots
* `platformName`: The name of the platform in the provided capabilities
* `platformVersion`: The version of the platform provided in the capabilities
* `tag`: The tag that is provided in the methods that is being called
* `width`: The width of the screen
*/
formatImageName: `{browserName}-{browserVersion}-{deviceName}-{dpr}-{height}-{logName}-{mobile}-{platformName}-{tag}-{width}`,
} satisfies VisualServiceOptions,
],
],
}