Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

webdriverio-core.d.ts 50KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436
  1. // -------------------- ATTENTION --------------------
  2. // Do not edit this file as it gets auto-generated!
  3. // For edits modify /scripts/templates/*.tpl.d.ts
  4. // Check CONTRIBUTING.md for more details.
  5. // --------------------------------------------------
  6. //
  7. /// <reference types="node"/>
  8. /// <reference types="webdriver"/>
  9. // See https://github.com/DefinitelyTyped/DefinitelyTyped/issues/24419
  10. interface Element { }
  11. interface Node { }
  12. interface NodeListOf<TNode = Node> { }
  13. declare namespace WebdriverIO {
  14. type LocationParam = 'x' | 'y';
  15. interface LocationReturn {
  16. x: number,
  17. y: number
  18. }
  19. type SizeParam = 'width' | 'height';
  20. interface SizeReturn {
  21. width: number,
  22. height: number
  23. }
  24. interface CSSProperty {
  25. property: string;
  26. value: any;
  27. parsed?: {
  28. // other
  29. unit?: string;
  30. // font-family
  31. value?: any;
  32. string: string;
  33. // color
  34. hex?: string;
  35. alpha?: number;
  36. type?: string;
  37. rgba?: string
  38. }
  39. }
  40. type JsonPrimitive = string | number | boolean | null;
  41. type JsonObject = { [x: string]: JsonPrimitive | JsonObject | JsonArray };
  42. type JsonArray = Array<JsonPrimitive | JsonObject | JsonArray>;
  43. type JsonCompatible = JsonObject | JsonArray;
  44. interface MultiRemoteBrowserOptions {
  45. sessionId?: string
  46. capabilities: WebDriver.DesiredCapabilities;
  47. }
  48. interface MultiRemoteCapabilities {
  49. [instanceName: string]: MultiRemoteBrowserOptions;
  50. }
  51. interface ServiceOption {
  52. [key: string]: any;
  53. }
  54. interface RunnerInstance {
  55. initialise(): Promise<void>
  56. shutdown(): Promise<void>
  57. getWorkerCount(): number
  58. run(args: any): NodeJS.EventEmitter
  59. workerPool: any
  60. }
  61. interface ServiceClass {
  62. new(options: ServiceOption, caps: WebDriver.DesiredCapabilities, config: Options): ServiceInstance
  63. }
  64. interface RunnerClass {
  65. new(configFile: string, config: Omit<WebdriverIO.Config, 'capabilities' | keyof WebdriverIO.Hooks>): RunnerInstance
  66. }
  67. interface ServicePlugin extends ServiceClass {
  68. default: ServiceClass
  69. launcher?: ServiceClass
  70. }
  71. interface RunnerPlugin extends RunnerClass {
  72. default: RunnerClass
  73. launcher?: RunnerClass
  74. }
  75. interface ServiceInstance extends HookFunctions {
  76. options?: Record<string, any>,
  77. capabilities?: WebDriver.DesiredCapabilities,
  78. config?: Config
  79. }
  80. type ServiceEntry = (
  81. /**
  82. * e.g. `services: ['@wdio/sauce-service']`
  83. */
  84. string |
  85. /**
  86. * e.g. `services: [{ onPrepare: () => { ... } }]`
  87. */
  88. HookFunctions |
  89. /**
  90. * e.g. `services: [CustomClass]`
  91. */
  92. ServiceClass |
  93. /**
  94. * e.g. `services: [['@wdio/sauce-service', { ... }]]`
  95. */
  96. [string, ServiceOption] |
  97. /**
  98. * e.g. `services: [[CustomClass, { ... }]]`
  99. */
  100. [ServiceClass, ServiceOption]
  101. )
  102. interface Options {
  103. /**
  104. * Define the protocol you want to use for your browser automation.
  105. * Currently only [`webdriver`](https://www.npmjs.com/package/webdriver) and
  106. * [`devtools`](https://www.npmjs.com/package/devtools) are supported,
  107. * as these are the main browser automation technologies available.
  108. */
  109. automationProtocol?: string;
  110. runner?: string;
  111. /**
  112. * Your cloud service username (only works for Sauce Labs, Browserstack, TestingBot,
  113. * CrossBrowserTesting or LambdaTest accounts). If set, WebdriverIO will automatically
  114. * set connection options for you.
  115. */
  116. user?: string;
  117. /**
  118. * Your cloud service access key or secret key (only works for Sauce Labs, Browserstack,
  119. * TestingBot, CrossBrowserTesting or LambdaTest accounts). If set, WebdriverIO will
  120. * automatically set connection options for you.
  121. */
  122. key?: string;
  123. /**
  124. * If running on Sauce Labs, you can choose to run tests between different datacenters:
  125. * US or EU. To change your region to EU, add region: 'eu' to your config.
  126. */
  127. region?: string;
  128. /**
  129. * Sauce Labs provides a headless offering that allows you to run Chrome and Firefox tests headless.
  130. */
  131. headless?: boolean;
  132. /**
  133. * Define specs for test execution.
  134. */
  135. specs?: string[];
  136. /**
  137. * Exclude specs from test execution.
  138. */
  139. exclude?: string[];
  140. /**
  141. * Files to watch when running `wdio` with the `--watch` flag.
  142. */
  143. filesToWatch?: string[],
  144. /**
  145. * An object describing various of suites, which you can then specify
  146. * with the --suite option on the wdio CLI.
  147. */
  148. suites?: Record<string, string[]>;
  149. /**
  150. * Maximum number of total parallel running workers.
  151. */
  152. maxInstances?: number;
  153. /**
  154. * Maximum number of total parallel running workers per capability.
  155. */
  156. maxInstancesPerCapability?: number;
  157. capabilities?: WebDriver.DesiredCapabilities[] | MultiRemoteCapabilities;
  158. /**
  159. * Directory to store all testrunner log files (including reporter logs and wdio logs).
  160. * If not set, all logs are streamed to stdout. Since most reporters are made to log to
  161. * stdout, it is recommended to only use this option for specific reporters where it
  162. * makes more sense to push report into a file (like the junit reporter, for example).
  163. *
  164. * When running in standalone mode, the only log generated by WebdriverIO will be the wdio log.
  165. */
  166. outputDir?: string;
  167. /**
  168. * Shorten url command calls by setting a base URL.
  169. */
  170. baseUrl?: string;
  171. /**
  172. * If you want your test run to stop after a specific number of test failures, use bail.
  173. * (It defaults to 0, which runs all tests no matter what.) Note: Please be aware that
  174. * when using a third party test runner (such as Mocha), additional configuration might
  175. * be required.
  176. */
  177. bail?: number;
  178. /**
  179. * The number of retry attempts for an entire specfile when it fails as a whole.
  180. */
  181. specFileRetries?: number;
  182. /**
  183. * Delay in seconds between the spec file retry attempts
  184. */
  185. specFileRetriesDelay?: number;
  186. /**
  187. * Whether or not retried specfiles should be retried immediately or deferred to the end of the queue
  188. */
  189. specFileRetriesDeferred?: boolean
  190. /**
  191. * Default timeout for all `waitFor*` commands. (Note the lowercase f in the option name.)
  192. * This timeout only affects commands starting with `waitFor*` and their default wait time.
  193. */
  194. waitforTimeout?: number;
  195. /**
  196. * Default interval for all `waitFor*` commands to check if an expected state (e.g.,
  197. * visibility) has been changed.
  198. */
  199. waitforInterval?: number;
  200. /**
  201. * Defines the test framework to be used by the WDIO testrunner.
  202. */
  203. framework?: string;
  204. /**
  205. * List of reporters to use. A reporter can be either a string, or an array of
  206. * `['reporterName', { <reporter options> }]` where the first element is a string
  207. * with the reporter name and the second element an object with reporter options.
  208. */
  209. reporters?: (string | object)[];
  210. /**
  211. * Determines in which interval the reporter should check if they are synchronised
  212. * if they report their logs asynchronously (e.g. if logs are streamed to a 3rd
  213. * party vendor).
  214. */
  215. reporterSyncInterval?: number;
  216. /**
  217. * Determines the maximum time reporters have to finish uploading all their logs
  218. * until an error is being thrown by the testrunner.
  219. */
  220. reporterSyncTimeout?: number;
  221. /**
  222. * Services take over a specific job you don't want to take care of. They enhance
  223. * your test setup with almost no effort.
  224. */
  225. services?: ServiceEntry[];
  226. /**
  227. * Node arguments to specify when launching child processes.
  228. */
  229. execArgv?: string[];
  230. }
  231. interface RemoteOptions extends WebDriver.Options, HookFunctions, Omit<Options, 'capabilities'> { }
  232. interface MultiRemoteOptions {
  233. [instanceName: string]: WebDriver.DesiredCapabilities;
  234. }
  235. interface Suite {
  236. error?: any;
  237. }
  238. interface Test {}
  239. interface TestResult {
  240. error?: any,
  241. result?: any,
  242. passed: boolean,
  243. duration: number,
  244. retries: { limit: number, attempts: number }
  245. }
  246. interface Results {
  247. finished: number,
  248. passed: number,
  249. failed: number
  250. }
  251. interface HookFunctions {
  252. /**
  253. * Gets executed once before all workers get launched.
  254. * @param config wdio configuration object
  255. * @param capabilities list of capabilities details
  256. */
  257. onPrepare?(
  258. config: Config,
  259. capabilities: WebDriver.DesiredCapabilities[]
  260. ): void;
  261. /**
  262. * Gets executed before a worker process is spawned and can be used to initialise specific service
  263. * for that worker as well as modify runtime environments in an async fashion.
  264. * @param cid capability id (e.g 0-0)
  265. * @param caps object containing capabilities for session that will be spawn in the worker
  266. * @param specs specs to be run in the worker process
  267. * @param args object that will be merged with the main configuration once worker is initialised
  268. * @param execArgv list of string arguments passed to the worker process
  269. */
  270. onWorkerStart?(
  271. cid: string,
  272. caps: WebDriver.DesiredCapabilities,
  273. specs: string[],
  274. args: Config,
  275. execArgv: string[]
  276. ): void;
  277. /**
  278. * Gets executed after all workers got shut down and the process is about to exit. An error
  279. * thrown in the onComplete hook will result in the test run failing.
  280. * @param exitCode runner exit code
  281. * @param config wdio configuration object
  282. * @param capabilities list of capabilities details
  283. * @param results test results
  284. */
  285. onComplete?(
  286. exitCode: number,
  287. config: Config,
  288. capabilities: WebDriver.DesiredCapabilities,
  289. results: Results
  290. ): void;
  291. /**
  292. * Gets executed when a refresh happens.
  293. * @param oldSessionId session id of old session
  294. * @param newSessionId session id of new session
  295. */
  296. onReload?(
  297. oldSessionId: string,
  298. newSessionId: string
  299. ): void;
  300. /**
  301. * Gets executed before test execution begins. At this point you can access to all global
  302. * variables like `browser`. It is the perfect place to define custom commands.
  303. * @param capabilities list of capabilities details
  304. * @param specs specs to be run in the worker process
  305. * @param browser instance of created browser/device session
  306. */
  307. before?(
  308. capabilities: WebDriver.DesiredCapabilities,
  309. specs: string[],
  310. browser: BrowserObject
  311. ): void;
  312. /**
  313. * Runs before a WebdriverIO command gets executed.
  314. * @param commandName command name
  315. * @param args arguments that command would receive
  316. */
  317. beforeCommand?(
  318. commandName: string,
  319. args: any[]
  320. ): void;
  321. /**
  322. * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
  323. * beforeEach in Mocha). `stepData` and `world` are Cucumber framework specific properties.
  324. * @param test details to current running test (or step in Cucumber)
  325. * @param context context to current running test
  326. * @param stepData Cucumber step data
  327. * @param world Cucumber world
  328. */
  329. beforeHook?(test: any, context: any, stepData?: any, world?: any): void;
  330. /**
  331. * Gets executed just before initialising the webdriver session and test framework. It allows you
  332. * to manipulate configurations depending on the capability or spec.
  333. * @param config wdio configuration object
  334. * @param capabilities list of capabilities details
  335. * @param specs list of spec file paths that are to be run
  336. */
  337. beforeSession?(
  338. config: Config,
  339. capabilities: WebDriver.DesiredCapabilities,
  340. specs: string[]
  341. ): void;
  342. /**
  343. * Hook that gets executed before the suite starts.
  344. * @param suite suite details
  345. */
  346. beforeSuite?(suite: Suite): void;
  347. /**
  348. * Function to be executed before a test (in Mocha/Jasmine) starts.
  349. * @param test details to current running test (or step in Cucumber)
  350. * @param context context to current running test
  351. */
  352. beforeTest?(test: Test, context: any): void;
  353. /**
  354. * Hook that gets executed _after_ a hook within the suite ends (e.g. runs after calling
  355. * afterEach in Mocha). `stepData` and `world` are Cucumber framework specific.
  356. * @param test details to current running test (or step in Cucumber)
  357. * @param context context to current running test
  358. * @param result test result
  359. * @param stepData Cucumber step data
  360. * @param world Cucumber world
  361. */
  362. afterHook?(test: any, context: any, result: TestResult, stepData?: any, world?: any): void;
  363. /**
  364. * Gets executed after all tests are done. You still have access to all global variables from
  365. * the test.
  366. * @param result number of total failing tests
  367. * @param capabilities list of capabilities details
  368. * @param specs list of spec file paths that are to be run
  369. */
  370. after?(
  371. result: number,
  372. capabilities: WebDriver.DesiredCapabilities,
  373. specs: string[]
  374. ): void;
  375. /**
  376. * Runs after a WebdriverIO command gets executed
  377. * @param commandName command name
  378. * @param args arguments that command would receive
  379. * @param result result of the command
  380. * @param error error in case something went wrong
  381. */
  382. afterCommand?(
  383. commandName: string,
  384. args: any[],
  385. result: any,
  386. error?: Error
  387. ): void;
  388. /**
  389. * Gets executed right after terminating the webdriver session.
  390. * @param config wdio configuration object
  391. * @param capabilities list of capabilities details
  392. * @param specs list of spec file paths that are to be run
  393. */
  394. afterSession?(
  395. config: Config,
  396. capabilities: WebDriver.DesiredCapabilities,
  397. specs: string[]
  398. ): void;
  399. /**
  400. * Hook that gets executed after the suite has ended
  401. * @param suite suite details
  402. */
  403. afterSuite?(suite: Suite): void;
  404. /**
  405. * Function to be executed after a test (in Mocha/Jasmine) ends.
  406. * @param test details to current running test (or step in Cucumber)
  407. * @param context context to current running test
  408. * @param result test result
  409. */
  410. afterTest?(test: Test, context: any, result: TestResult): void;
  411. }
  412. type _HooksArray = {
  413. [K in keyof Pick<HookFunctions, "onPrepare" | "onWorkerStart" | "onComplete" | "before" | "after" | "beforeSession" | "afterSession">]: HookFunctions[K] | Array<HookFunctions[K]>;
  414. };
  415. type _Hooks = Omit<HookFunctions, "onPrepare" | "onWorkerStart" | "onComplete" | "before" | "after" | "beforeSession" | "afterSession">;
  416. interface Hooks extends _HooksArray, _Hooks { }
  417. type ActionTypes = 'press' | 'longPress' | 'tap' | 'moveTo' | 'wait' | 'release';
  418. interface TouchAction {
  419. action: ActionTypes,
  420. x?: number,
  421. y?: number,
  422. element?: Element,
  423. ms?: number
  424. }
  425. type TouchActionParameter = string | string[] | TouchAction | TouchAction[];
  426. type TouchActions = TouchActionParameter | TouchActionParameter[];
  427. type WaitForOptions = {
  428. timeout?: number,
  429. interval?: number,
  430. timeoutMsg?: string,
  431. reverse?: boolean,
  432. }
  433. type Matcher = {
  434. name: string,
  435. args: Array<string | object>
  436. class?: string
  437. }
  438. type ReactSelectorOptions = {
  439. props?: object,
  440. state?: any[] | number | string | object | boolean
  441. }
  442. type MoveToOptions = {
  443. xOffset?: number,
  444. yOffset?: number
  445. }
  446. type DragAndDropOptions = {
  447. duration?: number
  448. }
  449. type NewWindowOptions = {
  450. windowName?: string,
  451. windowFeatures?: string
  452. }
  453. type PDFPrintOptions = {
  454. orientation?: string,
  455. scale?: number,
  456. background?: boolean,
  457. width?: number,
  458. height?: number,
  459. top?: number,
  460. bottom?: number,
  461. left?: number,
  462. right?: number,
  463. shrinkToFit?: boolean,
  464. pageRanges?: object[]
  465. }
  466. type ClickOptions = {
  467. button?: number | string,
  468. x?: number,
  469. y?: number
  470. }
  471. type WaitUntilOptions = {
  472. timeout?: number,
  473. timeoutMsg?: string,
  474. interval?: number
  475. }
  476. type DragAndDropCoordinate = {
  477. x: number,
  478. y: number
  479. }
  480. /**
  481. * HTTP request data. (copied from the puppeteer-core package as there is currently
  482. * no way to access these types otherwise)
  483. */
  484. type ResourcePriority = 'VeryLow' | 'Low' | 'Medium' | 'High' | 'VeryHigh';
  485. type MixedContentType = 'blockable' | 'optionally-blockable' | 'none';
  486. type ReferrerPolicy = 'unsafe-url' | 'no-referrer-when-downgrade' | 'no-referrer' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin';
  487. interface Request {
  488. /**
  489. * Request URL (without fragment).
  490. */
  491. url: string;
  492. /**
  493. * Fragment of the requested URL starting with hash, if present.
  494. */
  495. urlFragment?: string;
  496. /**
  497. * HTTP request method.
  498. */
  499. method: string;
  500. /**
  501. * HTTP request headers.
  502. */
  503. headers: Record<string, string>;
  504. /**
  505. * HTTP POST request data.
  506. */
  507. postData?: string;
  508. /**
  509. * True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.
  510. */
  511. hasPostData?: boolean;
  512. /**
  513. * The mixed content type of the request.
  514. */
  515. mixedContentType?: MixedContentType;
  516. /**
  517. * Priority of the resource request at the time request is sent.
  518. */
  519. initialPriority: ResourcePriority;
  520. /**
  521. * The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/
  522. */
  523. referrerPolicy: ReferrerPolicy;
  524. /**
  525. * Whether is loaded via link preload.
  526. */
  527. isLinkPreload?: boolean;
  528. }
  529. interface Matches extends Request {
  530. /**
  531. * body response of actual resource
  532. */
  533. body: string | Buffer | JsonCompatible
  534. /**
  535. * HTTP response headers.
  536. */
  537. responseHeaders: Record<string, string>;
  538. /**
  539. * HTTP response status code.
  540. */
  541. statusCode: number;
  542. }
  543. type PuppeteerBrowser = Partial<import('puppeteer').Browser>;
  544. type CDPSession = Partial<import('puppeteer').CDPSession>;
  545. type MockOverwriteFunction = (request: Matches, client: CDPSession) => Promise<string | Record<string, any>>;
  546. type MockOverwrite = string | Record<string, any> | MockOverwriteFunction;
  547. type MockResponseParams = {
  548. statusCode?: number | ((request: Matches) => number),
  549. headers?: Record<string, string> | ((request: Matches) => Record<string, string>),
  550. /**
  551. * fetch real response before responding with mocked data. Default: true
  552. */
  553. fetchResponse?: boolean
  554. }
  555. type MockFilterOptions = {
  556. method?: string | ((method: string) => boolean),
  557. headers?: Record<string, string> | ((headers: Record<string, string>) => boolean),
  558. requestHeaders?: Record<string, string> | ((headers: Record<string, string>) => boolean),
  559. responseHeaders?: Record<string, string> | ((headers: Record<string, string>) => boolean),
  560. statusCode?: number | ((statusCode: number) => boolean),
  561. postData?: string | ((payload: string | undefined) => boolean)
  562. }
  563. type ErrorCode = 'Failed' | 'Aborted' | 'TimedOut' | 'AccessDenied' | 'ConnectionClosed' | 'ConnectionReset' | 'ConnectionRefused' | 'ConnectionAborted' | 'ConnectionFailed' | 'NameNotResolved' | 'InternetDisconnected' | 'AddressUnreachable' | 'BlockedByClient' | 'BlockedByResponse'
  564. type ThrottlePreset = 'offline' | 'GPRS' | 'Regular2G' | 'Good2G' | 'Regular3G' | 'Good3G' | 'Regular4G' | 'DSL' | 'WiFi' | 'online'
  565. interface CustomThrottle {
  566. offline: boolean,
  567. downloadThroughput: number,
  568. uploadThroughput: number,
  569. latency: number
  570. }
  571. type ThrottleOptions = ThrottlePreset | CustomThrottle
  572. type AddCommandFn<IsElement extends boolean = false> = (this: IsElement extends true ? Element : BrowserObject, ...args: any[]) => any
  573. type OverwriteCommandFn<ElementKey extends keyof Element, BrowserKey extends keyof BrowserObject, IsElement extends boolean = false> = (this: IsElement extends true ? Element : BrowserObject, origCommand: IsElement extends true ? Element[ElementKey] : BrowserObject[BrowserKey], ...args: any[]) => any
  574. interface Element extends BrowserObject {
  575. selector: string;
  576. elementId: string;
  577. /**
  578. * w3c
  579. */
  580. "element-6066-11e4-a52e-4f735466cecf"?: string;
  581. /**
  582. * jsonwp
  583. */
  584. ELEMENT?: string;
  585. /**
  586. * index in array of elements
  587. * only applicable if the element found with `$$` command
  588. */
  589. index?: number;
  590. /**
  591. * WebdriverIO.Element or WebdriverIO.BrowserObject
  592. */
  593. parent: Element | WebdriverIO.BrowserObject;
  594. /**
  595. * true if element is a React component
  596. */
  597. isReactElement?: boolean
  598. /**
  599. * add command to `element` scope
  600. */
  601. addCommand(
  602. name: string,
  603. func: AddCommandFn<false>
  604. ): void;
  605. /**
  606. * The `$$` command is a short way to call the [`findElements`](/docs/api/webdriver.html#findelements) command in order
  607. * to fetch multiple elements on the page similar to the `$$` command from the browser scope. The difference when calling
  608. * it from an element scope is that the driver will look within the children of that element.
  609. */
  610. $$(
  611. selector: string | Function | Matcher
  612. ): Promise<ElementArray>;
  613. /**
  614. * The `$` command is a short way to call the [`findElement`](/docs/api/webdriver.html#findelement) command in order
  615. * to fetch a single element on the page similar to the `$` command from the browser scope. The difference when calling
  616. * it from an element scope is that the driver will look within the children of that element. You can also pass in an object as selector
  617. * where the object contains a property `element-6066-11e4-a52e-4f735466cecf` with the value of a reference
  618. * to an element. The command will then transform the reference to an extended WebdriverIO element.
  619. */
  620. $(
  621. selector: string | Function | Matcher
  622. ): Promise<Element>;
  623. /**
  624. * Add a value to an object found by given selector. You can also use unicode
  625. * characters like Left arrow or Back space. WebdriverIO will take care of
  626. * translating them into unicode characters. You’ll find all supported characters
  627. * [here](https://w3c.github.io/webdriver/webdriver-spec.html#keyboard-actions).
  628. * To do that, the value has to correspond to a key from the table. It can be disabled
  629. * by setting `translateToUnicode` optional parameter to false.
  630. */
  631. addValue(
  632. value: string | number | boolean | object | any[],
  633. options?: AddValueOptions
  634. ): Promise<void>;
  635. /**
  636. * Clear a `<textarea>` or text `<input>` element’s value. Make sure you can interact with the
  637. * element before using this command. You can't clear an input element that is disabled or in
  638. * readonly mode.
  639. */
  640. clearValue(): Promise<void>;
  641. /**
  642. * Click on an element.
  643. */
  644. click(
  645. options?: ClickOptions
  646. ): Promise<void>;
  647. /**
  648. * The `customs$$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`
  649. */
  650. custom$$(
  651. strategyName: string,
  652. strategyArguments: any
  653. ): Promise<ElementArray>;
  654. /**
  655. * The `custom$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`
  656. */
  657. custom$(
  658. strategyName: string,
  659. strategyArguments: any
  660. ): Promise<Element>;
  661. /**
  662. * Double-click on an element.
  663. */
  664. doubleClick(): Promise<void>;
  665. /**
  666. * Drag an item to a destination element or position.
  667. */
  668. dragAndDrop(
  669. target: Element | DragAndDropCoordinate,
  670. options?: DragAndDropOptions
  671. ): Promise<void>;
  672. /**
  673. * Get an attribute from a DOM-element based on the attribute name.
  674. */
  675. getAttribute(
  676. attributeName: string
  677. ): Promise<string>;
  678. /**
  679. * Get a css property from a DOM-element selected by given selector. The return value
  680. * is formatted to be testable. Colors gets parsed via [rgb2hex](https://www.npmjs.org/package/rgb2hex)
  681. * and all other properties get parsed via [css-value](https://www.npmjs.org/package/css-value).
  682. */
  683. getCSSProperty(
  684. cssProperty: string
  685. ): Promise<CSSProperty>;
  686. /**
  687. * Get the computed WAI-ARIA label of an element.
  688. */
  689. getComputedLabel(): Promise<string>;
  690. /**
  691. * Get the computed WAI-ARIA label of an element.
  692. */
  693. getComputedRole(): Promise<string>;
  694. /**
  695. * Get source code of specified DOM element by selector.
  696. */
  697. getHTML(
  698. includeSelectorTag?: boolean
  699. ): Promise<string>;
  700. /**
  701. * Determine an element’s location on the page.
  702. */
  703. getLocation(
  704. prop: LocationParam
  705. ): Promise<number>;
  706. /**
  707. * Determine an element’s location on the page.
  708. */
  709. getLocation(): Promise<LocationReturn>;
  710. /**
  711. * The Get Element Property command will return the result of getting a property of an element.
  712. */
  713. getProperty(
  714. property: string
  715. ): Promise<object | string | boolean | number>;
  716. /**
  717. * Get the width and height for an DOM-element.
  718. */
  719. getSize(
  720. prop: SizeParam
  721. ): Promise<number>;
  722. /**
  723. * Get the width and height for an DOM-element.
  724. */
  725. getSize(): Promise<SizeReturn>;
  726. /**
  727. * Get tag name of a DOM-element.
  728. */
  729. getTagName(): Promise<string>;
  730. /**
  731. * Get the text content from a DOM-element. Make sure the element
  732. * you want to request the text from [is interactable](http://www.w3.org/TR/webdriver/#interactable)
  733. * otherwise you will get an empty string as return value. If the element is disabled or not
  734. * visible and you still want to receive the text content use [getHTML](https://webdriver.io/docs/api/element/getHTML.html)
  735. * as a workaround.
  736. */
  737. getText(): Promise<string>;
  738. /**
  739. * Get the value of a `<textarea>`, `<select>` or text `<input>` found by given selector.
  740. * If multiple elements are found via the given selector, an array of values is returned instead.
  741. * For input with checkbox or radio type use isSelected.
  742. */
  743. getValue(): Promise<string>;
  744. /**
  745. * Return true if the selected DOM-element:
  746. * - exists;
  747. * - is visible;
  748. * - is within viewport (if not try scroll to it);
  749. * - its center is not overlapped with another element;
  750. * - is not disabled.
  751. */
  752. isClickable(): Promise<boolean>;
  753. /**
  754. * Return true if the selected DOM-element is displayed.
  755. */
  756. isDisplayed(): Promise<boolean>;
  757. /**
  758. * Return true if the selected DOM-element found by given selector is partially visible and within the viewport.
  759. */
  760. isDisplayedInViewport(): Promise<boolean>;
  761. /**
  762. * Return true or false if the selected DOM-element is enabled.
  763. */
  764. isEnabled(): Promise<boolean>;
  765. /**
  766. * Return true if the selected element matches with the provided one.
  767. */
  768. isEqual(
  769. el: Element
  770. ): Promise<boolean>;
  771. /**
  772. * Returns true if element exists in the DOM
  773. */
  774. isExisting(): Promise<boolean>;
  775. /**
  776. * Return true or false if the selected DOM-element currently has focus. If the selector matches
  777. * multiple elements, it will return true if one of the elements has focus.
  778. */
  779. isFocused(): Promise<boolean>;
  780. /**
  781. * Will return true or false whether or not an `<option>` or `<input>` element of type
  782. * checkbox or radio is currently selected.
  783. */
  784. isSelected(): Promise<boolean>;
  785. /**
  786. * Move the mouse by an offset of the specified element. If no element is specified,
  787. * the move is relative to the current mouse cursor. If an element is provided but
  788. * no offset, the mouse will be moved to the center of the element. If the element
  789. * is not visible, it will be scrolled into view.
  790. */
  791. moveTo(
  792. options?: MoveToOptions
  793. ): Promise<void>;
  794. /**
  795. * Returns the next sibling element of the selected DOM-element.
  796. */
  797. nextElement(): Promise<Element>;
  798. /**
  799. * Returns the parent element of the selected DOM-element.
  800. */
  801. parentElement(): Promise<Element>;
  802. /**
  803. * Returns the previous sibling element of the selected DOM-element.
  804. */
  805. previousElement(): Promise<Element>;
  806. /**
  807. * The `react$$` command is a useful command to query multiple React Components
  808. * by their actual name and filter them by props and state.
  809. */
  810. react$$(
  811. selector: string,
  812. options?: ReactSelectorOptions
  813. ): Promise<ElementArray>;
  814. /**
  815. * The `react$` command is a useful command to query React Components by their
  816. * actual name and filter them by props and state.
  817. */
  818. react$(
  819. selector: string,
  820. options?: ReactSelectorOptions
  821. ): Promise<Element>;
  822. /**
  823. * Save a screenshot of an element to a PNG file on your OS.
  824. */
  825. saveScreenshot(
  826. filename: string
  827. ): Promise<Buffer>;
  828. /**
  829. * Scroll element into viewport ([MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)).
  830. */
  831. scrollIntoView(
  832. scrollIntoViewOptions?: object | boolean
  833. ): Promise<void>;
  834. /**
  835. * Select option with a specific value.
  836. */
  837. selectByAttribute(
  838. attribute: string,
  839. value: string | number
  840. ): Promise<void>;
  841. /**
  842. * Select option with a specific index.
  843. */
  844. selectByIndex(
  845. index: number
  846. ): Promise<void>;
  847. /**
  848. * Select option with displayed text matching the argument.
  849. */
  850. selectByVisibleText(
  851. text: string | number
  852. ): Promise<void>;
  853. /**
  854. * Send a sequence of key strokes to an element (clears value before). If the element
  855. * doesn't need to be cleared first then use addValue. You can also use
  856. * unicode characters like Left arrow or Back space. WebdriverIO will take care of
  857. * translating them into unicode characters. You’ll find all supported characters
  858. * [here](https://w3c.github.io/webdriver/webdriver-spec.html#keyboard-actions).
  859. * To do that, the value has to correspond to a key from the table. It can be disabled
  860. * by setting `translateToUnicode` optional parameter to false.
  861. */
  862. setValue(
  863. value: string | number | boolean | object | any[],
  864. options?: AddValueOptions
  865. ): Promise<void>;
  866. /**
  867. * Access elements inside a given element's shadowRoot
  868. */
  869. shadow$$(
  870. selector: string | Function
  871. ): Promise<ElementArray>;
  872. /**
  873. * Access an element inside a given element's shadowRoot
  874. */
  875. shadow$(
  876. selector: string | Function
  877. ): Promise<Element>;
  878. /**
  879. * The Touch Action API provides the basis of all gestures that can be automated in Appium.
  880. * It is currently only available to native apps and can not be used to interact with webapps.
  881. * At its core is the ability to chain together _ad hoc_ individual actions, which will then be
  882. * applied to an element in the application on the device. The basic actions that can be used are:
  883. */
  884. touchAction(
  885. action: TouchActions
  886. ): Promise<void>;
  887. /**
  888. * Wait for an element for the provided amount of
  889. * milliseconds to be clickable or not clickable.
  890. */
  891. waitForClickable(
  892. options?: WaitForOptions
  893. ): Promise<boolean>;
  894. /**
  895. * Wait for an element for the provided amount of
  896. * milliseconds to be displayed or not displayed.
  897. */
  898. waitForDisplayed(
  899. options?: WaitForOptions
  900. ): Promise<boolean>;
  901. /**
  902. * Wait for an element (selected by css selector) for the provided amount of
  903. * milliseconds to be (dis/en)abled. If multiple elements get queried by given
  904. * selector, it returns true if at least one element is (dis/en)abled.
  905. */
  906. waitForEnabled(
  907. options?: WaitForOptions
  908. ): Promise<boolean>;
  909. /**
  910. * Wait for an element for the provided amount of
  911. * milliseconds to be present within the DOM. Returns true if the selector
  912. * matches at least one element that exists in the DOM, otherwise throws an
  913. * error. If the reverse flag is true, the command will instead return true
  914. * if the selector does not match any elements.
  915. */
  916. waitForExist(
  917. options?: WaitForOptions
  918. ): Promise<boolean>;
  919. /**
  920. * This wait command is your universal weapon if you want to wait on something. It expects a condition
  921. * and waits until that condition is fulfilled with a truthy value. If you use the WDIO testrunner the
  922. * commands within the condition are getting executed synchronously like in your test.
  923. */
  924. waitUntil(
  925. condition: () => Promise<Boolean>,
  926. options?: WaitUntilOptions
  927. ): Promise<boolean>;
  928. }
  929. interface Mock {
  930. /**
  931. * list of requests made by the browser to that mock
  932. */
  933. calls: Matches[];
  934. /**
  935. * Abort the request with one of the following error codes:
  936. * `Failed`, `Aborted`, `TimedOut`, `AccessDenied`, `ConnectionClosed`,
  937. * `ConnectionReset`, `ConnectionRefused`, `ConnectionAborted`,
  938. * `ConnectionFailed`, `NameNotResolved`, `InternetDisconnected`,
  939. * `AddressUnreachable`, `BlockedByClient`, `BlockedByResponse`.
  940. */
  941. abort(
  942. errorCode: ErrorCode
  943. ): Promise<void>;
  944. /**
  945. * Abort the request once with one of the following error codes:
  946. * `Failed`, `Aborted`, `TimedOut`, `AccessDenied`, `ConnectionClosed`,
  947. * `ConnectionReset`, `ConnectionRefused`, `ConnectionAborted`,
  948. * `ConnectionFailed`, `NameNotResolved`, `InternetDisconnected`,
  949. * `AddressUnreachable`, `BlockedByClient`, `BlockedByResponse`.
  950. */
  951. abortOnce(
  952. errorCode: ErrorCode
  953. ): Promise<void>;
  954. /**
  955. * Resets all information stored in the `mock.calls` array.
  956. */
  957. clear(): Promise<void>;
  958. /**
  959. * Always respond with same overwrite.
  960. */
  961. respond(
  962. overwrites: MockOverwrite,
  963. params?: MockResponseParams
  964. ): Promise<void>;
  965. /**
  966. * Only respond once with given overwrite. You can call `respondOnce` multiple
  967. * consecutive times and it will start with the respond you defined last. If you
  968. * only use `respondOnce` and the resource is called more times a mock has been
  969. * defined than it defaults back to the original resource.
  970. */
  971. respondOnce(
  972. overwrites: MockOverwrite,
  973. params?: MockResponseParams
  974. ): Promise<void>;
  975. /**
  976. * Does everything that `mock.clear()` does, and also removes any mocked return values or implementations.
  977. */
  978. restore(): Promise<void>;
  979. }
  980. interface ElementArray extends Array<Element> {
  981. selector: string | Function;
  982. parent: Element | WebdriverIO.BrowserObject;
  983. foundWith: string;
  984. props: any[];
  985. }
  986. interface Timeouts {
  987. implicit?: number,
  988. pageLoad?: number,
  989. script?: number
  990. }
  991. interface Browser extends WebDriver.BaseClient {
  992. config: Config;
  993. options: RemoteOptions;
  994. /**
  995. * add command to `browser` or `element` scope
  996. */
  997. addCommand<IsElement extends boolean = false>(
  998. name: string,
  999. func: AddCommandFn<IsElement>,
  1000. attachToElement?: IsElement
  1001. ): void;
  1002. /**
  1003. * overwrite `browser` or `element` command
  1004. */
  1005. overwriteCommand<ElementKey extends keyof Element, BrowserKey extends keyof BrowserObject, IsElement extends boolean = false>(
  1006. name: IsElement extends true ? ElementKey : BrowserKey,
  1007. func: OverwriteCommandFn<ElementKey, BrowserKey, IsElement>,
  1008. attachToElement?: IsElement
  1009. ): void;
  1010. /**
  1011. * create custom selector
  1012. */
  1013. addLocatorStrategy(
  1014. name: string,
  1015. func: (selector: string) => HTMLElement | HTMLElement[] | NodeListOf<HTMLElement>
  1016. ): void
  1017. /**
  1018. * The `$$` command is a short way to call the [`findElements`](/docs/api/webdriver.html#findelements) command in order
  1019. * to fetch multiple elements on the page. It returns an array with element results that will have an
  1020. * extended prototype to call action commands without passing in a selector. However if you still pass
  1021. * in a selector it will look for that element first and call the action on that element.
  1022. */
  1023. $$(
  1024. selector: string | Function
  1025. ): Promise<ElementArray>;
  1026. /**
  1027. * The `$` command is a short way to call the [`findElement`](/docs/api/webdriver.html#findelement) command in order
  1028. * to fetch a single element on the page. It returns an object that with an extended prototype to call
  1029. * action commands without passing in a selector. However if you still pass in a selector it will look
  1030. * for that element first and call the action on that element. You can also pass in an object as selector
  1031. * where the object contains a property `element-6066-11e4-a52e-4f735466cecf` with the value of a reference
  1032. * to an element. The command will then transform the reference to an extended WebdriverIO element.
  1033. */
  1034. $(
  1035. selector: string | Function | object
  1036. ): Promise<Element>;
  1037. /**
  1038. * The `customs$$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`
  1039. */
  1040. custom$$(
  1041. strategyName: string,
  1042. strategyArguments: any
  1043. ): Promise<ElementArray>;
  1044. /**
  1045. * The `custom$` allows you to use a custom strategy declared by using `browser.addLocatorStrategy`
  1046. */
  1047. custom$(
  1048. strategyName: string,
  1049. strategyArguments: any
  1050. ): Promise<Element>;
  1051. /**
  1052. * This command helps you to debug your integration tests. It stops the running browser and gives
  1053. * you time to jump into it and check the state of your application (e.g. using dev tools).
  1054. * Your terminal transforms into a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)
  1055. * interface that will allow you to try out certain commands, find elements and test actions on
  1056. * them.
  1057. */
  1058. debug(): Promise<void>;
  1059. /**
  1060. * Delete cookies visible to the current page. By providing a cookie name it just removes the single cookie or more when multiple names are passed.
  1061. */
  1062. deleteCookies(
  1063. names?: string | string[]
  1064. ): Promise<void>;
  1065. /**
  1066. * Retrieve a [cookie](https://w3c.github.io/webdriver/webdriver-spec.html#cookies)
  1067. * visible to the current page. You can query a specific cookie by providing the cookie name or
  1068. * retrieve all.
  1069. */
  1070. getCookies(
  1071. names?: string[] | string
  1072. ): Promise<WebDriver.Cookie[]>;
  1073. /**
  1074. * Get the [Puppeteer Browser instance](https://pptr.dev/#?product=Puppeteer&version=v5.1.0&show=api-class-browser)
  1075. * to run commands with Puppeteer. Note that all Puppeteer commands are
  1076. * asynchronous by default so in order to interchange between sync and async
  1077. * execution make sure to wrap your Puppeteer calls within a `browser.call`
  1078. * commands as shown in the example.
  1079. */
  1080. getPuppeteer(): Promise<PuppeteerBrowser>;
  1081. /**
  1082. * Returns browser window size.
  1083. */
  1084. getWindowSize(): Promise<WebDriver.RectReturn>;
  1085. /**
  1086. * Send a sequence of key strokes to the active element. You can also use characters like
  1087. * "Left arrow" or "Back space". WebdriverIO will take care of translating them into unicode
  1088. * characters. You’ll find all supported characters [here](https://w3c.github.io/webdriver/webdriver-spec.html#keyboard-actions).
  1089. * To do that, the value has to correspond to a key from the table.
  1090. */
  1091. keys(
  1092. value: string | string[]
  1093. ): Promise<void>;
  1094. /**
  1095. * Mock the response of a request. You can define a mock based on a matching
  1096. * glob and corresponding header and status code. Calling the mock method
  1097. * returns a stub object that you can use to modify the response of the
  1098. * web resource.
  1099. */
  1100. mock(
  1101. url: string,
  1102. filterOptions?: MockFilterOptions
  1103. ): Promise<Mock>;
  1104. /**
  1105. * Open new window in browser. This command is the equivalent function to `window.open()`. This command does not
  1106. * work in mobile environments.
  1107. */
  1108. newWindow(
  1109. url: string,
  1110. options?: NewWindowOptions
  1111. ): Promise<string>;
  1112. /**
  1113. * Pauses execution for a specific amount of time. It is recommended to not use this command to wait for an
  1114. * element to show up. In order to avoid flaky test results it is better to use commands like
  1115. * [`waitForExist`](/docs/api/element/waitForExist.html) or other waitFor* commands.
  1116. */
  1117. pause(
  1118. milliseconds: number
  1119. ): Promise<void>;
  1120. /**
  1121. * The `react$$` command is a useful command to query multiple React Components
  1122. * by their actual name and filter them by props and state.
  1123. */
  1124. react$$(
  1125. selector: string,
  1126. options?: ReactSelectorOptions
  1127. ): Promise<ElementArray>;
  1128. /**
  1129. * The `react$` command is a useful command to query React Components by their
  1130. * actual name and filter them by props and state.
  1131. */
  1132. react$(
  1133. selector: string,
  1134. options?: ReactSelectorOptions
  1135. ): Promise<Element>;
  1136. /**
  1137. * Creates a new Selenium session with your current capabilities. This is useful if you
  1138. * test highly stateful application where you need to clean the browser session between
  1139. * the tests in your spec file to avoid creating hundreds of single test files with WDIO.
  1140. * Be careful though, this command affects your test time tremendously since spawning
  1141. * new Selenium sessions is very time consuming especially when using cloud services.
  1142. */
  1143. reloadSession(): Promise<void>;
  1144. /**
  1145. * Prints the page of the current browsing context to a PDF file on your OS.
  1146. */
  1147. savePDF(
  1148. filepath: string,
  1149. options?: PDFPrintOptions
  1150. ): Promise<Buffer>;
  1151. /**
  1152. * Appium only. Save a video started by startRecordingScreen command to file.
  1153. * See [Appium docs](http://appium.io/docs/en/commands/device/recording-screen/start-recording-screen/)
  1154. */
  1155. saveRecordingScreen(
  1156. filepath: string
  1157. ): Promise<Buffer>;
  1158. /**
  1159. * Save a screenshot of the current browsing context to a PNG file on your OS. Be aware that
  1160. * some browser drivers take screenshots of the whole document (e.g. Geckodriver with Firefox)
  1161. * and others only of the current viewport (e.g. Chromedriver with Chrome).
  1162. */
  1163. saveScreenshot(
  1164. filepath: string
  1165. ): Promise<Buffer>;
  1166. /**
  1167. * Sets one or more [cookies](https://w3c.github.io/webdriver/#cookies) for the current page. Make sure you are
  1168. * on the page that should receive the cookie. You can't set a cookie for an arbitrary page without
  1169. * being on that page.
  1170. */
  1171. setCookies(
  1172. cookie: WebDriver.Cookie[] | WebDriver.Cookie
  1173. ): Promise<void>;
  1174. /**
  1175. * Sets the timeouts associated with the current session, timeout durations control such
  1176. * behaviour as timeouts on script injection, document navigation, and element retrieval.
  1177. * For more information and examples, see [timeouts guide](https://webdriver.io/docs/timeouts.html#selenium-timeouts).
  1178. */
  1179. setTimeout(
  1180. timeouts: Timeouts
  1181. ): Promise<void>;
  1182. /**
  1183. * Resizes browser window outer size according to provided width and height.
  1184. */
  1185. setWindowSize(
  1186. width: number,
  1187. height: number
  1188. ): Promise<null | object>;
  1189. /**
  1190. * Switch focus to a particular tab / window.
  1191. */
  1192. switchWindow(
  1193. urlOrTitleToMatch: string | RegExp
  1194. ): Promise<void>;
  1195. /**
  1196. * Throttle the network capabilities of the browser. This can help to
  1197. * emulate certain scenarios where a user loses their internet connection
  1198. * and your app needs to address that.
  1199. */
  1200. throttle(
  1201. params: ThrottleOptions
  1202. ): Promise<void>;
  1203. /**
  1204. * The Touch Action API provides the basis of all gestures that can be automated in Appium.
  1205. * It is currently only available to native apps and can not be used to interact with webapps.
  1206. * At its core is the ability to chain together _ad hoc_ individual actions, which will then be
  1207. * applied to an element in the application on the device. The basic actions that can be used are:
  1208. */
  1209. touchAction(
  1210. action: TouchActions
  1211. ): Promise<void>;
  1212. /**
  1213. * Uploads a file to the Selenium Standalone server or other browser driver
  1214. * (e.g. Chromedriver) by using the [`file`](/docs/api/selenium.html#file) command.
  1215. * _Note:_ that this command is only supported if you use a Selenium Hub or
  1216. * Chromedriver directly.
  1217. */
  1218. uploadFile(
  1219. localPath: string
  1220. ): Promise<string>;
  1221. /**
  1222. * Protocol binding to load the URL of the browser. If a baseUrl is
  1223. * specified in the config, it will be prepended to the url parameter using
  1224. * node's url.resolve() method.
  1225. */
  1226. url(
  1227. url?: string
  1228. ): Promise<void>;
  1229. /**
  1230. * This wait command is your universal weapon if you want to wait on something. It expects a condition
  1231. * and waits until that condition is fulfilled with a truthy value. If you use the WDIO testrunner the
  1232. * commands within the condition are getting executed synchronously like in your test.
  1233. */
  1234. waitUntil(
  1235. condition: () => Promise<Boolean>,
  1236. options?: WaitUntilOptions
  1237. ): Promise<boolean>;
  1238. }
  1239. interface BrowserObject {
  1240. isMultiremote?: false;
  1241. /**
  1242. * @private
  1243. */
  1244. _NOT_FIBER?: boolean
  1245. /**
  1246. * @private
  1247. */
  1248. wdioRetries?: number
  1249. }
  1250. type MultiRemoteBrowserReference = Record<string, BrowserObject>
  1251. interface MultiRemoteBrowser extends Browser {
  1252. /**
  1253. * multiremote browser instance names
  1254. */
  1255. instances: string[];
  1256. /**
  1257. * flag to indicate multiremote browser session
  1258. */
  1259. isMultiremote: boolean;
  1260. }
  1261. type MultiRemoteBrowserObject = MultiRemoteBrowser & MultiRemoteBrowserReference
  1262. interface Config extends Options, Omit<WebDriver.Options, "capabilities">, Hooks {
  1263. /**
  1264. * internal usage only. To run in watch mode see https://webdriver.io/docs/watcher.html
  1265. */
  1266. watch?: boolean;
  1267. runnerEnv?: Record<string, any>;
  1268. }
  1269. interface AddValueOptions {
  1270. translateToUnicode?: boolean
  1271. }
  1272. }