Skip to content

Documentation: It is not possible to create paths in formatImageName #730

@htho

Description

@htho

Pre-check

Describe the improvement

I'd like to report

  • Unclear documentation
  • A typo
  • Missing documentation
  • Other

Description of the improvement / report

I created a repository where I tried to reproduce the problems I found, when setting up visual testing: https://github.com/htho/wdio-repro-visual-service

I was hoping to use formatImageName as a simpler alternative/complement to screenshotPath/resolveSnapshotPath.
As it turns out, we can't have / in the paths, to create directories.
I'd prefer to be able to do that, but at least the documentation should reflect that.

https://github.com/htho/wdio-repro-visual-service/blob/main/wdio-formatImageNameWithPath.conf.ts#L9-L23

services: [
    [
        "visual",
        {
            // TODO: REPORT it is not possible to create paths in formatImageName.
            // * This should be documented.
            // * Could be a simpler alternative to resolveSnapshotPath and screenshotPath.
            //
            // RuntimeError:
            //      Image could not be copied. The following error was thrown:
            //      Error: ENOENT: no such file or directory, open 'C:\dev\github.com\htho\wdio-repro-visual-service\screenshots\test\specs\test.e2e.ts\firefox-latest-one\1024x768p1--someContent.png'
            formatImageName: `{logName}/{width}x{height}p{dpr}--{tag}`,
        } satisfies VisualServiceOptions,
    ],
],

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions