Skip to content

Commit

Permalink
fix: Add Locator typings for nth, first and last. (#7176)
Browse files Browse the repository at this point in the history
  • Loading branch information
xeger authored Jan 5, 2025
1 parent 38458ea commit d262e05
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/browser/context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,21 @@ export interface Locator extends LocatorSelectors {
* @see {@link https://vitest.dev/guide/browser/locators#all}
*/
all(): Locator[]
/**
* Returns a locator for the nth element matching the selector.
* @see {@link https://vitest.dev/guide/browser/locators#nth}
*/
nth(index: number): Locator
/**
* Returns a locator for the first element matching the selector.
* @see {@link https://vitest.dev/guide/browser/locators#first}
*/
first(): Locator
/**
* Returns a locator for the last element matching the selector.
* @see {@link https://vitest.dev/guide/browser/locators#last}
*/
last(): Locator
}

export interface UserEventTabOptions {
Expand Down

0 comments on commit d262e05

Please sign in to comment.