Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

toMatchText failed due to whitespaces #124

@yotov

Description

@yotov

Hi guys,

I replaced the deprecated method toHaveText with the new one toMatchText and many of the tests failed. The reason for the failure is the presence of whitespace.

For example, this code is going to fail:

<button>
<i class="click-icon"></i>
<span>Click here</span>
</button>
------------------------
await expect(page).toMatchText('button', 'Click here');

Is there an option to modify toMatchText to run trim on textContent?

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