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.

types.d.ts 91KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534
  1. /// <reference types="node" />
  2. import * as got from 'got';
  3. import http from 'http';
  4. import https from 'https';
  5. import { EventEmitter } from 'events';
  6. export declare type PageLoadingStrategy = 'none' | 'eager' | 'normal';
  7. export declare type ProxyTypes = 'pac' | 'noproxy' | 'autodetect' | 'system' | 'manual';
  8. export declare type WebDriverLogTypes = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent';
  9. export declare type LoggingPreferenceType = 'OFF' | 'SEVERE' | 'WARNING' | 'INFO' | 'CONFIG' | 'FINE' | 'FINER' | 'FINEST' | 'ALL';
  10. export declare type FirefoxLogLevels = 'trace' | 'debug' | 'config' | 'info' | 'warn' | 'error' | 'fatal';
  11. export declare type Timeouts = Record<'script' | 'pageLoad' | 'implicit', number>;
  12. export declare type SameSiteOptions = 'Lax' | 'Strict';
  13. export interface ProxyObject {
  14. proxyType?: ProxyTypes;
  15. proxyAutoconfigUrl?: string;
  16. ftpProxy?: string;
  17. ftpProxyPort?: number;
  18. httpProxy?: string;
  19. httpProxyPort?: number;
  20. sslProxy?: string;
  21. sslProxyPort?: number;
  22. socksProxy?: string;
  23. socksProxyPort?: number;
  24. socksVersion?: string;
  25. socksUsername?: string;
  26. socksPassword?: string;
  27. }
  28. export interface LoggingPreferences {
  29. browser?: LoggingPreferenceType;
  30. driver?: LoggingPreferenceType;
  31. server?: LoggingPreferenceType;
  32. client?: LoggingPreferenceType;
  33. }
  34. export interface Cookie {
  35. name: string;
  36. value: string;
  37. path?: string;
  38. domain?: string;
  39. secure?: boolean;
  40. httpOnly?: boolean;
  41. expiry?: number;
  42. sameSite?: SameSiteOptions;
  43. }
  44. export interface ChromeOptions {
  45. args?: string[];
  46. binary?: string;
  47. extensions?: string[];
  48. localState?: {
  49. [name: string]: any;
  50. };
  51. detach?: boolean;
  52. debuggerAddress?: string;
  53. excludeSwitches?: string[];
  54. minidumpPath?: string;
  55. mobileEmulation?: {
  56. [name: string]: any;
  57. };
  58. perfLoggingPrefs?: {
  59. enableNetwork?: boolean;
  60. enablePage?: boolean;
  61. enableTimeline?: boolean;
  62. tracingCategories?: boolean;
  63. bufferUsageReportingInterval?: boolean;
  64. };
  65. prefs?: {
  66. [name: string]: string | number | boolean;
  67. };
  68. windowTypes?: string[];
  69. }
  70. interface MicrosoftEdgeOptions extends ChromeOptions {
  71. }
  72. export interface FirefoxLogObject {
  73. level: FirefoxLogLevels;
  74. }
  75. export interface GeckodriverCapabilities {
  76. 'firefox_binary'?: string;
  77. firefoxProfileTemplate?: string;
  78. captureNetworkTraffic?: boolean;
  79. addCustomRequestHeaders?: boolean;
  80. trustAllSSLCertificates?: boolean;
  81. changeMaxConnections?: boolean;
  82. profile?: string;
  83. pageLoadingStrategy?: string;
  84. }
  85. export interface FirefoxOptions {
  86. debuggerAddress?: string;
  87. binary?: string;
  88. args?: string[];
  89. profile?: string;
  90. log?: FirefoxLogObject;
  91. prefs?: {
  92. [name: string]: string | number | boolean;
  93. };
  94. }
  95. export interface SelenoidOptions {
  96. enableVNC?: boolean;
  97. screenResolution?: string;
  98. enableVideo?: boolean;
  99. videoName?: string;
  100. videoScreenSize?: string;
  101. videoFrameRate?: number;
  102. videoCodec?: string;
  103. enableLog?: boolean;
  104. logName?: string;
  105. name?: string;
  106. sessionTimeout?: string;
  107. timeZone?: string;
  108. env?: string[];
  109. applicationContainers?: string[];
  110. hostsEntries?: string[];
  111. dnsServers?: string[];
  112. additionalNetworks?: string[];
  113. labels?: Map<string, string>;
  114. skin?: string;
  115. s3KeyPattern?: string;
  116. }
  117. export interface Capabilities extends VendorExtensions {
  118. browserName?: string;
  119. browserVersion?: string;
  120. platformName?: string;
  121. acceptInsecureCerts?: boolean;
  122. pageLoadStrategy?: PageLoadingStrategy;
  123. proxy?: ProxyObject;
  124. setWindowRect?: boolean;
  125. timeouts?: Timeouts;
  126. strictFileInteractability?: boolean;
  127. unhandledPromptBehavior?: string;
  128. }
  129. export interface W3CCapabilities {
  130. alwaysMatch: Capabilities;
  131. firstMatch: Capabilities[];
  132. }
  133. export interface DesiredCapabilities extends Capabilities, SauceLabsCapabilities, SauceLabsVisualCapabilities, TestingbotCapabilities, SeleniumRCCapabilities, AppiumIOSCapabilities, GeckodriverCapabilities, IECapabilities, AppiumAndroidCapabilities, AppiumCapabilities, AppiumW3CCapabilities, VendorExtensions, GridCapabilities, ChromeCapabilities, BrowserStackCapabilities {
  134. cssSelectorsEnabled?: boolean;
  135. handlesAlerts?: boolean;
  136. version?: string;
  137. platform?: string;
  138. public?: any;
  139. loggingPrefs?: {
  140. browser?: LoggingPreferences;
  141. driver?: LoggingPreferences;
  142. server?: LoggingPreferences;
  143. client?: LoggingPreferences;
  144. };
  145. javascriptEnabled?: boolean;
  146. databaseEnabled?: boolean;
  147. locationContextEnabled?: boolean;
  148. applicationCacheEnabled?: boolean;
  149. browserConnectionEnabled?: boolean;
  150. webStorageEnabled?: boolean;
  151. acceptSslCerts?: boolean;
  152. rotatable?: boolean;
  153. nativeEvents?: boolean;
  154. unexpectedAlertBehaviour?: string;
  155. elementScrollBehavior?: number;
  156. 'webdriver.remote.sessionid'?: string;
  157. 'webdriver.remote.quietExceptions'?: boolean;
  158. 'selenium.server.url'?: string;
  159. specs?: string[];
  160. exclude?: string[];
  161. excludeDriverLogs?: string[];
  162. }
  163. export interface VendorExtensions extends EdgeCapabilities, AppiumW3CCapabilities {
  164. 'selenoid:options'?: SelenoidOptions;
  165. 'tb:options'?: TestingbotCapabilities;
  166. 'sauce:options'?: SauceLabsCapabilities;
  167. 'sauce:visual'?: SauceLabsVisualCapabilities;
  168. 'bstack:options'?: BrowserStackCapabilities;
  169. 'browserstack.local'?: boolean;
  170. 'goog:chromeOptions'?: ChromeOptions;
  171. 'moz:firefoxOptions'?: FirefoxOptions;
  172. firefox_profile?: string;
  173. 'ms:edgeOptions'?: MicrosoftEdgeOptions;
  174. 'ms:edgeChromium'?: MicrosoftEdgeOptions;
  175. 'safari.options'?: {
  176. [name: string]: any;
  177. };
  178. testobject_api_key?: string;
  179. }
  180. export interface GridCapabilities {
  181. seleniumProtocol?: string;
  182. maxInstances?: number;
  183. environment?: string;
  184. }
  185. export interface EdgeCapabilities {
  186. 'ms:inPrivate'?: boolean;
  187. 'ms:extensionPaths'?: string[];
  188. 'ms:startPage'?: string;
  189. }
  190. export interface ChromeCapabilities {
  191. chrome?: string;
  192. chromeOptions?: ChromeOptions;
  193. mobileEmulationEnabled?: boolean;
  194. }
  195. export interface AppiumCapabilities {
  196. automationName?: string;
  197. platformVersion?: string;
  198. deviceName?: string;
  199. app?: string;
  200. newCommandTimeout?: number;
  201. language?: string;
  202. locale?: string;
  203. udid?: string;
  204. orientation?: string;
  205. autoWebview?: boolean;
  206. noReset?: boolean;
  207. fullReset?: boolean;
  208. eventTimings?: boolean;
  209. enablePerformanceLogging?: boolean;
  210. printPageSourceOnFindFailure?: boolean;
  211. }
  212. export interface AppiumW3CCapabilities {
  213. 'appium:automationName'?: string;
  214. 'appium:platformVersion'?: string;
  215. 'appium:deviceName'?: string;
  216. 'appium:app'?: string;
  217. 'appium:newCommandTimeout'?: number;
  218. 'appium:language'?: string;
  219. 'appium:locale'?: string;
  220. 'appium:udid'?: string;
  221. 'appium:orientation'?: string;
  222. 'appium:autoWebview'?: boolean;
  223. 'appium:noReset'?: boolean;
  224. 'appium:fullReset'?: boolean;
  225. 'appium:eventTimings'?: boolean;
  226. 'appium:enablePerformanceLogging'?: boolean;
  227. 'appium:printPageSourceOnFindFailure'?: boolean;
  228. }
  229. export interface AppiumAndroidCapabilities {
  230. appiumVersion?: string;
  231. appActivity?: string;
  232. appPackage?: string;
  233. appWaitActivity?: string;
  234. appWaitPackage?: string;
  235. appWaitDuration?: number;
  236. deviceReadyTimeout?: number;
  237. allowTestPackages?: boolean;
  238. androidCoverage?: string;
  239. androidCoverageEndIntent?: string;
  240. androidDeviceReadyTimeout?: number;
  241. androidInstallTimeout?: number;
  242. androidInstallPath?: string;
  243. adbPort?: number;
  244. systemPort?: number;
  245. remoteAdbHost?: string;
  246. androidDeviceSocket?: string;
  247. avd?: string;
  248. avdLaunchTimeout?: number;
  249. avdReadyTimeout?: number;
  250. avdArgs?: string;
  251. useKeystore?: boolean;
  252. keystorePath?: string;
  253. keystorePassword?: string;
  254. keyAlias?: string;
  255. keyPassword?: string;
  256. chromedriverExecutable?: string;
  257. chromedriverArgs?: string[];
  258. chromedriverExecutableDir?: string;
  259. chromedriverChromeMappingFile?: string;
  260. chromedriverUseSystemExecutable?: boolean;
  261. autoWebviewTimeout?: number;
  262. chromedriverPort?: number;
  263. chromedriverPorts?: (number | number[])[];
  264. intentAction?: string;
  265. intentCategory?: string;
  266. intentFlags?: string;
  267. optionalIntentArguments?: string;
  268. dontStopAppOnReset?: boolean;
  269. unicodeKeyboard?: boolean;
  270. resetKeyboard?: boolean;
  271. noSign?: boolean;
  272. ignoreUnimportantViews?: boolean;
  273. disableAndroidWatchers?: boolean;
  274. recreateChromeDriverSessions?: boolean;
  275. nativeWebScreenshot?: boolean;
  276. androidScreenshotPath?: string;
  277. autoGrantPermissions?: boolean;
  278. networkSpeed?: string;
  279. gpsEnabled?: boolean;
  280. isHeadless?: boolean;
  281. adbExecTimeout?: number;
  282. localeScript?: string;
  283. skipDeviceInitialization?: boolean;
  284. chromedriverDisableBuildCheck?: boolean;
  285. skipUnlock?: boolean;
  286. unlockType?: string;
  287. unlockKey?: string;
  288. autoLaunch?: boolean;
  289. skipLogcatCapture?: boolean;
  290. uninstallOtherPackages?: string;
  291. disableWindowAnimation?: boolean;
  292. otherApps?: string;
  293. uiautomator2ServerLaunchTimeout?: number;
  294. uiautomator2ServerInstallTimeout?: number;
  295. skipServerInstallation?: boolean;
  296. espressoServerLaunchTimeout?: number;
  297. }
  298. export interface AppiumIOSCapabilities {
  299. calendarFormat?: string;
  300. bundleId?: string;
  301. launchTimeout?: number;
  302. locationServicesEnabled?: boolean;
  303. locationServicesAuthorized?: boolean;
  304. autoAcceptAlerts?: boolean;
  305. autoDismissAlerts?: boolean;
  306. nativeInstrumentsLib?: boolean;
  307. nativeWebTap?: boolean;
  308. safariInitialUrl?: string;
  309. safariAllowPopups?: boolean;
  310. safariIgnoreFraudWarning?: boolean;
  311. safariOpenLinksInBackground?: boolean;
  312. keepKeyChains?: boolean;
  313. localizableStringsDir?: string;
  314. processArguments?: string;
  315. interKeyDelay?: number;
  316. showIOSLog?: boolean;
  317. sendKeyStrategy?: string;
  318. screenshotWaitTimeout?: number;
  319. waitForAppScript?: string;
  320. webviewConnectRetries?: number;
  321. appName?: string;
  322. customSSLCert?: string;
  323. webkitResponseTimeout?: number;
  324. remoteDebugProxy?: string;
  325. enableAsyncExecuteFromHttps?: boolean;
  326. skipLogCapture?: boolean;
  327. webkitDebugProxyPort?: number;
  328. }
  329. export interface IECapabilities {
  330. 'ie.forceCreateProcessApi'?: boolean;
  331. 'ie.browserCommandLineSwitches'?: string;
  332. 'ie.usePerProcessProxy'?: boolean;
  333. 'ie.ensureCleanSession'?: boolean;
  334. 'ie.setProxyByServer'?: boolean;
  335. 'ie.fileUploadDialogTimeout'?: number;
  336. 'ie.edgechromium'?: boolean;
  337. 'ie.edgepath'?: string;
  338. ignoreProtectedModeSettings?: boolean;
  339. ignoreZoomSetting?: boolean;
  340. initialBrowserUrl?: string;
  341. enablePersistentHover?: boolean;
  342. enableElementCacheCleanup?: boolean;
  343. requireWindowFocus?: boolean;
  344. browserAttachTimeout?: number;
  345. logFile?: string;
  346. logLevel?: string;
  347. host?: string;
  348. extractPath?: string;
  349. silent?: string;
  350. killProcessesByName?: boolean;
  351. }
  352. export interface SauceLabsCapabilities {
  353. name?: string;
  354. build?: string | number;
  355. tags?: string[];
  356. 'custom-data'?: any;
  357. tunnelIdentifier?: string;
  358. parentTunnel?: string;
  359. screenResolution?: string;
  360. timeZone?: string;
  361. avoidProxy?: boolean;
  362. public?: string;
  363. prerun?: {
  364. executable: string;
  365. args: string[];
  366. background: boolean;
  367. timeout: number;
  368. };
  369. recordVideo?: boolean;
  370. videoUploadOnPass?: boolean;
  371. recordScreenshots?: boolean;
  372. recordLogs?: boolean;
  373. priority?: number;
  374. extendedDebugging?: boolean;
  375. capturePerformance?: boolean;
  376. seleniumVersion?: string;
  377. chromedriverVersion?: string;
  378. iedriverVersion?: string;
  379. maxDuration?: number;
  380. commandTimeout?: number;
  381. idleTimeout?: number;
  382. }
  383. export interface BrowserStackCapabilities {
  384. browser?: string;
  385. browser_version?: string;
  386. os?: string;
  387. os_version?: string;
  388. osVersion?: string;
  389. projectName?: string;
  390. buildName?: string;
  391. sessionName?: string;
  392. local?: boolean;
  393. debug?: boolean;
  394. networkLogs?: boolean;
  395. seleniumVersion?: string;
  396. ie?: {
  397. noFlash?: boolean;
  398. compatibility?: number;
  399. arch?: string;
  400. driver?: string;
  401. enablePopups?: boolean;
  402. };
  403. userName?: string;
  404. accessKey?: string;
  405. }
  406. export interface SauceLabsVisualCapabilities {
  407. projectName?: string;
  408. apiKey?: string;
  409. viewportSize?: string;
  410. branch?: string;
  411. baseBranch?: string;
  412. diffOptions?: {
  413. structure?: boolean;
  414. layout?: boolean;
  415. style?: boolean;
  416. content?: boolean;
  417. minLayoutPosition?: number;
  418. minLayoutDimension?: number;
  419. };
  420. ignore?: string;
  421. failOnNewStates?: boolean;
  422. alwaysAcceptBaseBranch?: boolean;
  423. disableBranchBaseline?: boolean;
  424. scrollAndStitchScreenshots?: boolean;
  425. disableCORS?: boolean;
  426. }
  427. export interface TestingbotCapabilities {
  428. name?: string;
  429. tags?: string[];
  430. build?: string | number | number;
  431. public?: boolean;
  432. 'tunnel-identifier'?: string;
  433. }
  434. export interface SeleniumRCCapabilities {
  435. commandLineFlags?: string;
  436. executablePath?: string;
  437. timeoutInSeconds?: number;
  438. onlyProxySeleniumTraffic?: boolean;
  439. avoidProxy?: boolean;
  440. proxyEverything?: boolean;
  441. proxyRequired?: boolean;
  442. browserSideLog?: boolean;
  443. optionsSet?: boolean;
  444. singleWindow?: boolean;
  445. dontInjectRegex?: RegExp;
  446. userJSInjection?: boolean;
  447. userExtensions?: string;
  448. }
  449. export interface Options {
  450. protocol?: string;
  451. hostname?: string;
  452. port?: number;
  453. path?: string;
  454. queryParams?: {
  455. [name: string]: string;
  456. };
  457. user?: string;
  458. key?: string;
  459. capabilities?: DesiredCapabilities | W3CCapabilities;
  460. requestedCapabilities?: DesiredCapabilities | W3CCapabilities;
  461. logLevel?: WebDriverLogTypes;
  462. logLevels?: Record<string, WebDriverLogTypes | undefined>;
  463. connectionRetryTimeout?: number;
  464. connectionRetryCount?: number;
  465. headers?: {
  466. [name: string]: string;
  467. };
  468. agent?: {
  469. http: http.Agent;
  470. https: https.Agent;
  471. };
  472. transformRequest?: (requestOptions: got.HTTPSOptions) => got.HTTPSOptions;
  473. transformResponse?: (response: got.Response, requestOptions: got.HTTPSOptions) => got.Response;
  474. directConnectProtocol?: string;
  475. directConnectHost?: string;
  476. directConnectPort?: number;
  477. directConnectPath?: string;
  478. strictSSL?: boolean;
  479. outputDir?: string;
  480. }
  481. export interface JSONWPCommandError extends Error {
  482. code?: string;
  483. statusCode?: string;
  484. statusMessage?: string;
  485. }
  486. export interface SessionFlags {
  487. isW3C: boolean;
  488. isChrome: boolean;
  489. isAndroid: boolean;
  490. isMobile: boolean;
  491. isIOS: boolean;
  492. isSauce: boolean;
  493. isSeleniumStandalone: boolean;
  494. }
  495. export interface BaseClient extends EventEmitter, SessionFlags {
  496. sessionId: string;
  497. capabilities: DesiredCapabilities | W3CCapabilities;
  498. requestedCapabilities: DesiredCapabilities | W3CCapabilities;
  499. options: Options;
  500. }
  501. export interface Client extends BaseClient {
  502. }
  503. export interface ClientAsync extends AsyncClient, BaseClient {
  504. }
  505. declare type AsyncClient = {
  506. [K in keyof Pick<Client, Exclude<keyof Client, keyof BaseClient>>]: (...args: Parameters<Client[K]>) => Promise<ReturnType<Client[K]>>;
  507. };
  508. export interface AttachOptions extends Partial<SessionFlags>, Partial<Options> {
  509. sessionId: string;
  510. capabilities?: DesiredCapabilities;
  511. isW3C?: boolean;
  512. }
  513. // object with no match
  514. interface ProtocolCommandResponse {
  515. [key: string]: any;
  516. }
  517. // webdriver.json
  518. interface SessionReturn extends DesiredCapabilities, ProtocolCommandResponse { }
  519. interface StatusReturn extends ProtocolCommandResponse {
  520. ready?: boolean,
  521. message?: string,
  522. }
  523. type ElementReferenceId = 'element-6066-11e4-a52e-4f735466cecf'
  524. type ElementReference = Record<ElementReferenceId, string>
  525. interface WindowHandle {
  526. handle: string,
  527. type: string
  528. }
  529. interface RectReturn {
  530. x: number,
  531. y: number,
  532. width: number,
  533. height: number
  534. }
  535. // appium.json
  536. interface StringsReturn {
  537. [key: string]: string
  538. }
  539. interface SettingsReturn extends ProtocolCommandResponse {
  540. shouldUseCompactResponses?: boolean,
  541. elementResponseAttributes?: string,
  542. ignoreUnimportantViews?: boolean,
  543. allowInvisibleElements?: boolean,
  544. enableNotificationListener?: boolean,
  545. actionAcknowledgmentTimeout?: number,
  546. keyInjectionDelay?: number,
  547. scrollAcknowledgmentTimeout?: number,
  548. waitForIdleTimeout?: number,
  549. waitForSelectorTimeout?: number,
  550. normalizeTagNames?: boolean,
  551. shutdownOnPowerDisconnect?: boolean,
  552. mjpegServerScreenshotQuality?: number,
  553. mjpegServerFramerate?: number,
  554. screenshotQuality?: number,
  555. mjpegScalingFactor?: number,
  556. }
  557. // generated typings
  558. // webdriver types
  559. interface Client extends BaseClient {
  560. /**
  561. * [webdriver]
  562. * The New Session command creates a new WebDriver session with the endpoint node. If the creation fails, a session not created error is returned.
  563. * https://w3c.github.io/webdriver/#dfn-new-sessions
  564. */
  565. newSession(capabilities: object): SessionReturn;
  566. /**
  567. * [webdriver]
  568. * The Delete Session command closes any top-level browsing contexts associated with the current session, terminates the connection, and finally closes the current session.
  569. * https://w3c.github.io/webdriver/#dfn-delete-session
  570. */
  571. deleteSession(): void;
  572. /**
  573. * [webdriver]
  574. * 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.
  575. * https://w3c.github.io/webdriver/#dfn-status
  576. */
  577. status(): StatusReturn;
  578. /**
  579. * [webdriver]
  580. * The Get Timeouts command gets timeout durations associated with the current session.
  581. * https://w3c.github.io/webdriver/#dfn-get-timeouts
  582. */
  583. getTimeouts(): Timeouts;
  584. /**
  585. * [webdriver]
  586. * 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.
  587. * https://w3c.github.io/webdriver/#dfn-set-timeouts
  588. */
  589. setTimeouts(implicit?: number, pageLoad?: number, script?: number): void;
  590. /**
  591. * [webdriver]
  592. * The Get Current URL command returns the URL of the current top-level browsing context.
  593. * https://w3c.github.io/webdriver/#dfn-get-current-url
  594. */
  595. getUrl(): string;
  596. /**
  597. * [webdriver]
  598. * The navigateTo (go) command is used to cause the user agent to navigate the current top-level browsing context a new location.
  599. * https://w3c.github.io/webdriver/#dfn-navigate-to
  600. */
  601. navigateTo(url: string): string;
  602. /**
  603. * [webdriver]
  604. * 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`.
  605. * https://w3c.github.io/webdriver/#dfn-back
  606. */
  607. back(): void;
  608. /**
  609. * [webdriver]
  610. * The Forward command causes the browser to traverse one step forwards in the joint session history of the current top-level browsing context.
  611. * https://w3c.github.io/webdriver/#dfn-forward
  612. */
  613. forward(): void;
  614. /**
  615. * [webdriver]
  616. * The Refresh command causes the browser to reload the page in current top-level browsing context.
  617. * https://w3c.github.io/webdriver/#dfn-refresh
  618. */
  619. refresh(): void;
  620. /**
  621. * [webdriver]
  622. * The Get Title command returns the document title of the current top-level browsing context, equivalent to calling `document.title`.
  623. * https://w3c.github.io/webdriver/#dfn-get-title
  624. */
  625. getTitle(): string;
  626. /**
  627. * [webdriver]
  628. * 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.
  629. * https://w3c.github.io/webdriver/#dfn-get-window-handle
  630. */
  631. getWindowHandle(): string;
  632. /**
  633. * [webdriver]
  634. * 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.
  635. * https://w3c.github.io/webdriver/#dfn-close-window
  636. */
  637. closeWindow(): void;
  638. /**
  639. * [webdriver]
  640. * 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.
  641. * https://w3c.github.io/webdriver/#dfn-switch-to-window
  642. */
  643. switchToWindow(handle: string): void;
  644. /**
  645. * [webdriver]
  646. * Create a new top-level browsing context.
  647. * https://w3c.github.io/webdriver/#new-window
  648. */
  649. createWindow(type: 'tab' | 'window'): WindowHandle;
  650. /**
  651. * [webdriver]
  652. * 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.
  653. * https://w3c.github.io/webdriver/#dfn-get-window-handles
  654. */
  655. getWindowHandles(): string[];
  656. /**
  657. * [webdriver]
  658. * The Print Page command renders the document to a paginated PDF document.
  659. * https://w3c.github.io/webdriver/#print-page
  660. */
  661. printPage(orientation?: string, scale?: number, background?: boolean, width?: number, height?: number, top?: number, bottom?: number, left?: number, right?: number, shrinkToFit?: boolean, pageRanges?: object[]): string;
  662. /**
  663. * [webdriver]
  664. * 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.
  665. * https://w3c.github.io/webdriver/#dfn-switch-to-frame
  666. */
  667. switchToFrame(id: (number|object|null)): void;
  668. /**
  669. * [webdriver]
  670. * The Switch to Parent Frame command sets the current browsing context for future commands to the parent of the current browsing context.
  671. * https://w3c.github.io/webdriver/#dfn-switch-to-parent-frame
  672. */
  673. switchToParentFrame(): void;
  674. /**
  675. * [webdriver]
  676. * 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.
  677. * https://w3c.github.io/webdriver/#dfn-get-window-rect
  678. */
  679. getWindowRect(): RectReturn;
  680. /**
  681. * [webdriver]
  682. * The Set Window Rect command alters the size and the position of the operating system window corresponding to the current top-level browsing context.
  683. * https://w3c.github.io/webdriver/#dfn-set-window-rect
  684. */
  685. setWindowRect(x: (number|null), y: (number|null), width: (number|null), height: (number|null)): RectReturn;
  686. /**
  687. * [webdriver]
  688. * 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.
  689. * https://w3c.github.io/webdriver/#dfn-maximize-window
  690. */
  691. maximizeWindow(): RectReturn;
  692. /**
  693. * [webdriver]
  694. * 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.
  695. * https://w3c.github.io/webdriver/#dfn-minimize-window
  696. */
  697. minimizeWindow(): RectReturn;
  698. /**
  699. * [webdriver]
  700. * 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.
  701. * https://w3c.github.io/webdriver/#dfn-fullscreen-window
  702. */
  703. fullscreenWindow(): RectReturn;
  704. /**
  705. * [webdriver]
  706. * The Find Element command is used to find an element in the current browsing context that can be used for future commands.
  707. * https://w3c.github.io/webdriver/#dfn-find-element
  708. */
  709. findElement(using: string, value: string): webdriver.elementreference[];
  710. /**
  711. * [webdriver]
  712. * The Find Elements command is used to find elements in the current browsing context that can be used for future commands.
  713. * https://w3c.github.io/webdriver/#dfn-find-elements
  714. */
  715. findElements(using: string, value: string): webdriver.elementreference[];
  716. /**
  717. * [webdriver]
  718. * 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.
  719. * https://w3c.github.io/webdriver/#dfn-find-element-from-element
  720. */
  721. findElementFromElement(elementId: string, using: string, value: string): webdriver.elementreference;
  722. /**
  723. * [webdriver]
  724. * 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.
  725. * https://w3c.github.io/webdriver/#dfn-find-elements-from-element
  726. */
  727. findElementsFromElement(elementId: string, using: string, value: string): webdriver.elementreference[];
  728. /**
  729. * [webdriver]
  730. * Get Active Element returns the active element of the current browsing context’s document element.
  731. * https://w3c.github.io/webdriver/#dfn-get-active-element
  732. */
  733. getActiveElement(): string;
  734. /**
  735. * [webdriver]
  736. * 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.
  737. * https://w3c.github.io/webdriver/#dfn-is-element-selected
  738. */
  739. isElementSelected(elementId: string): boolean;
  740. /**
  741. * [webdriver]
  742. * 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.
  743. * https://w3c.github.io/webdriver/#element-displayedness
  744. */
  745. isElementDisplayed(elementId: string): boolean;
  746. /**
  747. * [webdriver]
  748. * The Get Element Attribute command will return the attribute of a web element.
  749. * https://w3c.github.io/webdriver/#dfn-get-element-attribute
  750. */
  751. getElementAttribute(elementId: string, name: string): string;
  752. /**
  753. * [webdriver]
  754. * The Get Element Property command will return the result of getting a property of an element.
  755. * https://w3c.github.io/webdriver/#dfn-get-element-property
  756. */
  757. getElementProperty(elementId: string, name: string): string;
  758. /**
  759. * [webdriver]
  760. * The Get Element CSS Value command retrieves the computed value of the given CSS property of the given web element.
  761. * https://w3c.github.io/webdriver/#dfn-get-element-css-value
  762. */
  763. getElementCSSValue(elementId: string, propertyName: string): string;
  764. /**
  765. * [webdriver]
  766. * 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.
  767. * https://w3c.github.io/webdriver/#dfn-get-element-text
  768. */
  769. getElementText(elementId: string): string;
  770. /**
  771. * [webdriver]
  772. * The Get Element Tag Name command returns the qualified element name of the given web element.
  773. * https://w3c.github.io/webdriver/#dfn-get-element-tag-name
  774. */
  775. getElementTagName(elementId: string): string;
  776. /**
  777. * [webdriver]
  778. * The Get Element Rect command returns the dimensions and coordinates of the given web element.
  779. * https://w3c.github.io/webdriver/#dfn-get-element-rect
  780. */
  781. getElementRect(elementId: string): RectReturn;
  782. /**
  783. * [webdriver]
  784. * Is Element Enabled determines if the referenced element is enabled or not. This operation only makes sense on form controls.
  785. * https://w3c.github.io/webdriver/#dfn-is-element-enabled
  786. */
  787. isElementEnabled(elementId: string): boolean;
  788. /**
  789. * [webdriver]
  790. * 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.
  791. * https://w3c.github.io/webdriver/#dfn-element-click
  792. */
  793. elementClick(elementId: string): void;
  794. /**
  795. * [webdriver]
  796. * The Element Clear command scrolls into view an editable or resettable element and then attempts to clear its selected files or text content.
  797. * https://w3c.github.io/webdriver/#dfn-element-clear
  798. */
  799. elementClear(elementId: string): void;
  800. /**
  801. * [webdriver]
  802. * 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).
  803. * https://w3c.github.io/webdriver/#dfn-element-send-keys
  804. */
  805. elementSendKeys(elementId: string, text: string): void;
  806. /**
  807. * [webdriver]
  808. * The Get Page Source command returns a string serialization of the DOM of the current browsing context active document.
  809. * https://w3c.github.io/webdriver/#dfn-get-page-source
  810. */
  811. getPageSource(): string;
  812. /**
  813. * [webdriver]
  814. * The Execute Script command executes a JavaScript function in the context of the current browsing context and returns the return value of the function.
  815. * https://w3c.github.io/webdriver/#dfn-execute-script
  816. */
  817. executeScript(script: string, args?: (string|object|number|boolean|undefined)[]): any;
  818. /**
  819. * [webdriver]
  820. * 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.
  821. * https://w3c.github.io/webdriver/#dfn-execute-async-script
  822. */
  823. executeAsyncScript(script: string, args: (string|object|number|boolean|undefined)[]): any;
  824. /**
  825. * [webdriver]
  826. * The Get All Cookies command returns all cookies associated with the address of the current browsing context’s active document.
  827. * https://w3c.github.io/webdriver/#dfn-get-all-cookies
  828. */
  829. getAllCookies(): object[];
  830. /**
  831. * [webdriver]
  832. * The Add Cookie command adds a single cookie to the cookie store associated with the active document's address.
  833. * https://w3c.github.io/webdriver/#dfn-adding-a-cookie
  834. */
  835. addCookie(cookie: object): void;
  836. /**
  837. * [webdriver]
  838. * The Delete All Cookies command allows deletion of all cookies associated with the active document's address.
  839. * https://w3c.github.io/webdriver/#dfn-delete-all-cookies
  840. */
  841. deleteAllCookies(): void;
  842. /**
  843. * [webdriver]
  844. * 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.
  845. * https://w3c.github.io/webdriver/#dfn-get-named-cookie
  846. */
  847. getNamedCookie(name: string): WebDriver.Cookie;
  848. /**
  849. * [webdriver]
  850. * 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.
  851. * https://w3c.github.io/webdriver/#dfn-delete-cookie
  852. */
  853. deleteCookie(name: string): void;
  854. /**
  855. * [webdriver]
  856. * 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.
  857. * https://w3c.github.io/webdriver/#dfn-perform-actions
  858. */
  859. performActions(actions: object[]): void;
  860. /**
  861. * [webdriver]
  862. * 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.
  863. * https://w3c.github.io/webdriver/#dfn-release-actions
  864. */
  865. releaseActions(): void;
  866. /**
  867. * [webdriver]
  868. * 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.
  869. * https://w3c.github.io/webdriver/#dfn-dismiss-alert
  870. */
  871. dismissAlert(): void;
  872. /**
  873. * [webdriver]
  874. * The Accept Alert command accepts a simple dialog if present, otherwise error.
  875. * https://w3c.github.io/webdriver/#dfn-accept-alert
  876. */
  877. acceptAlert(): void;
  878. /**
  879. * [webdriver]
  880. * The Get Alert Text command returns the message of the current user prompt. If there is no current user prompt, it returns an error.
  881. * https://w3c.github.io/webdriver/#dfn-get-alert-text
  882. */
  883. getAlertText(): string;
  884. /**
  885. * [webdriver]
  886. * The Send Alert Text command sets the text field of a window.prompt user prompt to the given value.
  887. * https://w3c.github.io/webdriver/#dfn-send-alert-text
  888. */
  889. sendAlertText(text: string): void;
  890. /**
  891. * [webdriver]
  892. * The Take Screenshot command takes a screenshot of the top-level browsing context's viewport.
  893. * https://w3c.github.io/webdriver/#dfn-take-screenshot
  894. */
  895. takeScreenshot(): string;
  896. /**
  897. * [webdriver]
  898. * The Take Element Screenshot command takes a screenshot of the visible region encompassed by the bounding rectangle of an element.
  899. * https://w3c.github.io/webdriver/#dfn-take-element-screenshot
  900. */
  901. takeElementScreenshot(elementId: string, scroll?: boolean): string;
  902. /**
  903. * [webdriver]
  904. * Get the computed WAI-ARIA role of an element.
  905. * https://w3c.github.io/webdriver/#get-computed-role
  906. */
  907. getElementComputedRole(elementId: string): string;
  908. /**
  909. * [webdriver]
  910. * Get the accessible name of the element.
  911. * https://w3c.github.io/webdriver/#get-computed-label
  912. */
  913. getElementComputedLabel(elementId: string): string;
  914. /**
  915. * [webdriver]
  916. * Simulates user modification of a PermissionDescriptor's permission state. __Note:__ this feature has not landed in all browsers yet.
  917. * https://w3c.github.io/permissions/#set-permission-command
  918. */
  919. setPermissions(descriptor: object, state: string, oneRealm?: boolean): void;
  920. /**
  921. * [webdriver]
  922. * Generates a report for testing. Extension for [Reporting API](https://developers.google.com/web/updates/2018/09/reportingapi). __Note:__ this feature has not landed in all browsers yet.
  923. * https://w3c.github.io/reporting/#automation
  924. */
  925. generateTestReport(message: string, group: string): void;
  926. /**
  927. * [webdriver]
  928. * Creates a mock sensor to emulate sensors like Ambient Light Sensor. __Note:__ this feature has not landed in all browsers yet.
  929. * https://w3c.github.io/sensors/#create-mock-sensor-command
  930. */
  931. createMockSensor(mockSensorType: string, maxSamplingFrequency: number, minSamplingFrequency: number): void;
  932. /**
  933. * [webdriver]
  934. * Retrieves information about a given type of mock sensor. __Note:__ this feature has not landed in all browsers yet.
  935. * https://w3c.github.io/sensors/#get-mock-sensor-command
  936. */
  937. getMockSensor(type: string): ProtocolCommandResponse;
  938. /**
  939. * [webdriver]
  940. * Updates the mock sensor type. __Note:__ this feature has not landed in all browsers yet.
  941. * https://w3c.github.io/sensors/#update-mock-sensor-reading-command
  942. */
  943. updateMockSensor(type: string, mockSensorType: string, maxSamplingFrequency: number, minSamplingFrequency: number): void;
  944. /**
  945. * [webdriver]
  946. * The Delete Session command closes any top-level browsing contexts associated with the current session, terminates the connection, and finally closes the current session. __Note:__ this feature has not landed in all browsers yet.
  947. * https://w3c.github.io/sensors/#delete-mock-sensor-command
  948. */
  949. deleteMockSensor(type: string): void;
  950. /**
  951. * [webdriver]
  952. * Simulates the changing of a time zone for the purposes of testing. __Note:__ this feature has not landed in all browsers yet.
  953. * https://w3c.github.io/sensors/#create-mock-sensor-command
  954. */
  955. setTimeZone(time_zone: string): void;
  956. /**
  957. * [webdriver]
  958. * Creates a software [Virtual Authenticator](https://www.w3.org/TR/webauthn-2/#virtual-authenticators).
  959. * https://www.w3.org/TR/webauthn-2/#sctn-automation-add-virtual-authenticator
  960. */
  961. addVirtualAuthenticator(protocol?: string, transport?: string, hasResidentKey?: boolean, hasUserVerification?: boolean, isUserConsenting?: boolean, isUserVerified?: boolean, extensions?: object[], uvm?: object[]): void;
  962. /**
  963. * [webdriver]
  964. * Removes a previously created Virtual Authenticator.
  965. * https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-virtual-authenticator
  966. */
  967. removeVirtualAuthenticator(authenticatorId: string): void;
  968. /**
  969. * [webdriver]
  970. * Injects a Public Key Credential Source into an existing Virtual Authenticator.
  971. * https://www.w3.org/TR/webauthn-2/#sctn-automation-add-credential
  972. */
  973. addCredential(credentialId: string, isResidentCredential: boolean, rpId: string, privateKey: string, userHandle: string, signCount: number, largeBlob: string): void;
  974. /**
  975. * [webdriver]
  976. * Returns one Credential Parameters object for every Public Key Credential Source stored in a Virtual Authenticator, regardless of whether they were stored using Add Credential or `navigator.credentials.create()`.
  977. * https://www.w3.org/TR/webauthn-2/#sctn-automation-get-credentials
  978. */
  979. getCredentials(authenticatorId: string): void;
  980. /**
  981. * [webdriver]
  982. * Removes all Public Key Credential Sources stored on a Virtual Authenticator.
  983. * https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-all-credentials
  984. */
  985. removeAllCredentials(authenticatorId: string): void;
  986. /**
  987. * [webdriver]
  988. * Removes a Public Key Credential Source stored on a Virtual Authenticator.
  989. * https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-credential
  990. */
  991. removeCredential(authenticatorId: string, credentialId: string): void;
  992. /**
  993. * [webdriver]
  994. * The Set User Verified extension command sets the isUserVerified property on the Virtual Authenticator.
  995. * https://www.w3.org/TR/webauthn-2/#sctn-automation-set-user-verified
  996. */
  997. setUserVerified(authenticatorId: string, credentialId: string): void;
  998. }
  999. // appium types
  1000. interface Client extends BaseClient {
  1001. /**
  1002. * [appium]
  1003. * Perform a shake action on the device.
  1004. * http://appium.io/docs/en/commands/device/interactions/shake/
  1005. */
  1006. shake(): void;
  1007. /**
  1008. * [appium]
  1009. * Lock the device.
  1010. * http://appium.io/docs/en/commands/device/interactions/lock/
  1011. */
  1012. lock(seconds?: number): void;
  1013. /**
  1014. * [appium]
  1015. * Unlock the device.
  1016. * http://appium.io/docs/en/commands/device/interactions/unlock/
  1017. */
  1018. unlock(): void;
  1019. /**
  1020. * [appium]
  1021. * Check whether the device is locked or not.
  1022. * http://appium.io/docs/en/commands/device/interactions/is-locked/
  1023. */
  1024. isLocked(): boolean;
  1025. /**
  1026. * [appium]
  1027. * Start recording the screen.
  1028. * http://appium.io/docs/en/commands/device/recording-screen/start-recording-screen/
  1029. */
  1030. startRecordingScreen(options?: object): void;
  1031. /**
  1032. * [appium]
  1033. * Stop recording screen
  1034. * http://appium.io/docs/en/commands/device/recording-screen/stop-recording-screen/
  1035. */
  1036. stopRecordingScreen(remotePath?: string, username?: string, password?: string, method?: string): string;
  1037. /**
  1038. * [appium]
  1039. * Returns the information types of the system state which is supported to read as like cpu, memory, network traffic, and battery.
  1040. * http://appium.io/docs/en/commands/device/performance-data/performance-data-types/
  1041. */
  1042. getPerformanceDataTypes(): string[];
  1043. /**
  1044. * [appium]
  1045. * Returns the information of the system state which is supported to read as like cpu, memory, network traffic, and battery.
  1046. * http://appium.io/docs/en/commands/device/performance-data/get-performance-data/
  1047. */
  1048. getPerformanceData(packageName: string, dataType: string, dataReadTimeout?: number): string[];
  1049. /**
  1050. * [appium]
  1051. * Press a particular key on the device.
  1052. * http://appium.io/docs/en/commands/device/keys/press-keycode/
  1053. */
  1054. pressKeyCode(keycode: number, metastate?: number, flags?: number): void;
  1055. /**
  1056. * [appium]
  1057. * Press and hold a particular key code on the device.
  1058. * http://appium.io/docs/en/commands/device/keys/long-press-keycode/
  1059. */
  1060. longPressKeyCode(keycode: number, metastate?: number, flags?: number): void;
  1061. /**
  1062. * [appium]
  1063. * Send a key code to the device.
  1064. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints
  1065. */
  1066. sendKeyEvent(keycode: string, metastate?: string): void;
  1067. /**
  1068. * [appium]
  1069. * Rotate the device in three dimensions.
  1070. * http://appium.io/docs/en/commands/device/interactions/rotate/
  1071. */
  1072. rotateDevice(x: number, y: number, radius: number, rotation: number, touchCount: number, duration: number, element?: string): void;
  1073. /**
  1074. * [appium]
  1075. * Get the name of the current Android activity.
  1076. * http://appium.io/docs/en/commands/device/activity/current-activity/
  1077. */
  1078. getCurrentActivity(): string;
  1079. /**
  1080. * [appium]
  1081. * Get the name of the current Android package.
  1082. * http://appium.io/docs/en/commands/device/activity/current-package/
  1083. */
  1084. getCurrentPackage(): string;
  1085. /**
  1086. * [appium]
  1087. * Install the given app onto the device.
  1088. * http://appium.io/docs/en/commands/device/app/install-app/
  1089. */
  1090. installApp(appPath: string): void;
  1091. /**
  1092. * [appium]
  1093. * Activate the given app onto the device
  1094. * http://appium.io/docs/en/commands/device/app/activate-app/
  1095. */
  1096. activateApp(appId?: string, bundleId?: string): void;
  1097. /**
  1098. * [appium]
  1099. * Remove an app from the device.
  1100. * http://appium.io/docs/en/commands/device/app/remove-app/
  1101. */
  1102. removeApp(appId?: string, bundleId?: string): void;
  1103. /**
  1104. * [appium]
  1105. * Terminate the given app on the device
  1106. * http://appium.io/docs/en/commands/device/app/terminate-app/
  1107. */
  1108. terminateApp(appId?: string, bundleId?: string): void;
  1109. /**
  1110. * [appium]
  1111. * Check whether the specified app is installed on the device.
  1112. * http://appium.io/docs/en/commands/device/app/is-app-installed/
  1113. */
  1114. isAppInstalled(appId?: string, bundleId?: string): boolean;
  1115. /**
  1116. * [appium]
  1117. * Get the given app status on the device
  1118. * http://appium.io/docs/en/commands/device/app/app-state/
  1119. */
  1120. queryAppState(appId?: string, bundleId?: string): number;
  1121. /**
  1122. * [appium]
  1123. * Hide soft keyboard.
  1124. * http://appium.io/docs/en/commands/device/keys/hide-keyboard/
  1125. */
  1126. hideKeyboard(strategy?: string, key?: string, keyCode?: string, keyName?: string): void;
  1127. /**
  1128. * [appium]
  1129. * Whether or not the soft keyboard is shown.
  1130. * http://appium.io/docs/en/commands/device/keys/is-keyboard-shown/
  1131. */
  1132. isKeyboardShown(): boolean;
  1133. /**
  1134. * [appium]
  1135. * Place a file onto the device in a particular place.
  1136. * http://appium.io/docs/en/commands/device/files/push-file/
  1137. */
  1138. pushFile(path: string, data: string): void;
  1139. /**
  1140. * [appium]
  1141. * Retrieve a file from the device's file system.
  1142. * http://appium.io/docs/en/commands/device/files/pull-file/
  1143. */
  1144. pullFile(path: string): void;
  1145. /**
  1146. * [appium]
  1147. * Retrieve a folder from the device's file system.
  1148. * http://appium.io/docs/en/commands/device/files/pull-folder/
  1149. */
  1150. pullFolder(path: string): void;
  1151. /**
  1152. * [appium]
  1153. * Toggle airplane mode on device.
  1154. * http://appium.io/docs/en/commands/device/network/toggle-airplane-mode/
  1155. */
  1156. toggleAirplaneMode(): void;
  1157. /**
  1158. * [appium]
  1159. * Switch the state of data service.
  1160. * http://appium.io/docs/en/commands/device/network/toggle-data/
  1161. */
  1162. toggleData(): void;
  1163. /**
  1164. * [appium]
  1165. * Switch the state of the wifi service.
  1166. * http://appium.io/docs/en/commands/device/network/toggle-wifi/
  1167. */
  1168. toggleWiFi(): void;
  1169. /**
  1170. * [appium]
  1171. * Switch the state of the location service.
  1172. * http://appium.io/docs/en/commands/device/network/toggle-location-services/
  1173. */
  1174. toggleLocationServices(): void;
  1175. /**
  1176. * [appium]
  1177. * Set network speed (Emulator only)
  1178. * http://appium.io/docs/en/commands/device/network/network-speed/
  1179. */
  1180. toggleNetworkSpeed(): void;
  1181. /**
  1182. * [appium]
  1183. * Open Android notifications (Emulator only).
  1184. * http://appium.io/docs/en/commands/device/system/open-notifications/
  1185. */
  1186. openNotifications(): void;
  1187. /**
  1188. * [appium]
  1189. * Start an Android activity by providing package name and activity name.
  1190. * http://appium.io/docs/en/commands/device/activity/start-activity/
  1191. */
  1192. startActivity(appPackage: string, appActivity: string, appWaitPackage?: string, appWaitActivity?: string, intentAction?: string, intentCategory?: string, intentFlags?: string, optionalIntentArguments?: string, dontStopAppOnReset?: string): void;
  1193. /**
  1194. * [appium]
  1195. * Retrieve visibility and bounds information of the status and navigation bars.
  1196. * http://appium.io/docs/en/commands/device/system/system-bars/
  1197. */
  1198. getSystemBars(): object[];
  1199. /**
  1200. * [appium]
  1201. * Get the time on the device.
  1202. * http://appium.io/docs/en/commands/device/system/system-time/
  1203. */
  1204. getDeviceTime(): string;
  1205. /**
  1206. * [appium]
  1207. * Get display density from device.
  1208. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints
  1209. */
  1210. getDisplayDensity(): any;
  1211. /**
  1212. * [appium]
  1213. * 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.
  1214. * http://appium.io/docs/en/commands/device/simulator/touch-id/
  1215. */
  1216. touchId(match: boolean): void;
  1217. /**
  1218. * [appium]
  1219. * 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.
  1220. * http://appium.io/docs/en/commands/device/simulator/toggle-touch-id-enrollment/
  1221. */
  1222. toggleEnrollTouchId(enabled?: boolean): void;
  1223. /**
  1224. * [appium]
  1225. * 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).
  1226. * http://appium.io/docs/en/commands/device/app/launch-app/
  1227. */
  1228. launchApp(): void;
  1229. /**
  1230. * [appium]
  1231. * Close an app on device.
  1232. * http://appium.io/docs/en/commands/device/app/close-app/
  1233. */
  1234. closeApp(): void;
  1235. /**
  1236. * [appium]
  1237. * Reset the currently running app for this session.
  1238. * http://appium.io/docs/en/commands/device/app/reset-app/
  1239. */
  1240. reset(): void;
  1241. /**
  1242. * [appium]
  1243. * 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)).
  1244. * http://appium.io/docs/en/commands/device/app/background-app/
  1245. */
  1246. background(seconds: (number|null)): void;
  1247. /**
  1248. * [appium]
  1249. * Get test coverage data.
  1250. * http://appium.io/docs/en/commands/device/app/end-test-coverage/
  1251. */
  1252. endCoverage(intent: string, path: string): void;
  1253. /**
  1254. * [appium]
  1255. * Get app strings.
  1256. * http://appium.io/docs/en/commands/device/app/get-app-strings/
  1257. */
  1258. getStrings(language?: string, stringFile?: string): StringsReturn;
  1259. /**
  1260. * [appium]
  1261. *
  1262. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints
  1263. */
  1264. setValueImmediate(elementId: string, value: string): void;
  1265. /**
  1266. * [appium]
  1267. * Replace the value to element directly.
  1268. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints
  1269. */
  1270. replaceValue(elementId: string, value: string): void;
  1271. /**
  1272. * [appium]
  1273. * Retrieve the current settings on the device.
  1274. * http://appium.io/docs/en/commands/session/settings/get-settings/
  1275. */
  1276. getSettings(): SettingsReturn;
  1277. /**
  1278. * [appium]
  1279. * Update the current setting on the device.
  1280. * http://appium.io/docs/en/commands/session/settings/update-settings/
  1281. */
  1282. updateSettings(settings: object): void;
  1283. /**
  1284. * [appium]
  1285. * Callback url for asynchronous execution of JavaScript.
  1286. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#appium-extension-endpoints
  1287. */
  1288. receiveAsyncResponse(response: object): void;
  1289. /**
  1290. * [appium]
  1291. * Make GSM call (Emulator only).
  1292. * http://appium.io/docs/en/commands/device/network/gsm-call/
  1293. */
  1294. gsmCall(phoneNumber: string, action: string): void;
  1295. /**
  1296. * [appium]
  1297. * Set GSM signal strength (Emulator only).
  1298. * http://appium.io/docs/en/commands/device/network/gsm-signal/
  1299. */
  1300. gsmSignal(signalStrength: string, signalStrengh?: string): void;
  1301. /**
  1302. * [appium]
  1303. * Set the battery percentage (Emulator only).
  1304. * http://appium.io/docs/en/commands/device/emulator/power_capacity/
  1305. */
  1306. powerCapacity(percent: number): void;
  1307. /**
  1308. * [appium]
  1309. * Set the state of the battery charger to connected or not (Emulator only).
  1310. * http://appium.io/docs/en/commands/device/emulator/power_ac/
  1311. */
  1312. powerAC(state: string): void;
  1313. /**
  1314. * [appium]
  1315. * Set GSM voice state (Emulator only).
  1316. * http://appium.io/docs/en/commands/device/network/gsm-voice/
  1317. */
  1318. gsmVoice(state: string): void;
  1319. /**
  1320. * [appium]
  1321. * Simulate an SMS message (Emulator only).
  1322. * http://appium.io/docs/en/commands/device/network/send-sms/
  1323. */
  1324. sendSms(phoneNumber: string, message: string): void;
  1325. /**
  1326. * [appium]
  1327. * Authenticate users by using their finger print scans on supported emulators.
  1328. * http://appium.io/docs/en/commands/device/authentication/finger-print/
  1329. */
  1330. fingerPrint(fingerprintId: number): void;
  1331. /**
  1332. * [appium]
  1333. * Set the content of the system clipboard
  1334. * http://appium.io/docs/en/commands/device/clipboard/set-clipboard/
  1335. */
  1336. setClipboard(content: string, contentType?: string, label?: string): string;
  1337. /**
  1338. * [appium]
  1339. * Get the content of the system clipboard
  1340. * http://appium.io/docs/en/commands/device/clipboard/get-clipboard/
  1341. */
  1342. getClipboard(contentType?: string): string;
  1343. /**
  1344. * [appium]
  1345. * 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.
  1346. * http://appium.io/docs/en/commands/interactions/touch/touch-perform/
  1347. */
  1348. touchPerform(actions: object[]): void;
  1349. /**
  1350. * [appium]
  1351. * This functionality is only available from within a native context. Perform a multi touch action sequence.
  1352. * http://appium.io/docs/en/commands/interactions/touch/multi-touch-perform/
  1353. */
  1354. multiTouchPerform(actions: object[]): void;
  1355. /**
  1356. * [appium]
  1357. * 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.
  1358. * https://github.com/appium/appium/blob/master/docs/en/commands/session/execute-driver.md
  1359. */
  1360. driverScript(script: string, type?: string, timeout?: number): ProtocolCommandResponse;
  1361. /**
  1362. * [appium]
  1363. * Get events stored in appium server.
  1364. * https://github.com/appium/appium/blob/master/docs/en/commands/session/events/get-events.md
  1365. */
  1366. getEvents(type: string[]): ProtocolCommandResponse;
  1367. /**
  1368. * [appium]
  1369. * Store a custom event.
  1370. * https://github.com/appium/appium/blob/master/docs/en/commands/session/events/log-event.md
  1371. */
  1372. logEvent(vendor: string, event: string): void;
  1373. /**
  1374. * [appium]
  1375. * 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.
  1376. * http://appium.io/docs/en/writing-running-appium/image-comparison/
  1377. */
  1378. compareImages(mode: string, firstImage: string, secondImage: string, options: object): ProtocolCommandResponse;
  1379. }
  1380. // jsonwp types
  1381. interface Client extends BaseClient {
  1382. /**
  1383. * [jsonwp]
  1384. * 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.
  1385. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#status
  1386. */
  1387. status(): StatusReturn;
  1388. /**
  1389. * [jsonwp]
  1390. * 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.
  1391. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#session-1
  1392. */
  1393. newSession(desiredCapabilities: object, requiredCapabilities: object): SessionReturn;
  1394. /**
  1395. * [jsonwp]
  1396. * Returns a list of the currently active sessions. Each session will be returned as a list of JSON objects containing `id` and `capabilities`.
  1397. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessions
  1398. */
  1399. getSessions(): object[];
  1400. /**
  1401. * [jsonwp]
  1402. * Retrieve the capabilities of the specified session.
  1403. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionid
  1404. */
  1405. getSession(): ProtocolCommandResponse;
  1406. /**
  1407. * [jsonwp]
  1408. * Delete the session.
  1409. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionid
  1410. */
  1411. deleteSession(): void;
  1412. /**
  1413. * [jsonwp]
  1414. * 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.
  1415. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtimeouts
  1416. */
  1417. setTimeouts(type: string, ms: number): void;
  1418. /**
  1419. * [jsonwp]
  1420. * 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.
  1421. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtimeoutsasync_script
  1422. */
  1423. setAsyncTimeout(ms: number): void;
  1424. /**
  1425. * [jsonwp]
  1426. * 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.
  1427. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtimeoutsimplicit_wait
  1428. */
  1429. setImplicitTimeout(ms: number): void;
  1430. /**
  1431. * [jsonwp]
  1432. * Retrieve the URL of the current page.
  1433. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidurl
  1434. */
  1435. getUrl(): string;
  1436. /**
  1437. * [jsonwp]
  1438. * Navigate to a new URL.
  1439. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidurl
  1440. */
  1441. navigateTo(url: string): void;
  1442. /**
  1443. * [jsonwp]
  1444. * Navigate backwards in the browser history, if possible.
  1445. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidback
  1446. */
  1447. back(): void;
  1448. /**
  1449. * [jsonwp]
  1450. * Navigate forwards in the browser history, if possible.
  1451. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidforward
  1452. */
  1453. forward(): void;
  1454. /**
  1455. * [jsonwp]
  1456. * Refresh the current page.
  1457. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidrefresh
  1458. */
  1459. refresh(): void;
  1460. /**
  1461. * [jsonwp]
  1462. * Get the current page title.
  1463. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtitle
  1464. */
  1465. getTitle(): string;
  1466. /**
  1467. * [jsonwp]
  1468. * Retrieve the current window handle.
  1469. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidwindow_handle
  1470. */
  1471. getWindowHandle(): string;
  1472. /**
  1473. * [jsonwp]
  1474. * Retrieve the list of all window handles available to the session.
  1475. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidwindow_handles
  1476. */
  1477. getWindowHandles(): string[];
  1478. /**
  1479. * [jsonwp]
  1480. * Close the current window.
  1481. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidwindow
  1482. */
  1483. closeWindow(): void;
  1484. /**
  1485. * [jsonwp]
  1486. * 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.
  1487. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidwindow
  1488. */
  1489. switchToWindow(name: string): void;
  1490. /**
  1491. * [jsonwp]
  1492. * Change focus to another frame on the page. If the frame `id` is `null`, the server should switch to the page's default content.
  1493. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidframe
  1494. */
  1495. switchToFrame(id: (string|number|object|null)): void;
  1496. /**
  1497. * [jsonwp]
  1498. * Change focus to the parent context. If the current context is the top level browsing context, the context remains unchanged.
  1499. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidframeparent
  1500. */
  1501. switchToParentFrame(): void;
  1502. /**
  1503. * [jsonwp]
  1504. * Get the position of the current focussed window.
  1505. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidwindowwindowhandleposition
  1506. */
  1507. getWindowPosition(): ProtocolCommandResponse;
  1508. /**
  1509. * [jsonwp]
  1510. * Change the position of the current focussed window.
  1511. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidwindowwindowhandleposition
  1512. */
  1513. setWindowPosition(x: number, y: number): ProtocolCommandResponse;
  1514. /**
  1515. * [jsonwp]
  1516. * Get the size of the current focused window.
  1517. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidwindowwindowhandlesize
  1518. */
  1519. _getWindowSize(): ProtocolCommandResponse;
  1520. /**
  1521. * [jsonwp]
  1522. * Change the size of the current focused window.
  1523. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidwindowwindowhandlesize
  1524. */
  1525. _setWindowSize(width: number, height: number): void;
  1526. /**
  1527. * [jsonwp]
  1528. * Maximize the current focused window if not already maximized.
  1529. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidwindowwindowhandlemaximize
  1530. */
  1531. maximizeWindow(): void;
  1532. /**
  1533. * [jsonwp]
  1534. * 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.
  1535. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelement
  1536. */
  1537. findElement(using: string, value: string): string;
  1538. /**
  1539. * [jsonwp]
  1540. * 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.
  1541. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelements
  1542. */
  1543. findElements(using: string, value: string): string[];
  1544. /**
  1545. * [jsonwp]
  1546. * 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.
  1547. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidelement
  1548. */
  1549. findElementFromElement(elementId: string, using: string, value: string): string;
  1550. /**
  1551. * [jsonwp]
  1552. * 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.
  1553. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidelements
  1554. */
  1555. findElementsFromElement(elementId: string, using: string, value: string): string[];
  1556. /**
  1557. * [jsonwp]
  1558. * Get the element on the page that currently has focus. The element will be returned as a WebElement JSON object.
  1559. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementactive
  1560. */
  1561. getActiveElement(): string;
  1562. /**
  1563. * [jsonwp]
  1564. * Determine if an `OPTION` element, or an `INPUT` element of type `checkbox` or `radiobutton` is currently selected.
  1565. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidselected
  1566. */
  1567. isElementSelected(elementId: string): boolean;
  1568. /**
  1569. * [jsonwp]
  1570. * Determine if an element is currently displayed.
  1571. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementiddisplayed
  1572. */
  1573. isElementDisplayed(elementId: string): boolean;
  1574. /**
  1575. * [jsonwp]
  1576. * Get the value of an element's attribute.
  1577. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidattributename
  1578. */
  1579. getElementAttribute(elementId: string, name: string): string|null;
  1580. /**
  1581. * [jsonwp]
  1582. * 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`).
  1583. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidcsspropertyname
  1584. */
  1585. getElementCSSValue(elementId: string, propertyName: string): string;
  1586. /**
  1587. * [jsonwp]
  1588. * Returns the visible text for the element.
  1589. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidtext
  1590. */
  1591. getElementText(elementId: string): string;
  1592. /**
  1593. * [jsonwp]
  1594. * Query for an element's tag name.
  1595. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidname
  1596. */
  1597. getElementTagName(elementId: string): string;
  1598. /**
  1599. * [jsonwp]
  1600. * 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.
  1601. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidlocation
  1602. */
  1603. getElementLocation(elementId: string): ProtocolCommandResponse;
  1604. /**
  1605. * [jsonwp]
  1606. * 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.
  1607. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidlocation_in_view
  1608. */
  1609. getElementLocationInView(elementId: string): ProtocolCommandResponse;
  1610. /**
  1611. * [jsonwp]
  1612. * Determine an element's size in pixels. The size will be returned as a JSON object with `width` and `height` properties.
  1613. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidsize
  1614. */
  1615. getElementSize(elementId: string): ProtocolCommandResponse;
  1616. /**
  1617. * [jsonwp]
  1618. * Determine if an element is currently enabled.
  1619. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidenabled
  1620. */
  1621. isElementEnabled(elementId: string): boolean;
  1622. /**
  1623. * [jsonwp]
  1624. * 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).
  1625. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidclick
  1626. */
  1627. elementClick(elementId: string): void;
  1628. /**
  1629. * [jsonwp]
  1630. * Compare elements with each other.
  1631. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidequalsother
  1632. */
  1633. elementEquals(elementId: string, otherElementId: string): boolean;
  1634. /**
  1635. * [jsonwp]
  1636. *
  1637. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidsubmit
  1638. */
  1639. elementSubmit(elementId: string): void;
  1640. /**
  1641. * [jsonwp]
  1642. *
  1643. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidclear
  1644. */
  1645. elementClear(elementId: string): void;
  1646. /**
  1647. * [jsonwp]
  1648. *
  1649. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidvalue
  1650. */
  1651. elementSendKeys(elementId: string, value: string[]): void;
  1652. /**
  1653. * [jsonwp]
  1654. *
  1655. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidkeys
  1656. */
  1657. sendKeys(value: string[]): void;
  1658. /**
  1659. * [jsonwp]
  1660. *
  1661. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidsource
  1662. */
  1663. getPageSource(): string;
  1664. /**
  1665. * [jsonwp]
  1666. *
  1667. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidexecute
  1668. */
  1669. executeScript(script: string, args?: (string|object|number|boolean|undefined)[]): any;
  1670. /**
  1671. * [jsonwp]
  1672. *
  1673. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidexecute_async
  1674. */
  1675. executeAsyncScript(script: string, args: (string|object|number|boolean|undefined)[]): any;
  1676. /**
  1677. * [jsonwp]
  1678. *
  1679. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidcookie
  1680. */
  1681. getAllCookies(): object[];
  1682. /**
  1683. * [jsonwp]
  1684. *
  1685. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidcookie
  1686. */
  1687. addCookie(cookie: object): void;
  1688. /**
  1689. * [jsonwp]
  1690. *
  1691. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidcookie
  1692. */
  1693. deleteAllCookies(): void;
  1694. /**
  1695. * [jsonwp]
  1696. *
  1697. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidcookiename
  1698. */
  1699. deleteCookie(name: string): void;
  1700. /**
  1701. * [jsonwp]
  1702. *
  1703. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessioniddismiss_alert
  1704. */
  1705. dismissAlert(): void;
  1706. /**
  1707. * [jsonwp]
  1708. *
  1709. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidaccept_alert
  1710. */
  1711. acceptAlert(): void;
  1712. /**
  1713. * [jsonwp]
  1714. *
  1715. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidalert_text
  1716. */
  1717. getAlertText(): string;
  1718. /**
  1719. * [jsonwp]
  1720. *
  1721. * https://w3c.github.io/webdriver/webdriver-spec.html#dfn-send-alert-text
  1722. */
  1723. sendAlertText(text: string): void;
  1724. /**
  1725. * [jsonwp]
  1726. *
  1727. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidscreenshot
  1728. */
  1729. takeScreenshot(): string;
  1730. /**
  1731. * [jsonwp]
  1732. *
  1733. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidimeavailable_engines
  1734. */
  1735. getAvailableEngines(): string[];
  1736. /**
  1737. * [jsonwp]
  1738. *
  1739. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidimeactive_engine
  1740. */
  1741. getActiveEngine(): string;
  1742. /**
  1743. * [jsonwp]
  1744. *
  1745. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidimeactivated
  1746. */
  1747. isIMEActivated(): boolean;
  1748. /**
  1749. * [jsonwp]
  1750. *
  1751. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidimedeactivate
  1752. */
  1753. deactivateIME(): void;
  1754. /**
  1755. * [jsonwp]
  1756. *
  1757. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidimeactivate
  1758. */
  1759. activateIME(engine: string): void;
  1760. /**
  1761. * [jsonwp]
  1762. *
  1763. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidorientation
  1764. */
  1765. getOrientation(): string;
  1766. /**
  1767. * [jsonwp]
  1768. *
  1769. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidorientation
  1770. */
  1771. setOrientation(orientation: string): void;
  1772. /**
  1773. * [jsonwp]
  1774. *
  1775. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidmoveto
  1776. */
  1777. moveToElement(element?: (string|null), xoffset?: number, yoffset?: number): void;
  1778. /**
  1779. * [jsonwp]
  1780. * 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.
  1781. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidbuttondown
  1782. */
  1783. buttonDown(button?: number): void;
  1784. /**
  1785. * [jsonwp]
  1786. * 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.
  1787. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidbuttonup
  1788. */
  1789. buttonUp(button?: number): void;
  1790. /**
  1791. * [jsonwp]
  1792. * Clicks at the current mouse coordinates (set by moveto).
  1793. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidclick
  1794. */
  1795. positionClick(button?: number): void;
  1796. /**
  1797. * [jsonwp]
  1798. * Double-clicks at the current mouse coordinates (set by moveto).
  1799. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessioniddoubleclick
  1800. */
  1801. positionDoubleClick(): void;
  1802. /**
  1803. * [jsonwp]
  1804. * Single tap on the touch enabled device.
  1805. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchclick
  1806. */
  1807. touchClick(element: string): void;
  1808. /**
  1809. * [jsonwp]
  1810. * Finger down on the screen.
  1811. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchdown
  1812. */
  1813. touchDown(x: number, y: number): void;
  1814. /**
  1815. * [jsonwp]
  1816. * Finger up on the screen.
  1817. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchup
  1818. */
  1819. touchUp(x: number, y: number): void;
  1820. /**
  1821. * [jsonwp]
  1822. * Finger move on the screen.
  1823. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchmove
  1824. */
  1825. touchMove(x: number, y: number): void;
  1826. /**
  1827. * [jsonwp]
  1828. * Finger move on the screen.
  1829. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchscroll
  1830. */
  1831. touchScroll(xoffset: number, yoffset: number, element?: string): void;
  1832. /**
  1833. * [jsonwp]
  1834. * Double tap on the touch screen using finger motion events.
  1835. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchdoubleclick
  1836. */
  1837. touchDoubleClick(element: string): void;
  1838. /**
  1839. * [jsonwp]
  1840. * Long press on the touch screen using finger motion events.
  1841. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchlongclick
  1842. */
  1843. touchLongClick(element: string): void;
  1844. /**
  1845. * [jsonwp]
  1846. * Flick on the touch screen using finger motion events. This flickcommand starts at a particulat screen location.
  1847. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidtouchflick
  1848. */
  1849. touchFlick(xoffset?: number, yoffset?: number, element?: string, speed?: number, xspeed?: number, yspeed?: number): void;
  1850. /**
  1851. * [jsonwp]
  1852. * Get the current geo location.
  1853. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidlocation
  1854. */
  1855. getGeoLocation(): ProtocolCommandResponse;
  1856. /**
  1857. * [jsonwp]
  1858. * Set the current geo location.
  1859. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidlocation
  1860. */
  1861. setGeoLocation(location: object): void;
  1862. /**
  1863. * [jsonwp]
  1864. * Get all keys of the storage.
  1865. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidlocal_storage
  1866. */
  1867. getLocalStorage(): string[];
  1868. /**
  1869. * [jsonwp]
  1870. * Set the storage item for the given key.
  1871. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidlocal_storage
  1872. */
  1873. setLocalStorage(key: string, value: string): void;
  1874. /**
  1875. * [jsonwp]
  1876. * Clear the storage.
  1877. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidlocal_storage
  1878. */
  1879. clearLocalStorage(): void;
  1880. /**
  1881. * [jsonwp]
  1882. * Get the storage item for the given key.
  1883. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidlocal_storagekeykey
  1884. */
  1885. getLocalStorageItem(key: string): string;
  1886. /**
  1887. * [jsonwp]
  1888. *
  1889. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidlocal_storagekeykey
  1890. */
  1891. deleteLocalStorageItem(key: string): void;
  1892. /**
  1893. * [jsonwp]
  1894. * Get the number of items in the storage.
  1895. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlocal_storagesize
  1896. */
  1897. getLocalStorageSize(): number;
  1898. /**
  1899. * [jsonwp]
  1900. * Get all keys of the storage.
  1901. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidsession_storage
  1902. */
  1903. getSessionStorage(): string[];
  1904. /**
  1905. * [jsonwp]
  1906. * Set the storage item for the given key.
  1907. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#post-sessionsessionidsession_storage
  1908. */
  1909. setSessionStorage(key: string, value: string): void;
  1910. /**
  1911. * [jsonwp]
  1912. * Clear the storage.
  1913. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidsession_storage
  1914. */
  1915. clearSessionStorage(): void;
  1916. /**
  1917. * [jsonwp]
  1918. * Get the storage item for the given key.
  1919. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#get-sessionsessionidsession_storagekeykey
  1920. */
  1921. getSessionStorageItem(key: string): string;
  1922. /**
  1923. * [jsonwp]
  1924. * Remove the storage item for the given key.
  1925. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#delete-sessionsessionidsession_storagekeykey
  1926. */
  1927. deleteSessionStorageItem(key: string): void;
  1928. /**
  1929. * [jsonwp]
  1930. * Get the number of items in the storage.
  1931. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidsession_storagesize
  1932. */
  1933. getSessionStorageSize(): number;
  1934. /**
  1935. * [jsonwp]
  1936. * Get the log for a given log type. Log buffer is reset after each request.
  1937. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog
  1938. */
  1939. getLogs(type: string): object[];
  1940. /**
  1941. * [jsonwp]
  1942. * Get available log types.
  1943. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlogtypes
  1944. */
  1945. getLogTypes(): string[];
  1946. /**
  1947. * [jsonwp]
  1948. * Get the status of the html5 application cache.
  1949. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidapplication_cachestatus
  1950. */
  1951. getApplicationCacheStatus(): number;
  1952. }
  1953. // mjsonwp types
  1954. interface Client extends BaseClient {
  1955. /**
  1956. * [mjsonwp]
  1957. *
  1958. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts
  1959. */
  1960. getContext(): string|null;
  1961. /**
  1962. * [mjsonwp]
  1963. *
  1964. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts
  1965. */
  1966. switchContext(name: string): void;
  1967. /**
  1968. * [mjsonwp]
  1969. *
  1970. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts
  1971. */
  1972. getContexts(): string[];
  1973. /**
  1974. * [mjsonwp]
  1975. *
  1976. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#mobile-json-wire-protocol-endpoints
  1977. */
  1978. getPageIndex(): string;
  1979. /**
  1980. * [mjsonwp]
  1981. *
  1982. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes
  1983. */
  1984. getNetworkConnection(): number;
  1985. /**
  1986. * [mjsonwp]
  1987. *
  1988. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes
  1989. */
  1990. setNetworkConnection(type: number): void;
  1991. /**
  1992. * [mjsonwp]
  1993. *
  1994. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#touch-gestures
  1995. */
  1996. touchPerform(actions: object[]): void;
  1997. /**
  1998. * [mjsonwp]
  1999. *
  2000. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#touch-gestures
  2001. */
  2002. multiTouchPerform(actions: object[], elementId: object[]): void;
  2003. /**
  2004. * [mjsonwp]
  2005. *
  2006. * https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#mobile-json-wire-protocol-endpoints
  2007. */
  2008. receiveAsyncResponse(status: string, value: string): void;
  2009. }
  2010. // chromium types
  2011. interface Client extends BaseClient {
  2012. /**
  2013. * [chromium]
  2014. * Whether a simple dialog is currently open.
  2015. * https://github.com/bayandin/chromedriver/blob/v2.45/alert_commands.cc#L42-L49
  2016. */
  2017. isAlertOpen(): boolean;
  2018. /**
  2019. * [chromium]
  2020. * Whether it should automatically raises errors on browser logs.
  2021. * https://codereview.chromium.org/101203012
  2022. */
  2023. isAutoReporting(): boolean;
  2024. /**
  2025. * [chromium]
  2026. * 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).
  2027. * https://codereview.chromium.org/101203012
  2028. */
  2029. setAutoReporting(enabled: boolean): object|null;
  2030. /**
  2031. * [chromium]
  2032. * Determines load status for active window handle.
  2033. * https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L783-L802
  2034. */
  2035. isLoading(): boolean;
  2036. /**
  2037. * [chromium]
  2038. * Takes a heap snapshot of the current execution context.
  2039. * https://github.com/bayandin/chromedriver/blob/v2.45/chrome/web_view.h#L198-L202
  2040. */
  2041. takeHeapSnapshot(): ProtocolCommandResponse;
  2042. /**
  2043. * [chromium]
  2044. * Get the connection type for network emulation. This command is only applicable when remote end replies with `networkConnectionEnabled` capability set to `true`.
  2045. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes
  2046. */
  2047. getNetworkConnection(): number;
  2048. /**
  2049. * [chromium]
  2050. * Change connection type for network connection. This command is only applicable when remote end replies with `networkConnectionEnabled` capability set to `true`.
  2051. * https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes
  2052. */
  2053. setNetworkConnection(parameters: object): number;
  2054. /**
  2055. * [chromium]
  2056. * Get current network conditions used for emulation.
  2057. * https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L839-L859
  2058. */
  2059. getNetworkConditions(): ProtocolCommandResponse;
  2060. /**
  2061. * [chromium]
  2062. * Set network conditions used for emulation by throttling connection.
  2063. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1663-L1722
  2064. */
  2065. setNetworkConditions(network_conditions: object, network_name?: string): void;
  2066. /**
  2067. * [chromium]
  2068. * Disable any network throttling which might have been set. Equivalent of setting the `No throttling` preset.
  2069. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1724-L1745
  2070. */
  2071. deleteNetworkConditions(): void;
  2072. /**
  2073. * [chromium]
  2074. * 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/).
  2075. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1290-L1304
  2076. */
  2077. sendCommand(cmd: string, params: object): void;
  2078. /**
  2079. * [chromium]
  2080. * 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/).
  2081. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L1306-L1320
  2082. */
  2083. sendCommandAndGetResult(cmd: string, params: object): any;
  2084. /**
  2085. * [chromium]
  2086. * Upload a file to remote machine on which the browser is running.
  2087. * https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L1037-L1065
  2088. */
  2089. file(file: string): string;
  2090. /**
  2091. * [chromium]
  2092. * Launches a Chrome app by specified id.
  2093. * https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L521-L539
  2094. */
  2095. launchChromeApp(id: string): void;
  2096. /**
  2097. * [chromium]
  2098. * Retrieves the value of a given form control element.
  2099. * https://github.com/bayandin/chromedriver/blob/v2.45/element_commands.cc#L431-L443
  2100. */
  2101. getElementValue(elementId: string): string|null;
  2102. /**
  2103. * [chromium]
  2104. * Enable hover state for an element, which is reset upon next interaction.
  2105. * https://github.com/bayandin/chromedriver/blob/v2.45/element_commands.cc#L126-L146
  2106. */
  2107. elementHover(elementId: string): void;
  2108. /**
  2109. * [chromium]
  2110. * Trigger a pinch zoom effect.
  2111. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L813-L827
  2112. */
  2113. touchPinch(x: number, y: number, scale: number): void;
  2114. /**
  2115. * [chromium]
  2116. * Freeze the current page. Extension for [Page Lifecycle API](https://developers.google.com/web/updates/2018/07/page-lifecycle-api).
  2117. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L625-L633
  2118. */
  2119. freeze(): void;
  2120. /**
  2121. * [chromium]
  2122. * Resume the current page. Extension for [Page Lifecycle API](https://developers.google.com/web/updates/2018/07/page-lifecycle-api).
  2123. * https://github.com/bayandin/chromedriver/blob/v2.45/window_commands.cc#L635-L645
  2124. */
  2125. resume(): void;
  2126. /**
  2127. * [chromium]
  2128. * Shutdown ChromeDriver process and consequently terminating all active sessions.
  2129. * https://github.com/bayandin/chromedriver/blob/v2.45/session_commands.cc#L489-L498
  2130. */
  2131. shutdown(): void;
  2132. /**
  2133. * [chromium]
  2134. * The Take Element Screenshot command takes a screenshot of the visible region encompassed by the bounding rectangle of an element.
  2135. * https://w3c.github.io/webdriver/#dfn-take-element-screenshot
  2136. */
  2137. takeElementScreenshot(elementId: string, scroll?: boolean): string;
  2138. /**
  2139. * [chromium]
  2140. * Get available log types.
  2141. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlogtypes
  2142. */
  2143. getLogTypes(): string[];
  2144. /**
  2145. * [chromium]
  2146. * Get the log for a given log type. Log buffer is reset after each request.
  2147. * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidlog
  2148. */
  2149. getLogs(type: string): object[];
  2150. }
  2151. // saucelabs types
  2152. interface Client extends BaseClient {
  2153. /**
  2154. * [saucelabs]
  2155. * Get webpage specific log information based on the last page load.
  2156. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands#CustomSauceLabsWebDriverExtensionsforNetworkandLogCommands-ExtendedDebuggingTools
  2157. */
  2158. getPageLogs(type: string): ProtocolCommandResponse;
  2159. /**
  2160. * [saucelabs]
  2161. * 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).
  2162. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands#CustomSauceLabsWebDriverExtensionsforNetworkandLogCommands-ThrottleNetworkCapabilities
  2163. */
  2164. throttleNetwork(condition: (string|object)): void;
  2165. /**
  2166. * [saucelabs]
  2167. * You can throttle the CPU in DevTools to understand how your page performs under that constraint.
  2168. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands#CustomSauceLabsWebDriverExtensionsforNetworkandLogCommands-ThrottleCPUCapabilities
  2169. */
  2170. throttleCPU(rate: number): void;
  2171. /**
  2172. * [saucelabs]
  2173. * Allows modifying any request made by the browser. You can blacklist, modify, or redirect these as required for your tests.
  2174. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands#CustomSauceLabsWebDriverExtensionsforNetworkandLogCommands-InterceptNetworkRequests
  2175. */
  2176. interceptRequest(rule: object): void;
  2177. /**
  2178. * [saucelabs]
  2179. * Assert against the performance baseline of your app.
  2180. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2181. */
  2182. assertPerformance(name: string, metrics?: string[]): ProtocolCommandResponse;
  2183. /**
  2184. * [saucelabs]
  2185. * Perform a scroll test that evaluates the jankiness of the application.
  2186. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2187. */
  2188. jankinessCheck(): ProtocolCommandResponse;
  2189. /**
  2190. * [saucelabs]
  2191. * Mocks a network resource.
  2192. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2193. */
  2194. mockRequest(url: string, filterOptions?: object): ProtocolCommandResponse;
  2195. /**
  2196. * [saucelabs]
  2197. * Receive request information about requests that match the mocked resource.
  2198. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2199. */
  2200. getMockCalls(mockId: string): ProtocolCommandResponse;
  2201. /**
  2202. * [saucelabs]
  2203. * Clear list of mock calls.
  2204. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2205. */
  2206. clearMockCalls(mockId: string, restore: boolean): void;
  2207. /**
  2208. * [saucelabs]
  2209. * Respond if mock matches a specific resource.
  2210. * https://wiki.saucelabs.com/display/DOCS/Custom+Sauce+Labs+WebDriver+Extensions+for+Network+and+Log+Commands
  2211. */
  2212. respondMock(mockId: string, payload: object): void;
  2213. }
  2214. // selenium types
  2215. interface Client extends BaseClient {
  2216. /**
  2217. * [selenium]
  2218. * Upload a file to remote machine on which the browser is running.
  2219. * https://www.seleniumhq.org/
  2220. */
  2221. file(file: string): string;
  2222. /**
  2223. * [selenium]
  2224. * Receive hub config remotely.
  2225. * https://github.com/nicegraham/selenium-grid2-api#gridapihub
  2226. */
  2227. getHubConfig(): ProtocolCommandResponse;
  2228. /**
  2229. * [selenium]
  2230. * Get the details of the Selenium Grid node running a session.
  2231. * https://github.com/nicegraham/selenium-grid2-api#gridapitestsession
  2232. */
  2233. gridTestSession(session: string): ProtocolCommandResponse;
  2234. /**
  2235. * [selenium]
  2236. * Get proxy details.
  2237. * https://github.com/nicegraham/selenium-grid2-api#gridapiproxy
  2238. */
  2239. gridProxyDetails(id: string): ProtocolCommandResponse;
  2240. /**
  2241. * [selenium]
  2242. * Manage lifecycle of hub node.
  2243. * https://github.com/nicegraham/selenium-grid2-api#lifecycle-manager
  2244. */
  2245. manageSeleniumHubLifecycle(action: string): void;
  2246. }
  2247. //# sourceMappingURL=types.d.ts.map