@@ -127,13 +127,13 @@ await page.GetByRole(AriaRole.Button, new() { Name = "Submit" }).Nth(1).ClickAsy
127
127
page.locator("#frame1").contentFrame().getByText("Hello1").click();` ) ;
128
128
129
129
expect . soft ( sources . get ( 'Python' ) ! . text ) . toContain ( `
130
- page.locator("#frame1").content_frame() .get_by_text("Hello1").click()` ) ;
130
+ page.locator("#frame1").content_frame.get_by_text("Hello1").click()` ) ;
131
131
132
132
expect . soft ( sources . get ( 'Python Async' ) ! . text ) . toContain ( `
133
- await page.locator("#frame1").content_frame() .get_by_text("Hello1").click()` ) ;
133
+ await page.locator("#frame1").content_frame.get_by_text("Hello1").click()` ) ;
134
134
135
135
expect . soft ( sources . get ( 'C#' ) ! . text ) . toContain ( `
136
- await page.Locator("#frame1").ContentFrame() .GetByText("Hello1").ClickAsync();` ) ;
136
+ await page.Locator("#frame1").ContentFrame.GetByText("Hello1").ClickAsync();` ) ;
137
137
138
138
139
139
[ sources ] = await Promise . all ( [
@@ -148,13 +148,13 @@ await page.Locator("#frame1").ContentFrame().GetByText("Hello1").ClickAsync();`)
148
148
page.locator("#frame1").contentFrame().locator("iframe").contentFrame().getByText("Hello2").click();` ) ;
149
149
150
150
expect . soft ( sources . get ( 'Python' ) ! . text ) . toContain ( `
151
- page.locator("#frame1").content_frame() .locator("iframe").content_frame() .get_by_text("Hello2").click()` ) ;
151
+ page.locator("#frame1").content_frame.locator("iframe").content_frame.get_by_text("Hello2").click()` ) ;
152
152
153
153
expect . soft ( sources . get ( 'Python Async' ) ! . text ) . toContain ( `
154
- await page.locator("#frame1").content_frame() .locator("iframe").content_frame() .get_by_text("Hello2").click()` ) ;
154
+ await page.locator("#frame1").content_frame.locator("iframe").content_frame.get_by_text("Hello2").click()` ) ;
155
155
156
156
expect . soft ( sources . get ( 'C#' ) ! . text ) . toContain ( `
157
- await page.Locator("#frame1").ContentFrame() .Locator("iframe").ContentFrame() .GetByText("Hello2").ClickAsync();` ) ;
157
+ await page.Locator("#frame1").ContentFrame.Locator("iframe").ContentFrame.GetByText("Hello2").ClickAsync();` ) ;
158
158
159
159
160
160
[ sources ] = await Promise . all ( [
@@ -169,13 +169,13 @@ await page.Locator("#frame1").ContentFrame().Locator("iframe").ContentFrame().Ge
169
169
page.locator("#frame1").contentFrame().locator("iframe").contentFrame().locator("iframe[name=\\"one\\"]").contentFrame().getByText("HelloNameOne").click();` ) ;
170
170
171
171
expect . soft ( sources . get ( 'Python' ) ! . text ) . toContain ( `
172
- page.locator("#frame1").content_frame() .locator("iframe").content_frame() .locator("iframe[name=\\"one\\"]").content_frame() .get_by_text("HelloNameOne").click()` ) ;
172
+ page.locator("#frame1").content_frame.locator("iframe").content_frame.locator("iframe[name=\\"one\\"]").content_frame.get_by_text("HelloNameOne").click()` ) ;
173
173
174
174
expect . soft ( sources . get ( 'Python Async' ) ! . text ) . toContain ( `
175
- await page.locator("#frame1").content_frame() .locator("iframe").content_frame() .locator("iframe[name=\\"one\\"]").content_frame() .get_by_text("HelloNameOne").click()` ) ;
175
+ await page.locator("#frame1").content_frame.locator("iframe").content_frame.locator("iframe[name=\\"one\\"]").content_frame.get_by_text("HelloNameOne").click()` ) ;
176
176
177
177
expect . soft ( sources . get ( 'C#' ) ! . text ) . toContain ( `
178
- await page.Locator("#frame1").ContentFrame() .Locator("iframe").ContentFrame() .Locator("iframe[name=\\"one\\"]").ContentFrame() .GetByText("HelloNameOne").ClickAsync();` ) ;
178
+ await page.Locator("#frame1").ContentFrame.Locator("iframe").ContentFrame.Locator("iframe[name=\\"one\\"]").ContentFrame.GetByText("HelloNameOne").ClickAsync();` ) ;
179
179
180
180
[ sources ] = await Promise . all ( [
181
181
recorder . waitForOutput ( 'JavaScript' , 'HelloNameAnonymous' ) ,
@@ -189,13 +189,13 @@ await page.Locator("#frame1").ContentFrame().Locator("iframe").ContentFrame().Lo
189
189
page.locator("#frame1").contentFrame().locator("iframe").contentFrame().locator("iframe").nth(2).contentFrame().getByText("HelloNameAnonymous").click();` ) ;
190
190
191
191
expect . soft ( sources . get ( 'Python' ) ! . text ) . toContain ( `
192
- page.locator("#frame1").content_frame() .locator("iframe").content_frame() .locator("iframe").nth(2).content_frame() .get_by_text("HelloNameAnonymous").click()` ) ;
192
+ page.locator("#frame1").content_frame.locator("iframe").content_frame.locator("iframe").nth(2).content_frame.get_by_text("HelloNameAnonymous").click()` ) ;
193
193
194
194
expect . soft ( sources . get ( 'Python Async' ) ! . text ) . toContain ( `
195
- await page.locator("#frame1").content_frame() .locator("iframe").content_frame() .locator("iframe").nth(2).content_frame() .get_by_text("HelloNameAnonymous").click()` ) ;
195
+ await page.locator("#frame1").content_frame.locator("iframe").content_frame.locator("iframe").nth(2).content_frame.get_by_text("HelloNameAnonymous").click()` ) ;
196
196
197
197
expect . soft ( sources . get ( 'C#' ) ! . text ) . toContain ( `
198
- await page.Locator("#frame1").ContentFrame() .Locator("iframe").ContentFrame() .Locator("iframe").Nth(2).ContentFrame() .GetByText("HelloNameAnonymous").ClickAsync();` ) ;
198
+ await page.Locator("#frame1").ContentFrame.Locator("iframe").ContentFrame.Locator("iframe").Nth(2).ContentFrame.GetByText("HelloNameAnonymous").ClickAsync();` ) ;
199
199
} ) ;
200
200
201
201
test ( 'should generate frame locators with special characters in name attribute' , async ( { page, openRecorder, server } ) => {
@@ -217,13 +217,13 @@ await page.Locator("#frame1").ContentFrame().Locator("iframe").ContentFrame().Lo
217
217
page.locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").contentFrame().getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Click me")).click()` ) ;
218
218
219
219
expect . soft ( sources . get ( 'Python' ) ! . text ) . toContain ( `
220
- page.locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").content_frame() .get_by_role("button", name="Click me").click()` ) ;
220
+ page.locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").content_frame.get_by_role("button", name="Click me").click()` ) ;
221
221
222
222
expect . soft ( sources . get ( 'Python Async' ) ! . text ) . toContain ( `
223
- await page.locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").content_frame() .get_by_role("button", name="Click me").click()` ) ;
223
+ await page.locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").content_frame.get_by_role("button", name="Click me").click()` ) ;
224
224
225
225
expect . soft ( sources . get ( 'C#' ) ! . text ) . toContain ( `
226
- await page.Locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").ContentFrame() .GetByRole(AriaRole.Button, new() { Name = "Click me" }).ClickAsync();` ) ;
226
+ await page.Locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").ContentFrame.GetByRole(AriaRole.Button, new() { Name = "Click me" }).ClickAsync();` ) ;
227
227
} ) ;
228
228
229
229
test ( 'should generate frame locators with title attribute' , async ( { page, openRecorder, server } ) => {
@@ -246,15 +246,15 @@ await page.Locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").Cont
246
246
) ;
247
247
248
248
expect . soft ( sources . get ( 'Python' ) ! . text ) . toContain (
249
- `page.locator(\"iframe[title=\\\"hello world\\\"]\").content_frame() .get_by_role(\"button\", name=\"Click me\").click()`
249
+ `page.locator(\"iframe[title=\\\"hello world\\\"]\").content_frame.get_by_role(\"button\", name=\"Click me\").click()`
250
250
) ;
251
251
252
252
expect . soft ( sources . get ( 'Python Async' ) ! . text ) . toContain (
253
- `await page.locator("iframe[title=\\\"hello world\\\"]").content_frame() .get_by_role("button", name="Click me").click()`
253
+ `await page.locator("iframe[title=\\\"hello world\\\"]").content_frame.get_by_role("button", name="Click me").click()`
254
254
) ;
255
255
256
256
expect . soft ( sources . get ( 'C#' ) ! . text ) . toContain (
257
- `await page.Locator("iframe[title=\\\"hello world\\\"]").ContentFrame() .GetByRole(AriaRole.Button, new() { Name = "Click me" }).ClickAsync();`
257
+ `await page.Locator("iframe[title=\\\"hello world\\\"]").ContentFrame.GetByRole(AriaRole.Button, new() { Name = "Click me" }).ClickAsync();`
258
258
) ;
259
259
} ) ;
260
260
@@ -278,15 +278,15 @@ await page.Locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").Cont
278
278
) ;
279
279
280
280
expect . soft ( sources . get ( 'Python' ) ! . text ) . toContain (
281
- `page.locator(\"iframe[name=\\\"hello world\\\"]\").content_frame() .get_by_role(\"button\", name=\"Click me\").click()`
281
+ `page.locator(\"iframe[name=\\\"hello world\\\"]\").content_frame.get_by_role(\"button\", name=\"Click me\").click()`
282
282
) ;
283
283
284
284
expect . soft ( sources . get ( 'Python Async' ) ! . text ) . toContain (
285
- `await page.locator("iframe[name=\\\"hello world\\\"]").content_frame() .get_by_role("button", name="Click me").click()`
285
+ `await page.locator("iframe[name=\\\"hello world\\\"]").content_frame.get_by_role("button", name="Click me").click()`
286
286
) ;
287
287
288
288
expect . soft ( sources . get ( 'C#' ) ! . text ) . toContain (
289
- `await page.Locator("iframe[name=\\\"hello world\\\"]").ContentFrame() .GetByRole(AriaRole.Button, new() { Name = "Click me" }).ClickAsync();`
289
+ `await page.Locator("iframe[name=\\\"hello world\\\"]").ContentFrame.GetByRole(AriaRole.Button, new() { Name = "Click me" }).ClickAsync();`
290
290
) ;
291
291
} ) ;
292
292
@@ -310,15 +310,15 @@ await page.Locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").Cont
310
310
) ;
311
311
312
312
expect . soft ( sources . get ( 'Python' ) ! . text ) . toContain (
313
- `page.locator(\"#hello-world\").content_frame() .get_by_role(\"button\", name=\"Click me\").click()`
313
+ `page.locator(\"#hello-world\").content_frame.get_by_role(\"button\", name=\"Click me\").click()`
314
314
) ;
315
315
316
316
expect . soft ( sources . get ( 'Python Async' ) ! . text ) . toContain (
317
- `await page.locator("#hello-world").content_frame() .get_by_role("button", name="Click me").click()`
317
+ `await page.locator("#hello-world").content_frame.get_by_role("button", name="Click me").click()`
318
318
) ;
319
319
320
320
expect . soft ( sources . get ( 'C#' ) ! . text ) . toContain (
321
- `await page.Locator("#hello-world").ContentFrame() .GetByRole(AriaRole.Button, new() { Name = "Click me" }).ClickAsync();`
321
+ `await page.Locator("#hello-world").ContentFrame.GetByRole(AriaRole.Button, new() { Name = "Click me" }).ClickAsync();`
322
322
) ;
323
323
} ) ;
324
324
@@ -342,15 +342,15 @@ await page.Locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").Cont
342
342
) ;
343
343
344
344
expect . soft ( sources . get ( 'Python' ) ! . text ) . toContain (
345
- `page.locator(\"[data-testid=\\\"my-testid\\\"]\").content_frame() .get_by_role(\"button\", name=\"Click me\").click()`
345
+ `page.locator(\"[data-testid=\\\"my-testid\\\"]\").content_frame.get_by_role(\"button\", name=\"Click me\").click()`
346
346
) ;
347
347
348
348
expect . soft ( sources . get ( 'Python Async' ) ! . text ) . toContain (
349
- `await page.locator("[data-testid=\\\"my-testid\\\"]").content_frame() .get_by_role("button", name="Click me").click()`
349
+ `await page.locator("[data-testid=\\\"my-testid\\\"]").content_frame.get_by_role("button", name="Click me").click()`
350
350
) ;
351
351
352
352
expect . soft ( sources . get ( 'C#' ) ! . text ) . toContain (
353
- `await page.Locator("[data-testid=\\\"my-testid\\\"]").ContentFrame() .GetByRole(AriaRole.Button, new() { Name = "Click me" }).ClickAsync();`
353
+ `await page.Locator("[data-testid=\\\"my-testid\\\"]").ContentFrame.GetByRole(AriaRole.Button, new() { Name = "Click me" }).ClickAsync();`
354
354
) ;
355
355
} ) ;
356
356
@@ -371,13 +371,13 @@ await page.Locator("iframe[name=\\"foo\\\\<bar\\\\'\\\\\\"\\\\\`\\\\>\\"]").Cont
371
371
page.locator("#frame1").contentFrame().getByRole(AriaRole.BUTTON, new FrameLocator.GetByRoleOptions().setName("Submit")).click();` ) ;
372
372
373
373
expect . soft ( sources . get ( 'Python' ) ! . text ) . toContain ( `
374
- page.locator("#frame1").content_frame() .get_by_role("button", name="Submit").click()` ) ;
374
+ page.locator("#frame1").content_frame.get_by_role("button", name="Submit").click()` ) ;
375
375
376
376
expect . soft ( sources . get ( 'Python Async' ) ! . text ) . toContain ( `
377
- await page.locator("#frame1").content_frame() .get_by_role("button", name="Submit").click()` ) ;
377
+ await page.locator("#frame1").content_frame.get_by_role("button", name="Submit").click()` ) ;
378
378
379
379
expect . soft ( sources . get ( 'C#' ) ! . text ) . toContain ( `
380
- await page.Locator("#frame1").ContentFrame() .GetByRole(AriaRole.Button, new() { Name = "Submit" }).ClickAsync();` ) ;
380
+ await page.Locator("#frame1").ContentFrame.GetByRole(AriaRole.Button, new() { Name = "Submit" }).ClickAsync();` ) ;
381
381
} ) ;
382
382
383
383
test ( 'should generate getByTestId' , async ( { page, openRecorder } ) => {
0 commit comments