Skip to content

[Feature] Implement Custom Expect Message option #2161

Closed

Description

It would be nice and useful to have Custom Message on Assertion Error
e.g.

var locator = Page.Locator(".my-element");
await Expect(locator, "My Element is not visible!").ToBeVisibleAsync();

This feature is already implemented in Node.js (see Custom Expect Message) so I believe it's quite straightforward and clear what its purpose is.

Activity

  1. Darkle commented on Aug 4, 2023

    @Darkle

    Would very much like this.

  2. gauravkhuraana commented on Feb 22, 2024

    @gauravkhuraana

    can we please have this, we have to use Fluent assertion library to get that, it would be great if we can add this, it can avoid some print statements as well

  3. yevhen-shatikhin commented on May 29, 2024

    @yevhen-shatikhin

    Would very much like this functionality

  4. TheSmartTester commented on Jun 11, 2024

    @TheSmartTester

    It would be fantastic if we could have this functionality please

  5. agbrock commented on Feb 18, 2025

    @agbrock

    Has anyone figured out any good workarounds for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions