Skip to content

Conversation

Oleg-Mozhey
Copy link
Collaborator

The PR adds:

  1. label element into Playwright project
  2. Usage of Xpath or ID when provided
  3. Small refactoring of code

? ElementSelector.XpathSelector
: ElementSelector.IdSelector;
return ((Page) WebContext.Page).GetPlaywrightPage().Locator(selector);
if (ElementSelector.XpathSelector != null)
Copy link
Collaborator

@LukaRukhadze LukaRukhadze Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a good idea to have selector validation here ? Does it mean that we will need to have it in every wrapper method? Isn't it better to have different class and methods for getting Locators, which will check the selector inside them ? E.G. - GetLocator(ElementSelector selector), GetSubLocator(ElementSelector selector, ElementSelector subSelector), GetParentLocator(ElementSelector selector, ElementSelector parentSelector) ?

return ((Page) WebContext.Page).GetPlaywrightPage().Locator(ElementSelector.XpathSelector);
}

if (ElementSelector.IdSelector != null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess automation id selector has more priority than xpath if provided, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants