mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-07 11:46:42 +03:00
test: make sure asLocator works with has+hasText at the same time (#28937)
This commit is contained in:
parent
19a4f15eb6
commit
3851d9b897
@ -356,6 +356,16 @@ it('reverse engineer hasNot', async ({ page }) => {
|
||||
});
|
||||
});
|
||||
|
||||
it('reverse engineer has + hasText', async ({ page }) => {
|
||||
const locator = page.locator('section').filter({ hasText: 'foo', has: page.locator('div') }).locator('a');
|
||||
expect.soft(generate(locator)).toEqual({
|
||||
csharp: `Locator("section").Filter(new() { HasText = "foo" }).Filter(new() { Has = Locator("div") }).Locator("a")`,
|
||||
java: `locator("section").filter(new Locator.FilterOptions().setHasText("foo")).filter(new Locator.FilterOptions().setHas(locator("div"))).locator("a")`,
|
||||
javascript: `locator('section').filter({ hasText: 'foo' }).filter({ has: locator('div') }).locator('a')`,
|
||||
python: `locator("section").filter(has_text="foo").filter(has=locator("div")).locator("a")`,
|
||||
});
|
||||
});
|
||||
|
||||
it('reverse engineer frameLocator', async ({ page }) => {
|
||||
const locator = page
|
||||
.frameLocator('iframe')
|
||||
|
Loading…
Reference in New Issue
Block a user