microsoft / microsoft/playwright-dotnet
[Feature]: Represent ToHaveJSPropertyAsync for JS value undefined
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3k
- Forks
- 304
- Avg merge
- 20h 47m
- Merged PRs (30d)
- 6
Description
🚀 Feature Request
Would like to be able to assert that an element has a property with JS value undefined using ToHaveJSPropertyAsync. It's not clear from documentation or tests in playwright-dotnet how that is done:
Seems to be possible in the JS library based on tests:
https://github.com/microsoft/playwright/blob/dcd350445226ec3c54cc16e8cad1189c61bf07c8/tests/page/expect-misc.spec.ts#L193-L197
Example
No response
Motivation
Better align playwright-dotnet with capabilities of playwright JS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/Playwright.Tests/Assertions/LocatorAssertionsTests.cs around lines 600-618 and compare the referenced JavaScript test in tests/page/expect-misc.spec.ts. Trace how ToHaveJSPropertyAsync represents expected JavaScript values in the .NET assertions, then add coverage for an undefined property value. Done means the .NET assertion can verify undefined consistently with the JavaScript library and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100