mirror of
https://github.com/microsoft/playwright-java.git
synced 2026-02-12 00:14:26 +00:00
Fixes https://github.com/microsoft/playwright-java/issues/1130
This commit is contained in:
parent
e47d0ab16c
commit
04158db747
@ -245,7 +245,7 @@ class LocatorImpl implements Locator {
|
||||
|
||||
@Override
|
||||
public Locator getByRole(AriaRole role, GetByRoleOptions options) {
|
||||
return null;
|
||||
return locator(getByRoleSelector(role, options));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -171,4 +171,12 @@ public class TestSelectorsGetBy extends TestBase {
|
||||
asList("<a href=\"https://playwright.dev\">he llo 56</a>"),
|
||||
page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName(" he \n llo 56 ").setExact(true)).evaluateAll("els => els.map(e => e.outerHTML)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void locatorGetByRole() {
|
||||
page.setContent("<div><button>Click me</button></div>");
|
||||
assertEquals(
|
||||
asList("<button>Click me</button>"),
|
||||
page.locator("div").getByRole(AriaRole.BUTTON).evaluateAll("els => els.map(e => e.outerHTML)"));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user