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.

webdriver.d.ts 108KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856
  1. /// <reference types="node"/>
  2. // -------------------- ATTENTION --------------------
  3. // Do not edit this file as it gets auto-generated!
  4. // For edits modify /scripts/templates/*.tpl.d.ts
  5. // Check CONTRIBUTING.md for more details.
  6. // --------------------------------------------------
  7. //
  8. // Type definitions for WebDriver v5
  9. // Project: https://www.npmjs.com/package/webdriver
  10. // Definitions by: auto generated by https://github.com/webdriverio/webdriverio
  11. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  12. declare type HTTPRequestOptions = import('got').Options;
  13. declare type HTTPResponse = import('got').Response;
  14. declare type HTTPAgent = import('http').Agent;
  15. declare type HTTPSAgent = import('https').Agent;
  16. declare namespace WebDriver {
  17. type PageLoadingStrategy = 'none' | 'eager' | 'normal';
  18. type ProxyTypes = 'pac' | 'noproxy' | 'autodetect' | 'system' | 'manual';
  19. type WebDriverLogTypes = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent';
  20. type LoggingPreferenceType =
  21. 'OFF' | 'SEVERE' | 'WARNING' |
  22. 'INFO' | 'CONFIG' | 'FINE' |
  23. 'FINER' | 'FINEST' | 'ALL';
  24. type FirefoxLogLevels =
  25. 'trace' | 'debug' | 'config' |
  26. 'info' | 'warn' | 'error' | 'fatal';
  27. export type Timeouts = Record<'script' | 'pageLoad' | 'implicit', number>;
  28. export type SameSiteOptions = 'Lax' | 'Strict';
  29. type ElementReferenceId = 'element-6066-11e4-a52e-4f735466cecf'
  30. type ElementReference = Record<ElementReferenceId, string>
  31. interface ProxyObject {
  32. proxyType?: ProxyTypes;
  33. proxyAutoconfigUrl?: string;
  34. ftpProxy?: string;
  35. ftpProxyPort?: number;
  36. httpProxy?: string;
  37. httpProxyPort?: number;
  38. sslProxy?: string;
  39. sslProxyPort?: number;
  40. socksProxy?: string;
  41. socksProxyPort?: number;
  42. socksVersion?: string;
  43. socksUsername?: string;
  44. socksPassword?: string;
  45. }
  46. interface LoggingPreferences {
  47. browser?: LoggingPreferenceType;
  48. driver?: LoggingPreferenceType;
  49. server?: LoggingPreferenceType;
  50. client?: LoggingPreferenceType;
  51. }
  52. interface Cookie {
  53. /**
  54. * The name of the cookie.
  55. */
  56. name: string;
  57. /**
  58. * The cookie value.
  59. */
  60. value: string;
  61. /**
  62. * The cookie path. Defaults to "/" if omitted when adding a cookie.
  63. */
  64. path?: string;
  65. /**
  66. * The domain the cookie is visible to. Defaults to the current browsing context’s
  67. * active document’s URL domain if omitted when adding a cookie.
  68. */
  69. domain?: string;
  70. /**
  71. * Whether the cookie is a secure cookie. Defaults to false if omitted when adding
  72. * a cookie.
  73. */
  74. secure?: boolean;
  75. /**
  76. * Whether the cookie is an HTTP only cookie. Defaults to false if omitted when
  77. * adding a cookie.
  78. */
  79. httpOnly?: boolean;
  80. /**
  81. * When the cookie expires, specified in seconds since Unix Epoch. Must not be set if
  82. * omitted when adding a cookie.
  83. */
  84. expiry?: number;
  85. /**
  86. * Whether the cookie applies to a SameSite policy. Defaults to None if omitted when
  87. * adding a cookie. Can be set to either "Lax" or "Strict".
  88. */
  89. sameSite?: SameSiteOptions
  90. }
  91. interface ChromeOptions {
  92. /**
  93. * List of command-line arguments to use when starting Chrome. Arguments with an
  94. * associated value should be separated by a '=' sign (e.g., `['start-maximized', 'user-data-dir=/tmp/temp_profile']`).
  95. * See here for a list of Chrome arguments.
  96. */
  97. args?: string[];
  98. /**
  99. * Path to the Chrome executable to use (on Mac OS X, this should be the actual binary,
  100. * not just the app. e.g., '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome')
  101. */
  102. binary?: string;
  103. /**
  104. * A list of Chrome extensions to install on startup. Each item in the list should
  105. * be a base-64 encoded packed Chrome extension (.crx)
  106. */
  107. extensions?: string[];
  108. /**
  109. * A dictionary with each entry consisting of the name of the preference and its value.
  110. * These preferences are applied to the Local State file in the user data folder.
  111. */
  112. localState?: {
  113. [name: string]: any;
  114. };
  115. /**
  116. * If false, Chrome will be quit when ChromeDriver is killed, regardless of whether
  117. * the session is quit. If true, Chrome will only be quit if the session is quit
  118. * (or closed). Note, if true, and the session is not quit, ChromeDriver cannot clean
  119. * up the temporary user data directory that the running Chrome instance is using.
  120. */
  121. detach?: boolean;
  122. /**
  123. * An address of a Chrome debugger server to connect to, in the form of `<hostname/ip:port>`,
  124. * e.g. '127.0.0.1:38947'
  125. */
  126. debuggerAddress?: string;
  127. /**
  128. * List of Chrome command line switches to exclude that ChromeDriver by default passes
  129. * when starting Chrome. Do not prefix switches with --.
  130. */
  131. excludeSwitches?: string[];
  132. /**
  133. * Directory to store Chrome minidumps . (Supported only on Linux.)
  134. */
  135. minidumpPath?: string;
  136. /**
  137. * A dictionary with either a value for “deviceName,” or values for “deviceMetrics” and
  138. * “userAgent.” Refer to Mobile Emulation for more information.
  139. */
  140. mobileEmulation?: {
  141. [name: string]: any;
  142. };
  143. /**
  144. * An optional dictionary that specifies performance logging preferences. See
  145. * [Chromedriver docs](http://chromedriver.chromium.org/capabilities) for
  146. * more information.
  147. */
  148. perfLoggingPrefs?: {
  149. enableNetwork?: boolean;
  150. enablePage?: boolean;
  151. enableTimeline?: boolean;
  152. tracingCategories?: boolean;
  153. bufferUsageReportingInterval?: boolean;
  154. };
  155. /**
  156. * A dictionary with each entry consisting of the name of the preference and its value.
  157. * These preferences are only applied to the user profile in use. See the 'Preferences'
  158. * file in Chrome's user data directory for examples.
  159. */
  160. prefs?: {
  161. [name: string]: string | number | boolean;
  162. };
  163. /**
  164. * A list of window types that will appear in the list of window handles. For access
  165. * to <webview> elements, include "webview" in this list.
  166. */
  167. windowTypes?: string[];
  168. }
  169. /**
  170. * Chromium Edge
  171. */
  172. interface MicrosoftEdgeOptions extends ChromeOptions {}
  173. interface FirefoxLogObject {
  174. level: FirefoxLogLevels
  175. }
  176. export interface GeckodriverCapabilities {
  177. 'firefox_binary'?: string;
  178. firefoxProfileTemplate?: string;
  179. captureNetworkTraffic?: boolean;
  180. addCustomRequestHeaders?: boolean;
  181. trustAllSSLCertificates?: boolean;
  182. changeMaxConnections?: boolean;
  183. profile?: string;
  184. pageLoadingStrategy?: string;
  185. }
  186. interface FirefoxOptions {
  187. debuggerAddress?: string
  188. binary?: string,
  189. args?: string[],
  190. profile?: string,
  191. log?: FirefoxLogObject,
  192. prefs?: {
  193. [name: string]: string | number | boolean;
  194. }
  195. }
  196. export interface SelenoidOptions {
  197. enableVNC?: boolean,
  198. screenResolution?: string,
  199. enableVideo?: boolean,
  200. videoName?: string,
  201. videoScreenSize?: string,
  202. videoFrameRate?: number,
  203. videoCodec?: string,
  204. enableLog?: boolean,
  205. logName?: string,
  206. name?: string,
  207. sessionTimeout?: string,
  208. timeZone?: string,
  209. env?: string[],
  210. applicationContainers?: string[],
  211. hostsEntries?: string[],
  212. dnsServers?: string[],
  213. additionalNetworks?: string[],
  214. labels?: Map<string, string>,
  215. skin?: string,
  216. s3KeyPattern?: string
  217. }
  218. export interface Capabilities extends VendorExtensions {
  219. /**
  220. * Identifies the user agent.
  221. */
  222. browserName?: string;
  223. /**
  224. * Identifies the version of the user agent.
  225. */
  226. browserVersion?: string;
  227. /**
  228. * Identifies the operating system of the endpoint node.
  229. */
  230. platformName?: string;
  231. /**
  232. * Indicates whether untrusted and self-signed TLS certificates are implicitly trusted on navigation for the duration of the session.
  233. */
  234. acceptInsecureCerts?: boolean;
  235. /**
  236. * Defines the current session’s page load strategy.
  237. */
  238. pageLoadStrategy?: PageLoadingStrategy;
  239. /**
  240. * Defines the current session’s proxy configuration.
  241. */
  242. proxy?: ProxyObject;
  243. /**
  244. * Indicates whether the remote end supports all of the resizing and repositioning commands.
  245. */
  246. setWindowRect?: boolean;
  247. /**
  248. * Describes the timeouts imposed on certain session operations.
  249. */
  250. timeouts?: Timeouts;
  251. /**
  252. * Defines the current session’s strict file interactability.
  253. */
  254. strictFileInteractability?: boolean,
  255. /**
  256. * Describes the current session’s user prompt handler. Defaults to the dismiss and notify state.
  257. */
  258. unhandledPromptBehavior?: string;
  259. }
  260. export interface W3CCapabilities {
  261. alwaysMatch: Capabilities;
  262. firstMatch: Capabilities[];
  263. }
  264. export interface DesiredCapabilities extends Capabilities, SauceLabsCapabilities, SauceLabsVisualCapabilities, TestingbotCapabilities, SeleniumRCCapabilities, AppiumIOSCapabilities, GeckodriverCapabilities, IECapabilities, AppiumAndroidCapabilities, AppiumCapabilities, AppiumW3CCapabilities, VendorExtensions, GridCapabilities, ChromeCapabilities, BrowserStackCapabilities {
  265. // Read-only capabilities
  266. cssSelectorsEnabled?: boolean;
  267. handlesAlerts?: boolean;
  268. version?: string;
  269. platform?: string;
  270. public?: any;
  271. loggingPrefs?: {
  272. browser?: LoggingPreferences;
  273. driver?: LoggingPreferences;
  274. server?: LoggingPreferences;
  275. client?: LoggingPreferences;
  276. };
  277. // Read-write capabilities
  278. javascriptEnabled?: boolean;
  279. databaseEnabled?: boolean;
  280. locationContextEnabled?: boolean;
  281. applicationCacheEnabled?: boolean;
  282. browserConnectionEnabled?: boolean;
  283. webStorageEnabled?: boolean;
  284. acceptSslCerts?: boolean;
  285. rotatable?: boolean;
  286. nativeEvents?: boolean;
  287. unexpectedAlertBehaviour?: string;
  288. elementScrollBehavior?: number;
  289. // RemoteWebDriver specific
  290. 'webdriver.remote.sessionid'?: string;
  291. 'webdriver.remote.quietExceptions'?: boolean;
  292. // Selenese-Backed-WebDriver specific
  293. 'selenium.server.url'?: string;
  294. // Safari specific
  295. 'safari.options'?: {
  296. [name: string]: any;
  297. };
  298. // webdriverio specific
  299. specs?: string[];
  300. exclude?: string[];
  301. excludeDriverLogs?: string[];
  302. }
  303. export interface VendorExtensions extends EdgeCapabilities, AppiumW3CCapabilities {
  304. // Selenoid specific
  305. 'selenoid:options'?: SelenoidOptions
  306. // Testingbot w3c specific
  307. 'tb:options'?: TestingbotCapabilities
  308. // Sauce Labs w3c specific
  309. 'sauce:options'?: SauceLabsCapabilities
  310. // Sauce Labs Visual
  311. 'sauce:visual'?: SauceLabsVisualCapabilities
  312. // Browserstack w3c specific
  313. 'bstack:options'?: BrowserStackCapabilities
  314. 'browserstack.local'?: boolean
  315. 'goog:chromeOptions'?: ChromeOptions
  316. 'moz:firefoxOptions'?: FirefoxOptions
  317. firefox_profile?: string
  318. 'ms:edgeOptions'?: MicrosoftEdgeOptions
  319. 'ms:edgeChromium'?: MicrosoftEdgeOptions
  320. /**
  321. * @deprecated
  322. */
  323. testobject_api_key?: string
  324. }
  325. // Selenium Grid specific
  326. export interface GridCapabilities {
  327. // Grid-specific
  328. seleniumProtocol?: string;
  329. maxInstances?: number;
  330. environment?: string;
  331. }
  332. // Edge specific
  333. export interface EdgeCapabilities {
  334. 'ms:inPrivate'?: boolean;
  335. 'ms:extensionPaths'?: string[];
  336. 'ms:startPage'?: string;
  337. }
  338. // Chrome specific
  339. export interface ChromeCapabilities {
  340. chrome?: string;
  341. chromeOptions?: ChromeOptions;
  342. mobileEmulationEnabled?: boolean;
  343. }
  344. // Appium General Capabilities
  345. export interface AppiumCapabilities {
  346. automationName?: string;
  347. platformVersion?: string;
  348. deviceName?: string;
  349. device?: string;
  350. // custom mobile grids can have device information in a `desired` cap
  351. desired?: AppiumCapabilities;
  352. app?: string;
  353. newCommandTimeout?: number;
  354. language?: string;
  355. locale?: string;
  356. udid?: string;
  357. orientation?: string;
  358. autoWebview?: boolean;
  359. noReset?: boolean;
  360. fullReset?: boolean;
  361. eventTimings?: boolean;
  362. enablePerformanceLogging?: boolean;
  363. printPageSourceOnFindFailure?: boolean;
  364. }
  365. export interface AppiumW3CCapabilities {
  366. 'appium:automationName'?: string;
  367. 'appium:platformVersion'?: string;
  368. 'appium:deviceName'?: string;
  369. 'appium:app'?: string;
  370. 'appium:newCommandTimeout'?: number;
  371. 'appium:language'?: string;
  372. 'appium:locale'?: string;
  373. 'appium:udid'?: string;
  374. 'appium:orientation'?: string;
  375. 'appium:autoWebview'?: boolean;
  376. 'appium:noReset'?: boolean;
  377. 'appium:fullReset'?: boolean;
  378. 'appium:eventTimings'?: boolean;
  379. 'appium:enablePerformanceLogging'?: boolean;
  380. 'appium:printPageSourceOnFindFailure'?: boolean;
  381. }
  382. export interface AppiumAndroidCapabilities {
  383. // Appium Android Only
  384. appiumVersion?: string;
  385. appActivity?: string;
  386. appPackage?: string;
  387. appWaitActivity?: string;
  388. appWaitPackage?: string;
  389. appWaitDuration?: number;
  390. deviceReadyTimeout?: number;
  391. allowTestPackages?: boolean;
  392. androidCoverage?: string;
  393. androidCoverageEndIntent?: string;
  394. androidDeviceReadyTimeout?: number;
  395. androidInstallTimeout?: number;
  396. androidInstallPath?: string;
  397. adbPort?: number;
  398. systemPort?: number;
  399. remoteAdbHost?: string;
  400. androidDeviceSocket?: string;
  401. avd?: string;
  402. avdLaunchTimeout?: number;
  403. avdReadyTimeout?: number;
  404. avdArgs?: string;
  405. useKeystore?: boolean;
  406. keystorePath?: string;
  407. keystorePassword?: string;
  408. keyAlias?: string;
  409. keyPassword?: string;
  410. chromedriverExecutable?: string;
  411. chromedriverArgs?: string[];
  412. chromedriverExecutableDir?: string;
  413. chromedriverChromeMappingFile?: string;
  414. chromedriverUseSystemExecutable?: boolean;
  415. autoWebviewTimeout?: number;
  416. chromedriverPort?: number;
  417. chromedriverPorts?: (number | number[])[]
  418. intentAction?: string;
  419. intentCategory?: string;
  420. intentFlags?: string;
  421. optionalIntentArguments?: string;
  422. dontStopAppOnReset?: boolean;
  423. unicodeKeyboard?: boolean;
  424. resetKeyboard?: boolean;
  425. noSign?: boolean;
  426. ignoreUnimportantViews?: boolean;
  427. disableAndroidWatchers?: boolean;
  428. recreateChromeDriverSessions?: boolean;
  429. nativeWebScreenshot?: boolean;
  430. androidScreenshotPath?: string;
  431. autoGrantPermissions?: boolean;
  432. networkSpeed?: string;
  433. gpsEnabled?: boolean;
  434. isHeadless?: boolean;
  435. adbExecTimeout?: number;
  436. localeScript?: string;
  437. skipDeviceInitialization?: boolean;
  438. chromedriverDisableBuildCheck?: boolean;
  439. skipUnlock?: boolean;
  440. unlockType?: string;
  441. unlockKey?: string;
  442. autoLaunch?: boolean;
  443. skipLogcatCapture?: boolean;
  444. uninstallOtherPackages?: string;
  445. disableWindowAnimation?: boolean;
  446. otherApps?: string;
  447. uiautomator2ServerLaunchTimeout?: number;
  448. uiautomator2ServerInstallTimeout?: number;
  449. skipServerInstallation?: boolean;
  450. espressoServerLaunchTimeout?: number;
  451. }
  452. // Appium iOS Only
  453. export interface AppiumIOSCapabilities {
  454. calendarFormat?: string;
  455. bundleId?: string;
  456. launchTimeout?: number;
  457. locationServicesEnabled?: boolean;
  458. locationServicesAuthorized?: boolean;
  459. autoAcceptAlerts?: boolean;
  460. autoDismissAlerts?: boolean;
  461. nativeInstrumentsLib?: boolean;
  462. nativeWebTap?: boolean;
  463. safariInitialUrl?: string;
  464. safariAllowPopups?: boolean;
  465. safariIgnoreFraudWarning?: boolean;
  466. safariOpenLinksInBackground?: boolean;
  467. keepKeyChains?: boolean;
  468. localizableStringsDir?: string;
  469. processArguments?: string;
  470. interKeyDelay?: number;
  471. showIOSLog?: boolean;
  472. sendKeyStrategy?: string;
  473. screenshotWaitTimeout?: number;
  474. waitForAppScript?: string;
  475. webviewConnectRetries?: number;
  476. appName?: string;
  477. customSSLCert?: string;
  478. webkitResponseTimeout?: number;
  479. remoteDebugProxy?: string;
  480. enableAsyncExecuteFromHttps?: boolean;
  481. skipLogCapture?: boolean;
  482. webkitDebugProxyPort?: number;
  483. }
  484. // IE specific
  485. export interface IECapabilities {
  486. 'ie.forceCreateProcessApi'?: boolean;
  487. 'ie.browserCommandLineSwitches'?: string;
  488. 'ie.usePerProcessProxy'?: boolean;
  489. 'ie.ensureCleanSession'?: boolean;
  490. 'ie.setProxyByServer'?: boolean;
  491. 'ie.fileUploadDialogTimeout'?: number;
  492. 'ie.edgechromium'?: boolean;
  493. 'ie.edgepath'?: string;
  494. ignoreProtectedModeSettings?: boolean;
  495. ignoreZoomSetting?: boolean;
  496. initialBrowserUrl?: string;
  497. enablePersistentHover?: boolean;
  498. enableElementCacheCleanup?: boolean;
  499. requireWindowFocus?: boolean;
  500. browserAttachTimeout?: number;
  501. logFile?: string;
  502. logLevel?: string;
  503. host?: string;
  504. extractPath?: string;
  505. silent?: string;
  506. killProcessesByName?: boolean;
  507. }
  508. /**
  509. * see also https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options
  510. */
  511. export interface SauceLabsCapabilities {
  512. // Sauce Labs Custom Testing Options
  513. name?: string
  514. build?: string | number
  515. tags?: string[]
  516. 'custom-data'?: any
  517. tunnelIdentifier?: string
  518. parentTunnel?: string
  519. screenResolution?: string
  520. timeZone?: string
  521. avoidProxy?: boolean
  522. public?: string
  523. prerun?: {
  524. executable: string
  525. args: string[]
  526. background: boolean
  527. timeout: number
  528. }
  529. // Optional Sauce Labs Testing Features
  530. recordVideo?: boolean
  531. videoUploadOnPass?: boolean
  532. recordScreenshots?: boolean
  533. recordLogs?: boolean
  534. priority?: number
  535. extendedDebugging?: boolean
  536. capturePerformance?: boolean
  537. // Optional Selenium Capabilities for Sauce Labs Tests
  538. seleniumVersion?: string
  539. chromedriverVersion?: string
  540. iedriverVersion?: string
  541. // timeouts
  542. maxDuration?: number
  543. commandTimeout?: number
  544. idleTimeout?: number
  545. }
  546. export interface BrowserStackCapabilities {
  547. browser?: string
  548. browser_version?: string
  549. os?: string
  550. os_version?: string
  551. osVersion?: string
  552. projectName?: string
  553. buildName?: string
  554. sessionName?: string
  555. local?: boolean
  556. debug?: boolean
  557. networkLogs?: boolean
  558. seleniumVersion?: string
  559. ie?: {
  560. noFlash?: boolean,
  561. compatibility?: number
  562. arch?:string
  563. driver?: string
  564. enablePopups?: boolean
  565. }
  566. userName?: string
  567. accessKey?: string
  568. }
  569. export interface SauceLabsVisualCapabilities {
  570. /**
  571. * Project name
  572. */
  573. projectName?: string
  574. /**
  575. * API Key for user's Screener account.
  576. */
  577. apiKey?: string
  578. /**
  579. * A <width>x<height> representation of desired viewport size.
  580. * @default "1024x768"
  581. */
  582. viewportSize?: string
  583. /**
  584. * Branch or environment name.
  585. * @example "main"
  586. */
  587. branch?: string
  588. /**
  589. * Branch name of project's base branch. Used for baseline branching and merging.
  590. * @example "main"
  591. */
  592. baseBranch?: string
  593. /**
  594. * Visual diff options to control validations.
  595. * @default
  596. * ```js
  597. * {
  598. * structure: true,
  599. * layout: true,
  600. * style: true,
  601. * content: true,
  602. * minLayoutPosition: 4,
  603. * minLayoutDimension: 10
  604. * }
  605. * ```
  606. */
  607. diffOptions?: {
  608. structure?: boolean
  609. layout?: boolean
  610. style?: boolean
  611. content?: boolean
  612. minLayoutPosition?: number
  613. minLayoutDimension?: number
  614. }
  615. /**
  616. * A comma-delimited list of css selectors to ignore when performing visual diffs.
  617. * @example "#some-id, .some-selector"
  618. */
  619. ignore?: string
  620. /**
  621. * Option to set build to failure when new states are found, and to disable
  622. * using new states as a baseline.
  623. *
  624. * This option defaults to true, and can be set to false if user wants new
  625. * states to automatically be the visual baseline without needing to review
  626. * and accept them.
  627. * @default true
  628. */
  629. failOnNewStates?: boolean
  630. /**
  631. * Option to automatically accept new and changed states in base branch.
  632. * Assumes base branch should always be correct.
  633. * @default false
  634. */
  635. alwaysAcceptBaseBranch?: boolean
  636. /**
  637. * Option to disable independent baseline for each feature branch, and
  638. * only use base branch as baseline. Must be used with "baseBranch" option.
  639. * @default false
  640. */
  641. disableBranchBaseline?: boolean
  642. /**
  643. * Option to capture a full-page screenshot using a scrolling and stitching
  644. * strategy instead of using native browser full-page screenshot capabilities.
  645. * @default false
  646. */
  647. scrollAndStitchScreenshots?: boolean
  648. /**
  649. * Option to disable adding CORS headers. By default, CORS headers are set
  650. * for all cross-origin requests.
  651. * @default false
  652. */
  653. disableCORS?: boolean
  654. }
  655. export interface TestingbotCapabilities {
  656. name?: string;
  657. tags?: string[];
  658. build?: string | number;
  659. public?: boolean;
  660. 'tunnel-identifier'?: string
  661. }
  662. export interface SeleniumRCCapabilities {
  663. // Selenium RC (1.0) only
  664. commandLineFlags?: string;
  665. executablePath?: string;
  666. timeoutInSeconds?: number;
  667. onlyProxySeleniumTraffic?: boolean;
  668. avoidProxy?: boolean;
  669. proxyEverything?: boolean;
  670. proxyRequired?: boolean;
  671. browserSideLog?: boolean;
  672. optionsSet?: boolean;
  673. singleWindow?: boolean;
  674. dontInjectRegex?: RegExp;
  675. userJSInjection?: boolean;
  676. userExtensions?: string;
  677. }
  678. interface Options {
  679. /**
  680. * Your cloud service username (only works for [Sauce Labs](https://saucelabs.com),
  681. * [Browserstack](https://www.browserstack.com), [TestingBot](https://testingbot.com),
  682. * [CrossBrowserTesting](https://crossbrowsertesting.com) or
  683. * [LambdaTest](https://www.lambdatest.com) accounts). If set, WebdriverIO will
  684. * automatically set connection options for you. If you don't use a cloud provider this
  685. * can be used to authenticate any other WebDriver backend.
  686. */
  687. user?: string
  688. /**
  689. * Your cloud service access key or secret key (only works for
  690. * [Sauce Labs](https://saucelabs.com), [Browserstack](https://www.browserstack.com),
  691. * [TestingBot](https://testingbot.com), [CrossBrowserTesting](https://crossbrowsertesting.com)
  692. * or [LambdaTest](https://www.lambdatest.com) accounts). If set, WebdriverIO will
  693. * automatically set connection options for you. If you don't use a cloud provider this
  694. * can be used to authenticate any other WebDriver backend.
  695. */
  696. key?: string
  697. /**
  698. * Protocol to use when communicating with the Selenium standalone server (or driver).
  699. *
  700. * @default 'http'
  701. */
  702. protocol?: string;
  703. /**
  704. * Host of your WebDriver server.
  705. *
  706. * @default 'localhost'
  707. */
  708. hostname?: string;
  709. /**
  710. * Port your WebDriver server is on.
  711. *
  712. * @default 4444
  713. */
  714. port?: number;
  715. /**
  716. * Path to WebDriver endpoint or grid server.
  717. *
  718. * @default '/'
  719. */
  720. path?: string;
  721. /**
  722. * Query paramaters that are propagated to the driver server.
  723. */
  724. queryParams?: {
  725. [name: string]: string;
  726. },
  727. /**
  728. * Defines the [capabilities](https://w3c.github.io/webdriver/webdriver-spec.html#capabilities) you want to run in your Selenium session.
  729. */
  730. capabilities?: DesiredCapabilities | W3CCapabilities;
  731. requestedCapabilities?: DesiredCapabilities | W3CCapabilities;
  732. /**
  733. * Level of logging verbosity.
  734. *
  735. * @default 'info'
  736. */
  737. logLevel?: WebDriverLogTypes;
  738. /**
  739. * Set specific log levels per logger
  740. * use 'silent' level to disable logger
  741. */
  742. logLevels?: Record<string, WebDriverLogTypes>;
  743. /**
  744. * Timeout for any WebDriver request to a driver or grid.
  745. *
  746. * @default 120000
  747. */
  748. connectionRetryTimeout?: number;
  749. /**
  750. * Count of request retries to the Selenium server.
  751. *
  752. * @default 3
  753. */
  754. connectionRetryCount?: number;
  755. /**
  756. * Specify custom headers to pass into every request.
  757. */
  758. headers?: {
  759. [name: string]: string;
  760. };
  761. /**
  762. * Allows you to use a custom http/https/http2 [agent](https://www.npmjs.com/package/got#agent) to make requests.
  763. *
  764. * @default
  765. * ```js
  766. * {
  767. * http: new http.Agent({ keepAlive: true }),
  768. * https: new https.Agent({ keepAlive: true })
  769. * }
  770. * ```
  771. */
  772. agent?: {
  773. http: HTTPAgent,
  774. https: HTTPSAgent
  775. };
  776. /**
  777. * Function intercepting [HTTP request options](https://github.com/sindresorhus/got#options) before a WebDriver request is made.
  778. */
  779. transformRequest?: (requestOptions: HTTPRequestOptions) => HTTPRequestOptions;
  780. /**
  781. * Function intercepting HTTP response objects after a WebDriver response has arrived.
  782. */
  783. transformResponse?: (response: HTTPResponse, requestOptions: HTTPRequestOptions) => HTTPResponse;
  784. /**
  785. * Appium direct connect options (see: https://appiumpro.com/editions/86-connecting-directly-to-appium-hosts-in-distributed-environments)
  786. */
  787. directConnectProtocol?: string
  788. directConnectHost?: string
  789. directConnectPort?: number
  790. directConnectPath?: string
  791. /**
  792. * Whether it requires SSL certificates to be valid in HTTP/s requests
  793. * for an environment which cannot get process environment well.
  794. *
  795. * @default true
  796. */
  797. strictSSL?: boolean;
  798. /**
  799. * Directory to store all testrunner log files (including reporter logs and `wdio` logs).
  800. * If not set, all logs are streamed to `stdout`. Since most reporters are made to log to
  801. * `stdout`, it is recommended to only use this option for specific reporters where it
  802. * makes more sense to push report into a file (like the `junit` reporter, for example).
  803. *
  804. * When running in standalone mode, the only log generated by WebdriverIO will be
  805. * the `wdio` log.
  806. */
  807. outputDir?: string
  808. }
  809. interface AttachSessionOptions extends Options {
  810. sessionId: string,
  811. isW3C?: boolean
  812. }
  813. function newSession(
  814. options?: Options,
  815. modifier?: (...args: any[]) => any,
  816. proto?: object,
  817. commandWrapper?: (commandName: string, fn: (...args: any[]) => any) => any
  818. ): Promise<Client>;
  819. function attachToSession(
  820. options: AttachSessionOptions,
  821. modifier?: (...args: any[]) => any,
  822. proto?: object,
  823. commandWrapper?: (commandName: string, fn: (...args: any[]) => any) => any
  824. ): Promise<Client>;
  825. function reloadSession(
  826. instance: Client
  827. ): Promise<Client>;
  828. interface ClientOptions {
  829. capabilities: DesiredCapabilities;
  830. isW3C: boolean;
  831. isChrome: boolean;
  832. isAndroid: boolean;
  833. isMobile: boolean;
  834. isIOS: boolean;
  835. isSauce: boolean;
  836. isDevTools: boolean;
  837. sessionId: string;
  838. }
  839. // object with no match
  840. interface ProtocolCommandResponse {
  841. [key: string]: any;
  842. }
  843. // webdriver.json
  844. interface SessionReturn extends DesiredCapabilities, ProtocolCommandResponse { }
  845. interface StatusReturn extends ProtocolCommandResponse {
  846. ready?: boolean,
  847. message?: string,
  848. }
  849. interface WindowHandle {
  850. handle: string,
  851. type: string
  852. }
  853. interface RectReturn {
  854. x: number,
  855. y: number,
  856. width: number,
  857. height: number
  858. }
  859. // appium.json
  860. interface StringsReturn {
  861. [key: string]: string
  862. }
  863. interface SettingsReturn extends ProtocolCommandResponse {
  864. shouldUseCompactResponses?: boolean,
  865. elementResponseAttributes?: string,
  866. ignoreUnimportantViews?: boolean,
  867. allowInvisibleElements?: boolean,
  868. enableNotificationListener?: boolean,
  869. actionAcknowledgmentTimeout?: number,
  870. keyInjectionDelay?: number,
  871. scrollAcknowledgmentTimeout?: number,
  872. waitForIdleTimeout?: number,
  873. waitForSelectorTimeout?: number,
  874. normalizeTagNames?: boolean,
  875. shutdownOnPowerDisconnect?: boolean,
  876. mjpegServerScreenshotQuality?: number,
  877. mjpegServerFramerate?: number,
  878. screenshotQuality?: number,
  879. mjpegScalingFactor?: number,
  880. }
  881. interface BaseClient extends NodeJS.EventEmitter {
  882. // id of WebDriver session
  883. sessionId: string;
  884. // assigned capabilities by the browser driver / WebDriver server
  885. capabilities: DesiredCapabilities;
  886. // original requested capabilities
  887. requestedCapabilities: DesiredCapabilities;
  888. /**
  889. * browser flags
  890. */
  891. // true if session runs on a mobile device
  892. isMobile: boolean;
  893. // true if mobile session runs on iOS
  894. isIOS: boolean;
  895. // true if mobile session runs on Android
  896. isAndroid: boolean;
  897. }
  898. // generated typings
  899. // webdriver types
  900. interface Client extends BaseClient {
  901. /**
  902. * [webdriver]
  903. * The New Session command creates a new WebDriver session with the endpoint node. If the creation fails, a session not created error is returned.
  904. * https://w3c.github.io/webdriver/#dfn-new-sessions
  905. */
  906. newSession(capabilities: object): SessionReturn;
  907. /**
  908. * [webdriver]
  909. * The Delete Session command closes any top-level browsing contexts associated with the current session, terminates the connection, and finally closes the current session.
  910. * https://w3c.github.io/webdriver/#dfn-delete-session
  911. */
  912. deleteSession(): void;
  913. /**
  914. * [webdriver]
  915. * The Status command returns information about whether a remote end is in a state in which it can create new sessions and can additionally include arbitrary meta information that is specific to the implementation.
  916. * https://w3c.github.io/webdriver/#dfn-status
  917. */
  918. status(): StatusReturn;
  919. /**
  920. * [webdriver]
  921. * The Get Timeouts command gets timeout durations associated with the current session.
  922. * https://w3c.github.io/webdriver/#dfn-get-timeouts
  923. */
  924. getTimeouts(): Timeouts;
  925. /**
  926. * [webdriver]
  927. * The Set Timeouts command sets timeout durations associated with the current session. The timeouts that can be controlled are listed in the table of session timeouts below.
  928. * https://w3c.github.io/webdriver/#dfn-set-timeouts
  929. */
  930. setTimeouts(implicit?: number, pageLoad?: number, script?: number): void;
  931. /**
  932. * [webdriver]
  933. * The Get Current URL command returns the URL of the current top-level browsing context.
  934. * https://w3c.github.io/webdriver/#dfn-get-current-url
  935. */
  936. getUrl(): string;
  937. /**
  938. * [webdriver]
  939. * The navigateTo (go) command is used to cause the user agent to navigate the current top-level browsing context a new location.
  940. * https://w3c.github.io/webdriver/#dfn-navigate-to
  941. */
  942. navigateTo(url: string): string;
  943. /**
  944. * [webdriver]
  945. * The Back command causes the browser to traverse one step backward in the joint session history of the current top-level browsing context. This is equivalent to pressing the back button in the browser chrome or calling `window.history.back`.
  946. * https://w3c.github.io/webdriver/#dfn-back
  947. */
  948. back(): void;
  949. /**
  950. * [webdriver]
  951. * The Forward command causes the browser to traverse one step forwards in the joint session history of the current top-level browsing context.
  952. * https://w3c.github.io/webdriver/#dfn-forward
  953. */
  954. forward(): void;
  955. /**
  956. * [webdriver]
  957. * The Refresh command causes the browser to reload the page in current top-level browsing context.
  958. * https://w3c.github.io/webdriver/#dfn-refresh
  959. */
  960. refresh(): void;
  961. /**
  962. * [webdriver]
  963. * The Get Title command returns the document title of the current top-level browsing context, equivalent to calling `document.title`.
  964. * https://w3c.github.io/webdriver/#dfn-get-title
  965. */
  966. getTitle(): string;
  967. /**
  968. * [webdriver]
  969. * The Get Window Handle command returns the window handle for the current top-level browsing context. It can be used as an argument to Switch To Window.
  970. * https://w3c.github.io/webdriver/#dfn-get-window-handle
  971. */
  972. getWindowHandle(): string;
  973. /**
  974. * [webdriver]
  975. * The Close Window command closes the current top-level browsing context. Once done, if there are no more top-level browsing contexts open, the WebDriver session itself is closed.
  976. * https://w3c.github.io/webdriver/#dfn-close-window
  977. */
  978. closeWindow(): void;
  979. /**
  980. * [webdriver]
  981. * The Switch To Window command is used to select the current top-level browsing context for the current session, i.e. the one that will be used for processing commands.
  982. * https://w3c.github.io/webdriver/#dfn-switch-to-window
  983. */
  984. switchToWindow(handle: string): void;
  985. /**
  986. * [webdriver]
  987. * Create a new top-level browsing context.
  988. * https://w3c.github.io/webdriver/#new-window
  989. */
  990. createWindow(type: 'tab' | 'window'): WindowHandle;
  991. /**
  992. * [webdriver]
  993. * The Get Window Handles command returns a list of window handles for every open top-level browsing context. The order in which the window handles are returned is arbitrary.
  994. * https://w3c.github.io/webdriver/#dfn-get-window-handles
  995. */
  996. getWindowHandles(): string[];
  997. /**
  998. * [webdriver]
  999. * The Switch To Frame command is used to select the current top-level browsing context or a child browsing context of the current browsing context to use as the current browsing context for subsequent commands.
  1000. * https://w3c.github.io/webdriver/#dfn-switch-to-frame
  1001. */
  1002. switchToFrame(id: (number|object|null)): void;
  1003. /**
  1004. * [webdriver]
  1005. * The Switch to Parent Frame command sets the current browsing context for future commands to the parent of the current browsing context.
  1006. * https://w3c.github.io/webdriver/#dfn-switch-to-parent-frame
  1007. */
  1008. switchToParentFrame(): void;
  1009. /**
  1010. * [webdriver]
  1011. * The Get Window Rect command returns the size and position on the screen of the operating system window corresponding to the current top-level browsing context.
  1012. * https://w3c.github.io/webdriver/#dfn-get-window-rect
  1013. */
  1014. getWindowRect(): RectReturn;
  1015. /**
  1016. * [webdriver]
  1017. * The Set Window Rect command alters the size and the position of the operating system window corresponding to the current top-level browsing context.
  1018. * https://w3c.github.io/webdriver/#dfn-set-window-rect
  1019. */
  1020. setWindowRect(x: (number|null), y: (number|null), width: (number|null), height: (number|null)): RectReturn;
  1021. /**
  1022. * [webdriver]
  1023. * The Maximize Window command invokes the window manager-specific "maximize" operation, if any, on the window containing the current top-level browsing context. This typically increases the window to the maximum available size without going full-screen.
  1024. * https://w3c.github.io/webdriver/#dfn-maximize-window
  1025. */
  1026. maximizeWindow(): RectReturn;
  1027. /**
  1028. * [webdriver]
  1029. * The Minimize Window command invokes the window manager-specific "minimize" operation, if any, on the window containing the current top-level browsing context. This typically hides the window in the system tray.
  1030. * https://w3c.github.io/webdriver/#dfn-minimize-window
  1031. */
  1032. minimizeWindow(): RectReturn;
  1033. /**
  1034. * [webdriver]
  1035. * The Fullscreen Window command invokes the window manager-specific “full screen” operation, if any, on the window containing the current top-level browsing context. This typically increases the window to the size of the physical display and can hide browser chrome elements such as toolbars.
  1036. * https://w3c.github.io/webdriver/#dfn-fullscreen-window
  1037. */
  1038. fullscreenWindow(): RectReturn;
  1039. /**
  1040. * [webdriver]
  1041. * The Find Element command is used to find an element in the current browsing context that can be used for future commands.
  1042. * https://w3c.github.io/webdriver/#dfn-find-element
  1043. */
  1044. findElement(using: string, value: string): string;
  1045. /**
  1046. * [webdriver]
  1047. * The Find Elements command is used to find elements in the current browsing context that can be used for future commands.
  1048. * https://w3c.github.io/webdriver/#dfn-find-elements
  1049. */
  1050. findElements(using: string, value: string): string[];
  1051. /**
  1052. * [webdriver]
  1053. * The Find Element From Element command is used to find an element from a web element in the current browsing context that can be used for future commands.
  1054. * https://w3c.github.io/webdriver/#dfn-find-element-from-element
  1055. */
  1056. findElementFromElement(elementId: string, using: string, value: string): ElementReference;
  1057. /**
  1058. * [webdriver]
  1059. * The Find Elements From Element command is used to find elements from a web element in the current browsing context that can be used for future commands.
  1060. * https://w3c.github.io/webdriver/#dfn-find-elements-from-element
  1061. */
  1062. findElementsFromElement(elementId: string, using: string, value: string): ElementReference[];
  1063. /**
  1064. * [webdriver]
  1065. * Get Active Element returns the active element of the current browsing context’s document element.
  1066. * https://w3c.github.io/webdriver/#dfn-get-active-element
  1067. */
  1068. getActiveElement(): string;
  1069. /**
  1070. * [webdriver]
  1071. * Is Element Selected determines if the referenced element is selected or not. This operation only makes sense on input elements of the Checkbox- and Radio Button states, or option elements.
  1072. * https://w3c.github.io/webdriver/#dfn-is-element-selected
  1073. */
  1074. isElementSelected(elementId: string): boolean;
  1075. /**
  1076. * [webdriver]
  1077. * Is Element Displayed determines the visibility of an element which is guided by what is perceptually visible to the human eye. In this context, an element's displayedness does not relate to the `visibility` or `display` style properties.
  1078. * https://w3c.github.io/webdriver/#element-displayedness
  1079. */
  1080. isElementDisplayed(elementId: string): boolean;
  1081. /**
  1082. * [webdriver]
  1083. * The Get Element Attribute command will return the attribute of a web element.
  1084. * https://w3c.github.io/webdriver/#dfn-get-element-attribute
  1085. */
  1086. getElementAttribute(elementId: string, name: string): string;
  1087. /**
  1088. * [webdriver]
  1089. * The Get Element Property command will return the result of getting a property of an element.
  1090. * https://w3c.github.io/webdriver/#dfn-get-element-property
  1091. */
  1092. getElementProperty(elementId: string, name: string): string;
  1093. /**
  1094. * [webdriver]
  1095. * The Get Element CSS Value command retrieves the computed value of the given CSS property of the given web element.
  1096. * https://w3c.github.io/webdriver/#dfn-get-element-css-value
  1097. */
  1098. getElementCSSValue(elementId: string, propertyName: string): string;
  1099. /**
  1100. * [webdriver]
  1101. * The Get Element Text command intends to return an element’s text "as rendered". An element's rendered text is also used for locating a elements by their link text and partial link text.
  1102. * https://w3c.github.io/webdriver/#dfn-get-element-text
  1103. */
  1104. getElementText(elementId: string): string;
  1105. /**
  1106. * [webdriver]
  1107. * The Get Element Tag Name command returns the qualified element name of the given web element.
  1108. * https://w3c.github.io/webdriver/#dfn-get-element-tag-name
  1109. */
  1110. getElementTagName(elementId: string): string;
  1111. /**
  1112. * [webdriver]
  1113. * The Get Element Rect command returns the dimensions and coordinates of the given web element.
  1114. * https://w3c.github.io/webdriver/#dfn-get-element-rect
  1115. */
  1116. getElementRect(elementId: string): RectReturn;
  1117. /**
  1118. * [webdriver]
  1119. * Is Element Enabled determines if the referenced element is enabled or not. This operation only makes sense on form controls.
  1120. * https://w3c.github.io/webdriver/#dfn-is-element-enabled
  1121. */
  1122. isElementEnabled(elementId: string): boolean;
  1123. /**
  1124. * [webdriver]
  1125. * The Element Click command scrolls into view the element if it is not already pointer-interactable, and clicks its in-view center point. If the element's center point is obscured by another element, an element click intercepted error is returned. If the element is outside the viewport, an element not interactable error is returned.
  1126. * https://w3c.github.io/webdriver/#dfn-element-click
  1127. */
  1128. elementClick(elementId: string): void;
  1129. /**
  1130. * [webdriver]
  1131. * The Element Clear command scrolls into view an editable or resettable element and then attempts to clear its selected files or text content.
  1132. * https://w3c.github.io/webdriver/#dfn-element-clear
  1133. */
  1134. elementClear(elementId: string): void;
  1135. /**
  1136. * [webdriver]
  1137. * The Element Send Keys command scrolls into view the form control element and then sends the provided keys to the element. In case the element is not keyboard-interactable, an element not interactable error is returned.<br><br>The key input state used for input may be cleared mid-way through "typing" by sending the null key, which is U+E000 (NULL).
  1138. * https://w3c.github.io/webdriver/#dfn-element-send-keys
  1139. */
  1140. elementSendKeys(elementId: string, text: string): void;
  1141. /**
  1142. * [webdriver]
  1143. * The Get Page Source command returns a string serialization of the DOM of the current browsing context active document.
  1144. * https://w3c.github.io/webdriver/#dfn-get-page-source
  1145. */
  1146. getPageSource(): string;
  1147. /**
  1148. * [webdriver]
  1149. * The Execute Script command executes a JavaScript function in the context of the current browsing context and returns the return value of the function.
  1150. * https://w3c.github.io/webdriver/#dfn-execute-script
  1151. */
  1152. executeScript(script: string, args?: (string|object|number|boolean|undefined)[]): any;
  1153. /**
  1154. * [webdriver]
  1155. * The Execute Async Script command causes JavaScript to execute as an anonymous function. Unlike the Execute Script command, the result of the function is ignored. Instead an additional argument is provided as the final argument to the function. This is a function that, when called, returns its first argument as the response.
  1156. * https://w3c.github.io/webdriver/#dfn-execute-async-script
  1157. */
  1158. executeAsyncScript(script: string, args: (string|object|number|boolean|undefined)[]): any;
  1159. /**
  1160. * [webdriver]
  1161. * The Get All Cookies command returns all cookies associated with the address of the current browsing context’s active document.
  1162. * https://w3c.github.io/webdriver/#dfn-get-all-cookies
  1163. */
  1164. getAllCookies(): object[];
  1165. /**
  1166. * [webdriver]
  1167. * The Add Cookie command adds a single cookie to the cookie store associated with the active document's address.
  1168. * https://w3c.github.io/webdriver/#dfn-adding-a-cookie
  1169. */
  1170. addCookie(cookie: object): void;
  1171. /**
  1172. * [webdriver]
  1173. * The Delete All Cookies command allows deletion of all cookies associated with the active document's address.
  1174. * https://w3c.github.io/webdriver/#dfn-delete-all-cookies
  1175. */
  1176. deleteAllCookies(): void;
  1177. /**
  1178. * [webdriver]
  1179. * The Get Named Cookie command returns the cookie with the requested name from the associated cookies in the cookie store of the current browsing context's active document. If no cookie is found, a no such cookie error is returned.
  1180. * https://w3c.github.io/webdriver/#dfn-get-named-cookie
  1181. */
  1182. getNamedCookie(name: string): WebDriver.Cookie;
  1183. /**
  1184. * [webdriver]
  1185. * The Delete Cookie command allows you to delete either a single cookie by parameter name, or all the cookies associated with the active document's address if name is undefined.
  1186. * https://w3c.github.io/webdriver/#dfn-delete-cookie
  1187. */
  1188. deleteCookie(name: string): void;
  1189. /**
  1190. * [webdriver]
  1191. * The Perform Actions command is used to execute complex user actions. See [spec](https://github.com/jlipps/simple-wd-spec#perform-actions) for more details.
  1192. * https://w3c.github.io/webdriver/#dfn-perform-actions
  1193. */
  1194. performActions(actions: object[]): void;
  1195. /**
  1196. * [webdriver]
  1197. * The Release Actions command is used to release all the keys and pointer buttons that are currently depressed. This causes events to be fired as if the state was released by an explicit series of actions. It also clears all the internal state of the virtual devices.
  1198. * https://w3c.github.io/webdriver/#dfn-release-actions
  1199. */
  1200. releaseActions(): void;
  1201. /**
  1202. * [webdriver]
  1203. * The Dismiss Alert command dismisses a simple dialog if present, otherwise error. A request to dismiss an alert user prompt, which may not necessarily have a dismiss button, has the same effect as accepting it.
  1204. * https://w3c.github.io/webdriver/#dfn-dismiss-alert
  1205. */
  1206. dismissAlert(): void;
  1207. /**
  1208. * [webdriver]
  1209. * The Accept Alert command accepts a simple dialog if present, otherwise error.
  1210. * https://w3c.github.io/webdriver/#dfn-accept-alert
  1211. */
  1212. acceptAlert(): void;
  1213. /**
  1214. * [webdriver]
  1215. * The Get Alert Text command returns the message of the current user prompt. If there is no current user prompt, it returns an error.
  1216. * https://w3c.github.io/webdriver/#dfn-get-alert-text
  1217. */
  1218. getAlertText(): string;
  1219. /**
  1220. * [webdriver]
  1221. * The Send Alert Text command sets the text field of a window.prompt user prompt to the given value.
  1222. * https://w3c.github.io/webdriver/#dfn-send-alert-text
  1223. */
  1224. sendAlertText(text: string): void;
  1225. /**
  1226. * [webdriver]
  1227. * The Take Screenshot command takes a screenshot of the top-level browsing context's viewport.
  1228. * https://w3c.github.io/webdriver/#dfn-take-screenshot
  1229. */
  1230. takeScreenshot(): string;
  1231. /**
  1232. * [webdriver]
  1233. * The Take Element Screenshot command takes a screenshot of the visible region encompassed by the bounding rectangle of an element.
  1234. * https://w3c.github.io/webdriver/#dfn-take-element-screenshot
  1235. */
  1236. takeElementScreenshot(elementId: string, scroll?: boolean): string;
  1237. /**
  1238. * [webdriver]
  1239. * The print functions are a mechanism to render the document to a paginated format.
  1240. * It is returned to the local end as a Base64 encoded string containing a PDF representation of the paginated document.
  1241. * https://w3c.github.io/webdriver/#print
  1242. */
  1243. printPage(orientation?: string, scale?: number, background?: boolean, width?: number, height?: number, top?: number, bottom?: number, left?: number, right?: number, shrinkToFit?: boolean, pageRanges?: object[]): string;
  1244. /**
  1245. * [webdriver]
  1246. * Get the computed WAI-ARIA role of an element.
  1247. * https://w3c.github.io/webdriver/#get-computed-role
  1248. */
  1249. getElementComputedRole(elementId: string): string;
  1250. /**
  1251. * [webdriver]
  1252. * Get the accessible name of the element.
  1253. * https://w3c.github.io/webdriver/#get-computed-label
  1254. */
  1255. getElementComputedLabel(elementId: string): string;
  1256. }
  1257. // appium types
  1258. interface Client extends BaseClient {
  1259. /**
  1260. * [appium]
  1261. * Perform a shake action on the device.
  1262. * http://appium.io/docs/en/commands/device/interactions/shake/
  1263. */
  1264. shake(): void;
  1265. /**
  1266. * [appium]
  1267. * Lock the device.
  1268. * http://appium.io/docs/en/commands/device/interactions/lock/
  1269. */
  1270. lock(seconds?: number): void;
  1271. /**
  1272. * [appium]
  1273. * Unlock the device.
  1274. * http://appium.io/docs/en/commands/device/interactions/unlock/
  1275. */
  1276. unlock(): void;
  1277. /**
  1278. * [appium]
  1279. * Check whether the device is locked or not.
  1280. * http://appium.io/docs/en/commands/device/interactions/is-locked/
  1281. */
  1282. isLocked(): boolean;
  1283. /**
  1284. * [appium]
  1285. * Start recording the screen.
  1286. * http://appium.io/docs/en/commands/device/recording-screen/start-recording-screen/
  1287. */
  1288. startRecordingScreen(options?: object): void;
  1289. /**
  1290. * [appium]
  1291. * Stop recording screen
  1292. * http://appium.io/docs/en/commands/device/recording-screen/stop-recording-screen/
  1293. */
  1294. stopRecordingScreen(remotePath?: string, username?: string, password?: string, method?: string): string;
  1295. /**
  1296. * [appium]
  1297. * Returns the information types of the system state which is supported to read as like cpu, memory, network traffic, and battery.
  1298. * http://appium.io/docs/en/commands/device/performance-data/performance-data-types/
  1299. */
  1300. getPerformanceDataTypes(): string[];
  1301. /**
  1302. * [appium]
  1303. * Returns the information of the system state which is supported to read as like cpu, memory, network traffic, and battery.
  1304. * http://appium.io/docs/en/commands/device/performance-data/get-performance-data/
  1305. */
  1306. getPerformanceData(packageName: string, dataType: string, dataReadTimeout?: number): string[];
  1307. /**
  1308. * [appium]
  1309. * Press a particular key on the device.
  1310. * http://appium.io/docs/en/commands/device/keys/press-keycode/
  1311. */
  1312. pressKeyCode(keycode: number, metastate?: number, flags?: number): void;
  1313. /**
  1314. * [appium]
  1315. * Press and hold a particular key code on the device.
  1316. * http://appium.io/docs/en/commands/device/keys/long-press-keycode/
  1317. */
  1318. longPressKeyCode(keycode: number, metastate?: number, flags?: number): void;
  1319. /**
  1320. * [appium]
  1321. * Send a key code to the device.
  1322. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints
  1323. */
  1324. sendKeyEvent(keycode: string, metastate?: string): void;
  1325. /**
  1326. * [appium]
  1327. * Rotate the device in three dimensions.
  1328. * http://appium.io/docs/en/commands/device/interactions/rotate/
  1329. */
  1330. rotateDevice(x: number, y: number, radius: number, rotation: number, touchCount: number, duration: number, element?: string): void;
  1331. /**
  1332. * [appium]
  1333. * Get the name of the current Android activity.
  1334. * http://appium.io/docs/en/commands/device/activity/current-activity/
  1335. */
  1336. getCurrentActivity(): string;
  1337. /**
  1338. * [appium]
  1339. * Get the name of the current Android package.
  1340. * http://appium.io/docs/en/commands/device/activity/current-package/
  1341. */
  1342. getCurrentPackage(): string;
  1343. /**
  1344. * [appium]
  1345. * Install the given app onto the device.
  1346. * http://appium.io/docs/en/commands/device/app/install-app/
  1347. */
  1348. installApp(appPath: string): void;
  1349. /**
  1350. * [appium]
  1351. * Activate the given app onto the device
  1352. * http://appium.io/docs/en/commands/device/app/activate-app/
  1353. */
  1354. activateApp(appId?: string, bundleId?: string): void;
  1355. /**
  1356. * [appium]
  1357. * Remove an app from the device.
  1358. * http://appium.io/docs/en/commands/device/app/remove-app/
  1359. */
  1360. removeApp(appId?: string, bundleId?: string): void;
  1361. /**
  1362. * [appium]
  1363. * Terminate the given app on the device
  1364. * http://appium.io/docs/en/commands/device/app/terminate-app/
  1365. */
  1366. terminateApp(appId?: string, bundleId?: string): void;
  1367. /**
  1368. * [appium]
  1369. * Check whether the specified app is installed on the device.
  1370. * http://appium.io/docs/en/commands/device/app/is-app-installed/
  1371. */
  1372. isAppInstalled(appId?: string, bundleId?: string): boolean;
  1373. /**
  1374. * [appium]
  1375. * Get the given app status on the device
  1376. * http://appium.io/docs/en/commands/device/app/app-state/
  1377. */
  1378. queryAppState(appId?: string, bundleId?: string): number;
  1379. /**
  1380. * [appium]
  1381. * Hide soft keyboard.
  1382. * http://appium.io/docs/en/commands/device/keys/hide-keyboard/
  1383. */
  1384. hideKeyboard(strategy?: string, key?: string, keyCode?: string, keyName?: string): void;
  1385. /**
  1386. * [appium]
  1387. * Whether or not the soft keyboard is shown.
  1388. * http://appium.io/docs/en/commands/device/keys/is-keyboard-shown/
  1389. */
  1390. isKeyboardShown(): boolean;
  1391. /**
  1392. * [appium]
  1393. * Place a file onto the device in a particular place.
  1394. * http://appium.io/docs/en/commands/device/files/push-file/
  1395. */
  1396. pushFile(path: string, data: string): void;
  1397. /**
  1398. * [appium]
  1399. * Retrieve a file from the device's file system.
  1400. * http://appium.io/docs/en/commands/device/files/pull-file/
  1401. */
  1402. pullFile(path: string): void;
  1403. /**
  1404. * [appium]
  1405. * Retrieve a folder from the device's file system.
  1406. * http://appium.io/docs/en/commands/device/files/pull-folder/
  1407. */
  1408. pullFolder(path: string): void;
  1409. /**
  1410. * [appium]
  1411. * Toggle airplane mode on device.
  1412. * http://appium.io/docs/en/commands/device/network/toggle-airplane-mode/
  1413. */
  1414. toggleAirplaneMode(): void;
  1415. /**
  1416. * [appium]
  1417. * Switch the state of data service.
  1418. * http://appium.io/docs/en/commands/device/network/toggle-data/
  1419. */
  1420. toggleData(): void;
  1421. /**
  1422. * [appium]
  1423. * Switch the state of the wifi service.
  1424. * http://appium.io/docs/en/commands/device/network/toggle-wifi/
  1425. */
  1426. toggleWiFi(): void;
  1427. /**
  1428. * [appium]
  1429. * Switch the state of the location service.
  1430. * http://appium.io/docs/en/commands/device/network/toggle-location-services/
  1431. */
  1432. toggleLocationServices(): void;
  1433. /**
  1434. * [appium]
  1435. * Set network speed (Emulator only)
  1436. * http://appium.io/docs/en/commands/device/network/network-speed/
  1437. */
  1438. toggleNetworkSpeed(): void;
  1439. /**
  1440. * [appium]
  1441. * Open Android notifications (Emulator only).
  1442. * http://appium.io/docs/en/commands/device/system/open-notifications/
  1443. */
  1444. openNotifications(): void;
  1445. /**
  1446. * [appium]
  1447. * Start an Android activity by providing package name and activity name.
  1448. * http://appium.io/docs/en/commands/device/activity/start-activity/
  1449. */
  1450. startActivity(appPackage: string, appActivity: string, appWaitPackage?: string, appWaitActivity?: string, intentAction?: string, intentCategory?: string, intentFlags?: string, optionalIntentArguments?: string, dontStopAppOnReset?: string): void;
  1451. /**
  1452. * [appium]
  1453. * Retrieve visibility and bounds information of the status and navigation bars.
  1454. * http://appium.io/docs/en/commands/device/system/system-bars/
  1455. */
  1456. getSystemBars(): object[];
  1457. /**
  1458. * [appium]
  1459. * Get the time on the device.
  1460. * http://appium.io/docs/en/commands/device/system/system-time/
  1461. */
  1462. getDeviceTime(): string;
  1463. /**
  1464. * [appium]
  1465. * Get display density from device.
  1466. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints
  1467. */
  1468. getDisplayDensity(): any;
  1469. /**
  1470. * [appium]
  1471. * Simulate a [touch id](https://support.apple.com/en-ca/ht201371) event (iOS Simulator only). To enable this feature, the `allowTouchIdEnroll` desired capability must be set to true and the Simulator must be [enrolled](https://support.apple.com/en-ca/ht201371). When you set allowTouchIdEnroll to true, it will set the Simulator to be enrolled by default. The enrollment state can be [toggled](http://appium.io/docs/en/commands/device/simulator/toggle-touch-id-enrollment/index.html). This call will only work if Appium process or its parent application (e.g. Terminal.app or Appium.app) has access to Mac OS accessibility in System Preferences > Security & Privacy > Privacy > Accessibility list.
  1472. * http://appium.io/docs/en/commands/device/simulator/touch-id/
  1473. */
  1474. touchId(match: boolean): void;
  1475. /**
  1476. * [appium]
  1477. * Toggle the simulator being [enrolled](https://support.apple.com/en-ca/ht201371) to accept touchId (iOS Simulator only). To enable this feature, the `allowTouchIdEnroll` desired capability must be set to true. When `allowTouchIdEnroll` is set to true the Simulator will be enrolled by default, and the 'Toggle Touch ID Enrollment' changes the enrollment state. This call will only work if the Appium process or its parent application (e.g., Terminal.app or Appium.app) has access to Mac OS accessibility in System Preferences > Security & Privacy > Privacy > Accessibility list.
  1478. * http://appium.io/docs/en/commands/device/simulator/toggle-touch-id-enrollment/
  1479. */
  1480. toggleEnrollTouchId(enabled?: boolean): void;
  1481. /**
  1482. * [appium]
  1483. * Launch an app on device. iOS tests with XCUITest can also use the `mobile: launchApp` method. See detailed [documentation](http://appium.io/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management/index.html#mobile-launchapp).
  1484. * http://appium.io/docs/en/commands/device/app/launch-app/
  1485. */
  1486. launchApp(): void;
  1487. /**
  1488. * [appium]
  1489. * Close an app on device.
  1490. * http://appium.io/docs/en/commands/device/app/close-app/
  1491. */
  1492. closeApp(): void;
  1493. /**
  1494. * [appium]
  1495. * Reset the currently running app for this session.
  1496. * http://appium.io/docs/en/commands/device/app/reset-app/
  1497. */
  1498. reset(): void;
  1499. /**
  1500. * [appium]
  1501. * Send the currently running app for this session to the background. iOS tests with XCUITest can also use the `mobile: terminateApp` method to terminate the current app (see detailed [documentation](http://appium.io/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management/index.html#mobile-terminateapp)), and the `mobile: activateApp` to activate an existing application on the device under test and moves it to the foreground (see detailed [documentation](http://appium.io/docs/en/writing-running-appium/ios/ios-xctest-mobile-apps-management/index.html#mobile-activateapp)).
  1502. * http://appium.io/docs/en/commands/device/app/background-app/
  1503. */
  1504. background(seconds: (number|null)): void;
  1505. /**
  1506. * [appium]
  1507. * Get test coverage data.
  1508. * http://appium.io/docs/en/commands/device/app/end-test-coverage/
  1509. */
  1510. endCoverage(intent: string, path: string): void;
  1511. /**
  1512. * [appium]
  1513. * Get app strings.
  1514. * http://appium.io/docs/en/commands/device/app/get-app-strings/
  1515. */
  1516. getStrings(language?: string, stringFile?: string): StringsReturn;
  1517. /**
  1518. * [appium]
  1519. *
  1520. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints
  1521. */
  1522. setValueImmediate(elementId: string, value: string): void;
  1523. /**
  1524. * [appium]
  1525. * Replace the value to element directly.
  1526. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints
  1527. */
  1528. replaceValue(elementId: string, value: string): void;
  1529. /**
  1530. * [appium]
  1531. * Retrieve the current settings on the device.
  1532. * http://appium.io/docs/en/commands/session/settings/get-settings/
  1533. */
  1534. getSettings(): SettingsReturn;
  1535. /**
  1536. * [appium]
  1537. * Update the current setting on the device.
  1538. * http://appium.io/docs/en/commands/session/settings/update-settings/
  1539. */
  1540. updateSettings(settings: object): void;
  1541. /**
  1542. * [appium]
  1543. * Callback url for asynchronous execution of JavaScript.
  1544. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints
  1545. */
  1546. receiveAsyncResponse(response: object): void;
  1547. /**
  1548. * [appium]
  1549. * Make GSM call (Emulator only).
  1550. * http://appium.io/docs/en/commands/device/network/gsm-call/
  1551. */
  1552. gsmCall(phoneNumber: string, action: string): void;
  1553. /**
  1554. * [appium]
  1555. * Set GSM signal strength (Emulator only).
  1556. * http://appium.io/docs/en/commands/device/network/gsm-signal/
  1557. */
  1558. gsmSignal(signalStrength: string, signalStrengh?: string): void;
  1559. /**
  1560. * [appium]
  1561. * Set the battery percentage (Emulator only).
  1562. * http://appium.io/docs/en/commands/device/emulator/power_capacity/
  1563. */
  1564. powerCapacity(percent: number): void;
  1565. /**
  1566. * [appium]
  1567. * Set the state of the battery charger to connected or not (Emulator only).
  1568. * http://appium.io/docs/en/commands/device/emulator/power_ac/
  1569. */
  1570. powerAC(state: string): void;
  1571. /**
  1572. * [appium]
  1573. * Set GSM voice state (Emulator only).
  1574. * http://appium.io/docs/en/commands/device/network/gsm-voice/
  1575. */
  1576. gsmVoice(state: string): void;
  1577. /**
  1578. * [appium]
  1579. * Simulate an SMS message (Emulator only).
  1580. * http://appium.io/docs/en/commands/device/network/send-sms/
  1581. */
  1582. sendSms(phoneNumber: string, message: string): void;
  1583. /**
  1584. * [appium]
  1585. * Authenticate users by using their finger print scans on supported emulators.
  1586. * http://appium.io/docs/en/commands/device/authentication/finger-print/
  1587. */
  1588. fingerPrint(fingerprintId: number): void;
  1589. /**
  1590. * [appium]
  1591. * Set the content of the system clipboard
  1592. * http://appium.io/docs/en/commands/device/clipboard/set-clipboard/
  1593. */
  1594. setClipboard(content: string, contentType?: string, label?: string): string;
  1595. /**
  1596. * [appium]
  1597. * Get the content of the system clipboard
  1598. * http://appium.io/docs/en/commands/device/clipboard/get-clipboard/
  1599. */
  1600. getClipboard(contentType?: string): string;
  1601. /**
  1602. * [appium]
  1603. * This functionality is only available from within a native context. 'Touch Perform' works similarly to the other singular touch interactions, except that this allows you to chain together more than one touch action as one command. This is useful because Appium commands are sent over the network and there's latency between commands. This latency can make certain touch interactions impossible because some interactions need to be performed in one sequence. Vertical, for example, requires pressing down, moving to a different y coordinate, and then releasing. For it to work, there can't be a delay between the interactions.
  1604. * http://appium.io/docs/en/commands/interactions/touch/touch-perform/
  1605. */
  1606. touchPerform(actions: object[]): void;
  1607. /**
  1608. * [appium]
  1609. * This functionality is only available from within a native context. Perform a multi touch action sequence.
  1610. * http://appium.io/docs/en/commands/interactions/touch/multi-touch-perform/
  1611. */
  1612. multiTouchPerform(actions: object[]): void;
  1613. /**
  1614. * [appium]
  1615. * This command allows you to define a webdriverio script in a string and send it to the Appium server to be executed locally to the server itself, thus reducing latency that might otherwise occur along with each command.
  1616. * https://github.com/appium/appium/blob/master/docs/en/commands/session/execute-driver.md
  1617. */
  1618. driverScript(script: string, type?: string, timeout?: number): ProtocolCommandResponse;
  1619. /**
  1620. * [appium]
  1621. * Get events stored in appium server.
  1622. * https://github.com/appium/appium/blob/master/docs/en/commands/session/events/get-events.md
  1623. */
  1624. getEvents(type: string[]): ProtocolCommandResponse;
  1625. /**
  1626. * [appium]
  1627. * Store a custom event.
  1628. * https://github.com/appium/appium/blob/master/docs/en/commands/session/events/log-event.md
  1629. */
  1630. logEvent(vendor: string, event: string): void;
  1631. /**
  1632. * [appium]
  1633. * Performs images comparison using OpenCV framework features. It is expected that both OpenCV framework and opencv4nodejs module are installed on the machine where Appium server is running.
  1634. * http://appium.io/docs/en/writing-running-appium/image-comparison/
  1635. */
  1636. compareImages(mode: string, firstImage: string, secondImage: string, options: object): ProtocolCommandResponse;
  1637. }
  1638. // jsonwp types
  1639. interface Client extends BaseClient {
  1640. /**
  1641. * [jsonwp]
  1642. * Query the server's current status. The server should respond with a general "HTTP 200 OK" response if it is alive and accepting commands. The response body should be a JSON object describing the state of the server. All server implementations should return two basic objects describing the server's current platform and when the server was built. All fields are optional; if omitted, the client should assume the value is unknown. Furthermore, server implementations may include additional fields not listed here.
  1643. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#status
  1644. */
  1645. status(): StatusReturn;
  1646. /**
  1647. * [jsonwp]
  1648. * Create a new session. The server should attempt to create a session that most closely matches the desired and required capabilities. Required capabilities have higher priority than desired capabilities and must be set for the session to be created.
  1649. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#session-1
  1650. */
  1651. newSession(desiredCapabilities: object, requiredCapabilities: object): SessionReturn;
  1652. /**
  1653. * [jsonwp]
  1654. * Returns a list of the currently active sessions. Each session will be returned as a list of JSON objects containing `id` and `capabilities`.
  1655. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessions
  1656. */
  1657. getSessions(): object[];
  1658. /**
  1659. * [jsonwp]
  1660. * Retrieve the capabilities of the specified session.
  1661. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionid
  1662. */
  1663. getSession(): ProtocolCommandResponse;
  1664. /**
  1665. * [jsonwp]
  1666. * Delete the session.
  1667. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionid
  1668. */
  1669. deleteSession(): void;
  1670. /**
  1671. * [jsonwp]
  1672. * Configure the amount of time that a particular type of operation can execute for before they are aborted and a |Timeout| error is returned to the client.
  1673. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtimeouts
  1674. */
  1675. setTimeouts(type: string, ms: number): void;
  1676. /**
  1677. * [jsonwp]
  1678. * Set the amount of time, in milliseconds, that asynchronous scripts executed by `/session/:sessionId/execute_async` are permitted to run before they are aborted and a `Timeout` error is returned to the client.
  1679. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtimeoutsasync_script
  1680. */
  1681. setAsyncTimeout(ms: number): void;
  1682. /**
  1683. * [jsonwp]
  1684. * Set the amount of time the driver should wait when searching for elements. When searching for a single element, the driver should poll the page until an element is found or the timeout expires, whichever occurs first. When searching for multiple elements, the driver should poll the page until at least one element is found or the timeout expires, at which point it should return an empty list. If this command is never sent, the driver should default to an implicit wait of 0ms.
  1685. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtimeoutsimplicit_wait
  1686. */
  1687. setImplicitTimeout(ms: number): void;
  1688. /**
  1689. * [jsonwp]
  1690. * Retrieve the URL of the current page.
  1691. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidurl
  1692. */
  1693. getUrl(): string;
  1694. /**
  1695. * [jsonwp]
  1696. * Navigate to a new URL.
  1697. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidurl
  1698. */
  1699. navigateTo(url: string): void;
  1700. /**
  1701. * [jsonwp]
  1702. * Navigate backwards in the browser history, if possible.
  1703. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidback
  1704. */
  1705. back(): void;
  1706. /**
  1707. * [jsonwp]
  1708. * Navigate forwards in the browser history, if possible.
  1709. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidforward
  1710. */
  1711. forward(): void;
  1712. /**
  1713. * [jsonwp]
  1714. * Refresh the current page.
  1715. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidrefresh
  1716. */
  1717. refresh(): void;
  1718. /**
  1719. * [jsonwp]
  1720. * Get the current page title.
  1721. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtitle
  1722. */
  1723. getTitle(): string;
  1724. /**
  1725. * [jsonwp]
  1726. * Retrieve the current window handle.
  1727. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidwindow_handle
  1728. */
  1729. getWindowHandle(): string;
  1730. /**
  1731. * [jsonwp]
  1732. * Retrieve the list of all window handles available to the session.
  1733. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidwindow_handles
  1734. */
  1735. getWindowHandles(): string[];
  1736. /**
  1737. * [jsonwp]
  1738. * Close the current window.
  1739. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidwindow
  1740. */
  1741. closeWindow(): void;
  1742. /**
  1743. * [jsonwp]
  1744. * Change focus to another window. The window to change focus to may be specified by its server assigned window handle, or by the value of its `name` attribute.
  1745. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidwindow
  1746. */
  1747. switchToWindow(name: string): void;
  1748. /**
  1749. * [jsonwp]
  1750. * Change focus to another frame on the page. If the frame `id` is `null`, the server should switch to the page's default content.
  1751. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidframe
  1752. */
  1753. switchToFrame(id: (string|number|object|null)): void;
  1754. /**
  1755. * [jsonwp]
  1756. * Change focus to the parent context. If the current context is the top level browsing context, the context remains unchanged.
  1757. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidframeparent
  1758. */
  1759. switchToParentFrame(): void;
  1760. /**
  1761. * [jsonwp]
  1762. * Get the position of the current focussed window.
  1763. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidwindowwindowhandleposition
  1764. */
  1765. getWindowPosition(): ProtocolCommandResponse;
  1766. /**
  1767. * [jsonwp]
  1768. * Change the position of the current focussed window.
  1769. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidwindowwindowhandleposition
  1770. */
  1771. setWindowPosition(x: number, y: number): ProtocolCommandResponse;
  1772. /**
  1773. * [jsonwp]
  1774. * Get the size of the current focused window.
  1775. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidwindowwindowhandlesize
  1776. */
  1777. _getWindowSize(): ProtocolCommandResponse;
  1778. /**
  1779. * [jsonwp]
  1780. * Change the size of the current focused window.
  1781. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidwindowwindowhandlesize
  1782. */
  1783. _setWindowSize(width: number, height: number): void;
  1784. /**
  1785. * [jsonwp]
  1786. * Maximize the current focused window if not already maximized.
  1787. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidwindowwindowhandlemaximize
  1788. */
  1789. maximizeWindow(): void;
  1790. /**
  1791. * [jsonwp]
  1792. * Search for an element on the page, starting from the document root. The located element will be returned as a WebElement JSON object. The table below lists the locator strategies that each server should support. Each locator must return the first matching element located in the DOM.
  1793. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelement
  1794. */
  1795. findElement(using: string, value: string): string;
  1796. /**
  1797. * [jsonwp]
  1798. * Search for multiple elements on the page, starting from the document root. The located elements will be returned as a WebElement JSON objects. The table below lists the locator strategies that each server should support. Elements should be returned in the order located in the DOM.
  1799. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelements
  1800. */
  1801. findElements(using: string, value: string): string[];
  1802. /**
  1803. * [jsonwp]
  1804. * Search for an element on the page, starting from the identified element. The located element will be returned as a WebElement JSON object. The table below lists the locator strategies that each server should support. Each locator must return the first matching element located in the DOM.
  1805. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidelement
  1806. */
  1807. findElementFromElement(elementId: string, using: string, value: string): ElementReference;
  1808. /**
  1809. * [jsonwp]
  1810. * Search for multiple elements on the page, starting from the identified element. The located elements will be returned as a WebElement JSON objects. The table below lists the locator strategies that each server should support. Elements should be returned in the order located in the DOM.
  1811. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidelements
  1812. */
  1813. findElementsFromElement(elementId: string, using: string, value: string): ElementReference[];
  1814. /**
  1815. * [jsonwp]
  1816. * Get the element on the page that currently has focus. The element will be returned as a WebElement JSON object.
  1817. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementactive
  1818. */
  1819. getActiveElement(): string;
  1820. /**
  1821. * [jsonwp]
  1822. * Determine if an `OPTION` element, or an `INPUT` element of type `checkbox` or `radiobutton` is currently selected.
  1823. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidselected
  1824. */
  1825. isElementSelected(elementId: string): boolean;
  1826. /**
  1827. * [jsonwp]
  1828. * Determine if an element is currently displayed.
  1829. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementiddisplayed
  1830. */
  1831. isElementDisplayed(elementId: string): boolean;
  1832. /**
  1833. * [jsonwp]
  1834. * Get the value of an element's attribute.
  1835. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidattributename
  1836. */
  1837. getElementAttribute(elementId: string, name: string): string|null;
  1838. /**
  1839. * [jsonwp]
  1840. * Query the value of an element's computed CSS property. The CSS property to query should be specified using the CSS property name, __not__ the JavaScript property name (e.g. `background-color` instead of `backgroundColor`).
  1841. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidcsspropertyname
  1842. */
  1843. getElementCSSValue(elementId: string, propertyName: string): string;
  1844. /**
  1845. * [jsonwp]
  1846. * Returns the visible text for the element.
  1847. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidtext
  1848. */
  1849. getElementText(elementId: string): string;
  1850. /**
  1851. * [jsonwp]
  1852. * Query for an element's tag name.
  1853. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidname
  1854. */
  1855. getElementTagName(elementId: string): string;
  1856. /**
  1857. * [jsonwp]
  1858. * Determine an element's location on the page. The point `(0, 0)` refers to the upper-left corner of the page. The element's coordinates are returned as a JSON object with `x` and `y` properties.
  1859. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidlocation
  1860. */
  1861. getElementLocation(elementId: string): ProtocolCommandResponse;
  1862. /**
  1863. * [jsonwp]
  1864. * Determine an element's location on the screen once it has been scrolled into view.<br><br>__Note:__ This is considered an internal command and should only be used to determine an element's location for correctly generating native events.
  1865. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidlocation_in_view
  1866. */
  1867. getElementLocationInView(elementId: string): ProtocolCommandResponse;
  1868. /**
  1869. * [jsonwp]
  1870. * Determine an element's size in pixels. The size will be returned as a JSON object with `width` and `height` properties.
  1871. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidsize
  1872. */
  1873. getElementSize(elementId: string): ProtocolCommandResponse;
  1874. /**
  1875. * [jsonwp]
  1876. * Determine if an element is currently enabled.
  1877. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidenabled
  1878. */
  1879. isElementEnabled(elementId: string): boolean;
  1880. /**
  1881. * [jsonwp]
  1882. * Click any mouse button (at the coordinates set by the last moveto command). Note that calling this command after calling buttondown and before calling button up (or any out-of-order interactions sequence) will yield undefined behaviour).
  1883. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidclick
  1884. */
  1885. elementClick(elementId: string): void;
  1886. /**
  1887. * [jsonwp]
  1888. * Compare elements with each other.
  1889. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidequalsother
  1890. */
  1891. elementEquals(elementId: string, otherElementId: string): boolean;
  1892. /**
  1893. * [jsonwp]
  1894. *
  1895. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidsubmit
  1896. */
  1897. elementSubmit(elementId: string): void;
  1898. /**
  1899. * [jsonwp]
  1900. *
  1901. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidclear
  1902. */
  1903. elementClear(elementId: string): void;
  1904. /**
  1905. * [jsonwp]
  1906. *
  1907. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidvalue
  1908. */
  1909. elementSendKeys(elementId: string, value: string[]): void;
  1910. /**
  1911. * [jsonwp]
  1912. *
  1913. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidkeys
  1914. */
  1915. sendKeys(value: string[]): void;
  1916. /**
  1917. * [jsonwp]
  1918. *
  1919. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidsource
  1920. */
  1921. getPageSource(): string;
  1922. /**
  1923. * [jsonwp]
  1924. *
  1925. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidexecute
  1926. */
  1927. executeScript(script: string, args?: (string|object|number|boolean|undefined)[]): any;
  1928. /**
  1929. * [jsonwp]
  1930. *
  1931. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidexecute_async
  1932. */
  1933. executeAsyncScript(script: string, args: (string|object|number|boolean|undefined)[]): any;
  1934. /**
  1935. * [jsonwp]
  1936. *
  1937. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidcookie
  1938. */
  1939. getAllCookies(): object[];
  1940. /**
  1941. * [jsonwp]
  1942. *
  1943. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidcookie
  1944. */
  1945. addCookie(cookie: object): void;
  1946. /**
  1947. * [jsonwp]
  1948. *
  1949. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidcookie
  1950. */
  1951. deleteAllCookies(): void;
  1952. /**
  1953. * [jsonwp]
  1954. *
  1955. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidcookiename
  1956. */
  1957. deleteCookie(name: string): void;
  1958. /**
  1959. * [jsonwp]
  1960. *
  1961. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessioniddismiss_alert
  1962. */
  1963. dismissAlert(): void;
  1964. /**
  1965. * [jsonwp]
  1966. *
  1967. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidaccept_alert
  1968. */
  1969. acceptAlert(): void;
  1970. /**
  1971. * [jsonwp]
  1972. *
  1973. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidalert_text
  1974. */
  1975. getAlertText(): string;
  1976. /**
  1977. * [jsonwp]
  1978. *
  1979. * https://w3c.github.io/webdriver/webdriver-spec.html#dfn-send-alert-text
  1980. */
  1981. sendAlertText(text: string): void;
  1982. /**
  1983. * [jsonwp]
  1984. *
  1985. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidscreenshot
  1986. */
  1987. takeScreenshot(): string;
  1988. /**
  1989. * [jsonwp]
  1990. *
  1991. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidimeavailable_engines
  1992. */
  1993. getAvailableEngines(): string[];
  1994. /**
  1995. * [jsonwp]
  1996. *
  1997. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidimeactive_engine
  1998. */
  1999. getActiveEngine(): string;
  2000. /**
  2001. * [jsonwp]
  2002. *
  2003. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidimeactivated
  2004. */
  2005. isIMEActivated(): boolean;
  2006. /**
  2007. * [jsonwp]
  2008. *
  2009. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidimedeactivate
  2010. */
  2011. deactivateIME(): void;
  2012. /**
  2013. * [jsonwp]
  2014. *
  2015. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidimeactivate
  2016. */
  2017. activateIME(engine: string): void;
  2018. /**
  2019. * [jsonwp]
  2020. *
  2021. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidorientation
  2022. */
  2023. getOrientation(): string;
  2024. /**
  2025. * [jsonwp]
  2026. *
  2027. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidorientation
  2028. */
  2029. setOrientation(orientation: string): void;
  2030. /**
  2031. * [jsonwp]
  2032. *
  2033. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidmoveto
  2034. */
  2035. moveToElement(element?: (string|null), xoffset?: number, yoffset?: number): void;
  2036. /**
  2037. * [jsonwp]
  2038. * Click and hold the left mouse button (at the coordinates set by the last moveto command). Note that the next mouse-related command that should follow is buttonup . Any other mouse command (such as click or another call to buttondown) will yield undefined behaviour.
  2039. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidbuttondown
  2040. */
  2041. buttonDown(button?: number): void;
  2042. /**
  2043. * [jsonwp]
  2044. * Releases the mouse button previously held (where the mouse is currently at). Must be called once for every buttondown command issued. See the note in click and buttondown about implications of out-of-order commands.
  2045. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidbuttonup
  2046. */
  2047. buttonUp(button?: number): void;
  2048. /**
  2049. * [jsonwp]
  2050. * Clicks at the current mouse coordinates (set by moveto).
  2051. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidclick
  2052. */
  2053. positionClick(button?: number): void;
  2054. /**
  2055. * [jsonwp]
  2056. * Double-clicks at the current mouse coordinates (set by moveto).
  2057. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessioniddoubleclick
  2058. */
  2059. positionDoubleClick(): void;
  2060. /**
  2061. * [jsonwp]
  2062. * Single tap on the touch enabled device.
  2063. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchclick
  2064. */
  2065. touchClick(element: string): void;
  2066. /**
  2067. * [jsonwp]
  2068. * Finger down on the screen.
  2069. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchdown
  2070. */
  2071. touchDown(x: number, y: number): void;
  2072. /**
  2073. * [jsonwp]
  2074. * Finger up on the screen.
  2075. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchup
  2076. */
  2077. touchUp(x: number, y: number): void;
  2078. /**
  2079. * [jsonwp]
  2080. * Finger move on the screen.
  2081. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchmove
  2082. */
  2083. touchMove(x: number, y: number): void;
  2084. /**
  2085. * [jsonwp]
  2086. * Finger move on the screen.
  2087. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchscroll
  2088. */
  2089. touchScroll(xoffset: number, yoffset: number, element?: string): void;
  2090. /**
  2091. * [jsonwp]
  2092. * Double tap on the touch screen using finger motion events.
  2093. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchdoubleclick
  2094. */
  2095. touchDoubleClick(element: string): void;
  2096. /**
  2097. * [jsonwp]
  2098. * Long press on the touch screen using finger motion events.
  2099. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchlongclick
  2100. */
  2101. touchLongClick(element: string): void;
  2102. /**
  2103. * [jsonwp]
  2104. * Flick on the touch screen using finger motion events. This flickcommand starts at a particulat screen location.
  2105. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchflick
  2106. */
  2107. touchFlick(xoffset?: number, yoffset?: number, element?: string, speed?: number, xspeed?: number, yspeed?: number): void;
  2108. /**
  2109. * [jsonwp]
  2110. * Get the current geo location.
  2111. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidlocation
  2112. */
  2113. getGeoLocation(): ProtocolCommandResponse;
  2114. /**
  2115. * [jsonwp]
  2116. * Set the current geo location.
  2117. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidlocation
  2118. */
  2119. setGeoLocation(location: object): void;
  2120. /**
  2121. * [jsonwp]
  2122. * Get all keys of the storage.
  2123. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidlocal_storage
  2124. */
  2125. getLocalStorage(): string[];
  2126. /**
  2127. * [jsonwp]
  2128. * Set the storage item for the given key.
  2129. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidlocal_storage
  2130. */
  2131. setLocalStorage(key: string, value: string): void;
  2132. /**
  2133. * [jsonwp]
  2134. * Clear the storage.
  2135. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidlocal_storage
  2136. */
  2137. clearLocalStorage(): void;
  2138. /**
  2139. * [jsonwp]
  2140. * Get the storage item for the given key.
  2141. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidlocal_storagekeykey
  2142. */
  2143. getLocalStorageItem(key: string): string;
  2144. /**
  2145. * [jsonwp]
  2146. *
  2147. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidlocal_storagekeykey
  2148. */
  2149. deleteLocalStorageItem(key: string): void;
  2150. /**
  2151. * [jsonwp]
  2152. * Get the number of items in the storage.
  2153. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlocal_storagesize
  2154. */
  2155. getLocalStorageSize(): number;
  2156. /**
  2157. * [jsonwp]
  2158. * Get all keys of the storage.
  2159. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidsession_storage
  2160. */
  2161. getSessionStorage(): string[];
  2162. /**
  2163. * [jsonwp]
  2164. * Set the storage item for the given key.
  2165. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidsession_storage
  2166. */
  2167. setSessionStorage(key: string, value: string): void;
  2168. /**
  2169. * [jsonwp]
  2170. * Clear the storage.
  2171. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidsession_storage
  2172. */
  2173. clearSessionStorage(): void;
  2174. /**
  2175. * [jsonwp]
  2176. * Get the storage item for the given key.
  2177. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidsession_storagekeykey
  2178. */
  2179. getSessionStorageItem(key: string): string;
  2180. /**
  2181. * [jsonwp]
  2182. * Remove the storage item for the given key.
  2183. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidsession_storagekeykey
  2184. */
  2185. deleteSessionStorageItem(key: string): void;
  2186. /**
  2187. * [jsonwp]
  2188. * Get the number of items in the storage.
  2189. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidsession_storagesize
  2190. */
  2191. getSessionStorageSize(): number;
  2192. /**
  2193. * [jsonwp]
  2194. * Get the log for a given log type. Log buffer is reset after each request.
  2195. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog
  2196. */
  2197. getLogs(type: string): object[];
  2198. /**
  2199. * [jsonwp]
  2200. * Get available log types.
  2201. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlogtypes
  2202. */
  2203. getLogTypes(): string[];
  2204. /**
  2205. * [jsonwp]
  2206. * Get the status of the html5 application cache.
  2207. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidapplication_cachestatus
  2208. */
  2209. getApplicationCacheStatus(): number;
  2210. }
  2211. // mjsonwp types
  2212. interface Client extends BaseClient {
  2213. /**
  2214. * [mjsonwp]
  2215. *
  2216. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts
  2217. */
  2218. getContext(): string|null;
  2219. /**
  2220. * [mjsonwp]
  2221. *
  2222. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts
  2223. */
  2224. switchContext(name: string): void;
  2225. /**
  2226. * [mjsonwp]
  2227. *
  2228. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts
  2229. */
  2230. getContexts(): string[];
  2231. /**
  2232. * [mjsonwp]
  2233. *
  2234. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#mobile-json-wire-protocol-endpoints
  2235. */
  2236. getPageIndex(): string;
  2237. /**
  2238. * [mjsonwp]
  2239. *
  2240. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes
  2241. */
  2242. getNetworkConnection(): number;
  2243. /**
  2244. * [mjsonwp]
  2245. *
  2246. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes
  2247. */
  2248. setNetworkConnection(type: number): void;
  2249. /**
  2250. * [mjsonwp]
  2251. *
  2252. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#touch-gestures
  2253. */
  2254. touchPerform(actions: object[]): void;
  2255. /**
  2256. * [mjsonwp]
  2257. *
  2258. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#touch-gestures
  2259. */
  2260. multiTouchPerform(actions: object[], elementId: object[]): void;
  2261. /**
  2262. * [mjsonwp]
  2263. *
  2264. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#mobile-json-wire-protocol-endpoints
  2265. */
  2266. receiveAsyncResponse(status: string, value: string): void;
  2267. }
  2268. // chromium types
  2269. interface Client extends BaseClient {
  2270. /**
  2271. * [chromium]
  2272. * Whether a simple dialog is currently open.
  2273. * https://github.com/bayandin/chromedriver/blob/v2.45/alert_commands.cc#L42-L49
  2274. */
  2275. isAlertOpen(): boolean;
  2276. /**
  2277. * [chromium]
  2278. * Whether it should automatically raises errors on browser logs.
  2279. * https://codereview.chromium.org/101203012
  2280. */
  2281. isAutoReporting(): boolean;
  2282. /**
  2283. * [chromium]
  2284. * Toggle whether to return response with unknown error with first browser error (e.g. failed to load resource due to 403/404 response) for all subsequent commands (once enabled).
  2285. * https://codereview.chromium.org/101203012
  2286. */
  2287. setAutoReporting(enabled: boolean): object|null;
  2288. /**
  2289. * [chromium]
  2290. * Determines load status for active window handle.
  2291. * https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L783-L802
  2292. */
  2293. isLoading(): boolean;
  2294. /**
  2295. * [chromium]
  2296. * Takes a heap snapshot of the current execution context.
  2297. * https://github.com/bayandin/chromedriver/blob/v2.45/chrome/web_view.h#L198-L202
  2298. */
  2299. takeHeapSnapshot(): ProtocolCommandResponse;
  2300. /**
  2301. * [chromium]
  2302. * Get the connection type for network emulation. This command is only applicable when remote end replies with `networkConnectionEnabled` capability set to `true`.
  2303. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes
  2304. */
  2305. getNetworkConnection(): number;
  2306. /**
  2307. * [chromium]
  2308. * Change connection type for network connection. This command is only applicable when remote end replies with `networkConnectionEnabled` capability set to `true`.
  2309. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes
  2310. */
  2311. setNetworkConnection(parameters: object): number;
  2312. /**
  2313. * [chromium]
  2314. * Get current network conditions used for emulation.
  2315. * https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L839-L859
  2316. */
  2317. getNetworkConditions(): ProtocolCommandResponse;
  2318. /**
  2319. * [chromium]
  2320. * Set network conditions used for emulation by throttling connection.
  2321. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1663-L1722
  2322. */
  2323. setNetworkConditions(network_conditions: object, network_name?: string): void;
  2324. /**
  2325. * [chromium]
  2326. * Disable any network throttling which might have been set. Equivalent of setting the `No throttling` preset.
  2327. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1724-L1745
  2328. */
  2329. deleteNetworkConditions(): void;
  2330. /**
  2331. * [chromium]
  2332. * Send a command to the DevTools debugger.<br>For a list of available commands and their parameters refer to the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/).
  2333. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1290-L1304
  2334. */
  2335. sendCommand(cmd: string, params: object): void;
  2336. /**
  2337. * [chromium]
  2338. * Send a command to the DevTools debugger and wait for the result.<br>For a list of available commands and their parameters refer to the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/).
  2339. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1306-L1320
  2340. */
  2341. sendCommandAndGetResult(cmd: string, params: object): any;
  2342. /**
  2343. * [chromium]
  2344. * Generates a report for testing. Extension for [Reporting API](https://developers.google.com/web/updates/2018/09/reportingapi).
  2345. * https://w3c.github.io/reporting/#generate-test-report-command
  2346. */
  2347. generateTestReport(message: string, group: string): void;
  2348. /**
  2349. * [chromium]
  2350. * Upload a file to remote machine on which the browser is running.
  2351. * https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L1037-L1065
  2352. */
  2353. file(file: string): string;
  2354. /**
  2355. * [chromium]
  2356. * Launches a Chrome app by specified id.
  2357. * https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L521-L539
  2358. */
  2359. launchChromeApp(id: string): void;
  2360. /**
  2361. * [chromium]
  2362. * Retrieves the value of a given form control element.
  2363. * https://github.com/bayandin/chromedriver/blob/v2.45/element_commands.cc#L431-L443
  2364. */
  2365. getElementValue(elementId: string): string|null;
  2366. /**
  2367. * [chromium]
  2368. * Enable hover state for an element, which is reset upon next interaction.
  2369. * https://github.com/bayandin/chromedriver/blob/v2.45/element_commands.cc#L126-L146
  2370. */
  2371. elementHover(elementId: string): void;
  2372. /**
  2373. * [chromium]
  2374. * Trigger a pinch zoom effect.
  2375. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L813-L827
  2376. */
  2377. touchPinch(x: number, y: number, scale: number): void;
  2378. /**
  2379. * [chromium]
  2380. * Freeze the current page. Extension for [Page Lifecycle API](https://developers.google.com/web/updates/2018/07/page-lifecycle-api).
  2381. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L625-L633
  2382. */
  2383. freeze(): void;
  2384. /**
  2385. * [chromium]
  2386. * Resume the current page. Extension for [Page Lifecycle API](https://developers.google.com/web/updates/2018/07/page-lifecycle-api).
  2387. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L635-L645
  2388. */
  2389. resume(): void;
  2390. /**
  2391. * [chromium]
  2392. * Shutdown ChromeDriver process and consequently terminating all active sessions.
  2393. * https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L489-L498
  2394. */
  2395. shutdown(): void;
  2396. /**
  2397. * [chromium]
  2398. * The Take Element Screenshot command takes a screenshot of the visible region encompassed by the bounding rectangle of an element.
  2399. * https://w3c.github.io/webdriver/#dfn-take-element-screenshot
  2400. */
  2401. takeElementScreenshot(elementId: string, scroll?: boolean): string;
  2402. /**
  2403. * [chromium]
  2404. * Get available log types.
  2405. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlogtypes
  2406. */
  2407. getLogTypes(): string[];
  2408. /**
  2409. * [chromium]
  2410. * Get the log for a given log type. Log buffer is reset after each request.
  2411. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog
  2412. */
  2413. getLogs(type: string): object[];
  2414. }
  2415. // saucelabs types
  2416. interface Client extends BaseClient {
  2417. /**
  2418. * [saucelabs]
  2419. * Get webpage specific log information based on the last page load.
  2420. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands#CustomSauceLabsWebDriverExtensionsforNetworkandLogCommands-ExtendedDebuggingTools
  2421. */
  2422. getPageLogs(type: string): ProtocolCommandResponse;
  2423. /**
  2424. * [saucelabs]
  2425. * With network conditioning you can test your site on a variety of network connections, including Edge, 3G, and even offline. You can throttle the data throughput, including the maximum download and upload throughput, and use latency manipulation to enforce a minimum delay in connection round-trip time (RTT).
  2426. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands#CustomSauceLabsWebDriverExtensionsforNetworkandLogCommands-ThrottleNetworkCapabilities
  2427. */
  2428. throttleNetwork(condition: (string|object)): void;
  2429. /**
  2430. * [saucelabs]
  2431. * You can throttle the CPU in DevTools to understand how your page performs under that constraint.
  2432. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands#CustomSauceLabsWebDriverExtensionsforNetworkandLogCommands-ThrottleCPUCapabilities
  2433. */
  2434. throttleCPU(rate: number): void;
  2435. /**
  2436. * [saucelabs]
  2437. * Allows modifying any request made by the browser. You can blacklist, modify, or redirect these as required for your tests.
  2438. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands#CustomSauceLabsWebDriverExtensionsforNetworkandLogCommands-InterceptNetworkRequests
  2439. */
  2440. interceptRequest(rule: object): void;
  2441. /**
  2442. * [saucelabs]
  2443. * Assert against the performance baseline of your app.
  2444. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2445. */
  2446. assertPerformance(name: string, metrics?: string[]): ProtocolCommandResponse;
  2447. /**
  2448. * [saucelabs]
  2449. * Perform a scroll test that evaluates the jankiness of the application.
  2450. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2451. */
  2452. jankinessCheck(): ProtocolCommandResponse;
  2453. /**
  2454. * [saucelabs]
  2455. * Mocks a network resource.
  2456. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2457. */
  2458. mockRequest(url: string, filterOptions?: object): ProtocolCommandResponse;
  2459. /**
  2460. * [saucelabs]
  2461. * Receive request information about requests that match the mocked resource.
  2462. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2463. */
  2464. getMockCalls(mockId: string): ProtocolCommandResponse;
  2465. /**
  2466. * [saucelabs]
  2467. * Clear list of mock calls.
  2468. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2469. */
  2470. clearMockCalls(mockId: string, restore?: boolean): void;
  2471. /**
  2472. * [saucelabs]
  2473. * Respond if mock matches a specific resource.
  2474. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2475. */
  2476. respondMock(mockId: string, payload: object): void;
  2477. }
  2478. // selenium types
  2479. interface Client extends BaseClient {
  2480. /**
  2481. * [selenium]
  2482. * Upload a file to remote machine on which the browser is running.
  2483. * https://www.seleniumhq.org/
  2484. */
  2485. file(file: string): string;
  2486. /**
  2487. * [selenium]
  2488. * Receive hub config remotely.
  2489. * https://github.com/nicegraham/selenium-grid2-api#gridapihub
  2490. */
  2491. getHubConfig(): ProtocolCommandResponse;
  2492. /**
  2493. * [selenium]
  2494. * Get the details of the Selenium Grid node running a session.
  2495. * https://github.com/nicegraham/selenium-grid2-api#gridapitestsession
  2496. */
  2497. gridTestSession(session: string): ProtocolCommandResponse;
  2498. /**
  2499. * [selenium]
  2500. * Get proxy details.
  2501. * https://github.com/nicegraham/selenium-grid2-api#gridapiproxy
  2502. */
  2503. gridProxyDetails(id: string): ProtocolCommandResponse;
  2504. /**
  2505. * [selenium]
  2506. * Manage lifecycle of hub node.
  2507. * https://github.com/nicegraham/selenium-grid2-api#lifecycle-manager
  2508. */
  2509. manageSeleniumHubLifecycle(action: string): void;
  2510. }
  2511. interface ClientAsync extends AsyncClient, BaseClient { }
  2512. }
  2513. type AsyncClient = {
  2514. [K in keyof Pick<WebDriver.Client, Exclude<keyof WebDriver.Client, keyof WebDriver.BaseClient>>]:
  2515. (...args: Parameters<WebDriver.Client[K]>) => Promise<ReturnType<WebDriver.Client[K]>>;
  2516. }
  2517. declare module "webdriver" {
  2518. export default WebDriver;
  2519. const DEFAULTS: Record<string, any>
  2520. export { DEFAULTS }
  2521. }