Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add label element #154

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

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