Skip to content

Commit d262e05

Browse files
authored
fix: Add Locator typings for nth, first and last. (#7176)
1 parent 38458ea commit d262e05

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/browser/context.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,21 @@ export interface Locator extends LocatorSelectors {
435435
* @see {@link https://vitest.dev/guide/browser/locators#all}
436436
*/
437437
all(): Locator[]
438+
/**
439+
* Returns a locator for the nth element matching the selector.
440+
* @see {@link https://vitest.dev/guide/browser/locators#nth}
441+
*/
442+
nth(index: number): Locator
443+
/**
444+
* Returns a locator for the first element matching the selector.
445+
* @see {@link https://vitest.dev/guide/browser/locators#first}
446+
*/
447+
first(): Locator
448+
/**
449+
* Returns a locator for the last element matching the selector.
450+
* @see {@link https://vitest.dev/guide/browser/locators#last}
451+
*/
452+
last(): Locator
438453
}
439454

440455
export interface UserEventTabOptions {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy