microsoft / microsoft/playwright-dotnet
[Documentation] Custom selector engines before page is created
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3k
- Forks
- 304
- Avg merge
- 20h 47m
- Merged PRs (30d)
- 6
Description
The documentation (both in code and https://playwright.dev/dotnet/docs/extensibility) states:
Selectors must be registered before creating the page.
However the code below works, in a TestClass inheriting from PageTest.
Isn't the page already created when entering this method, given that actions are performed on it?
[TestInitialize]
public async Task InitializeTest()
{
await RegisterCustomSelectors(); // register here
await Page.GotoAsync("/");
await Page.Locator("myengine=test").FillAsync("hi"); // this works!
}
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 the custom selector registration guidance in the code and the .NET extensibility documentation. Trace the PageTest lifecycle around TestInitialize, RegisterCustomSelectors, and Page to compare the stated requirement with the example. Done means both documentation locations accurately explain when registration is valid and why the shown test works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- documentation, testing
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100