rsnext/test/lib/next-webdriver.d.ts
Brandon Bayer 8ccfff10ae
fix types of next-webdriver (#23995)
This does not touch any next.js code. This improves the integration test setup by properly typing next-webdriver.
2021-04-20 18:40:51 +00:00

34 lines
990 B
TypeScript

interface ChainMethods {
elementByCss: (selector: string) => Chain<Element>
elementById: () => Chain<Element>
getValue: () => Chain<any>
text: () => Chain<string>
type: () => Chain<any>
moveTo: () => Chain<any>
getComputedCss: () => Chain<any>
getAttribute: () => Chain<any>
hasElementByCssSelector: () => Chain<any>
click: () => Chain<any>
elementsByCss: () => Chain<Element[]>
waitForElementByCss: (arg: string) => Chain<any>
eval: () => Chain<any>
log: () => Chain<any>
url: () => Chain<any>
back: () => Chain<any>
forward: () => Chain<any>
refresh: () => Chain<any>
setDimensions: (opts: { height: number; width: number }) => Chain<any>
close: () => Chain<any>
quit: () => Chain<any>
}
interface Chain<T> extends Promise<T & ChainMethods>, ChainMethods {}
type Browser = { __brand: 'Browser' }
export default function (
appPort: number,
path: string,
waitHydration?: boolean,
allowHydrationRetry?: boolean
): Promise<Chain<Browser>>