Skip to content

Change image state name for full page screenshot #698

@KuznetsovRoman

Description

@KuznetsovRoman

Description

Right now, full-page screenshots are saved in the images database column, the same way user assertView calls are. This full-page screenshot gets a stateName calculated as error_${N}, where N is the number of user assertView commands.

This creates a conflict: if a user calls an assertView with stateName: 'error_1', their screenshot will be missing from the report, overwritten by the automatic full-page screenshot.

This should be fixed. The easiest solution is to change the state's name to something unique that a user would never choose, for example, __testplane_full_page__.

Verify latest release

  • I verified that the issue exists in the latest html-reporter release

Html-reporter version

10.19.0

Last html-reporter version that worked

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

it('some test, async ({browser}) => {
    await browser.url('...') // any url
    await browser.assertView('error_1', 'body');
    throw new Error('any-error');
});

Actual Behavior

AssertView state screenshot is not shown:

Image

Expected Behavior

AssertView state screenshot is shown (like it does with other state names):

Image

Which Node.js version are you using?

20.18.1

Internal issue: https://nda.ya.ru/t/dpHfw1XF7JEZzk

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions