You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
}
The text was updated successfully, but these errors were encountered:
In TestInitialize works after adding a try/catch so it won't fail from the second test onwards.
We have tests running against Microsoft Dynamics, and it's easiest to select components by data-dyn-role or data-dyn-controlname attributes.
So instead of css=[data-dyn-controlname=something] I can write ddc=something.
An alternative could be to write extension methods on IPage and ILocator for this, but I like the brevity of the custom selectors.
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 fromPageTest
.Isn't the page already created when entering this method, given that actions are performed on it?
The text was updated successfully, but these errors were encountered: