Unverified Commit 8ccfff10 authored by Brandon Bayer's avatar Brandon Bayer Committed by GitHub

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.
parent 7fd5a24d
interface Chain {
elementByCss: (selector: string) => Chain
elementById: () => Chain
getValue: () => Chain
text: () => Chain
type: () => Chain
moveTo: () => Chain
getComputedCss: () => Chain
getAttribute: () => Chain
hasElementByCssSelector: () => Chain
click: () => Chain
elementsByCss: () => Chain
waitForElementByCss: () => Chain
eval: () => Chain
log: () => Chain
url: () => Chain
back: () => Chain
forward: () => Chain
refresh: () => Chain
setDimensions: (opts: { height: number; width: number }) => Chain
close: () => Chain
quit: () => Chain
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>
): Promise<Chain<Browser>>
......@@ -7,7 +7,7 @@ import { Builder, By } from 'selenium-webdriver'
import { Options as ChromeOptions } from 'selenium-webdriver/chrome'
import { Options as SafariOptions } from 'selenium-webdriver/safari'
import { Options as FireFoxOptions } from 'selenium-webdriver/firefox'
import { waitFor } from 'next-test-utils'
import { waitFor } from './next-test-utils'
const {
BROWSER_NAME: browserName = 'chrome',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment