interfaces.d.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import { Session as BasicSession, Command } from 'selenium-mock';
  2. export interface Location {
  3. latitude: number;
  4. longitude: number;
  5. altitude: number;
  6. }
  7. export interface FsFolder {
  8. [name: string]: (string | FsFolder);
  9. }
  10. export declare type Orientation = 'LANDSCAPE' | 'PORTRAIT';
  11. export interface Session extends BasicSession {
  12. currentContext?: string;
  13. installedApps?: string[];
  14. locked?: boolean;
  15. localStorage?: {
  16. [key: string]: string;
  17. };
  18. location?: Location;
  19. locationEnabled?: boolean;
  20. orientation?: Orientation;
  21. files?: FsFolder;
  22. sessionStorage?: {
  23. [key: string]: string;
  24. };
  25. settings?: {
  26. [key: string]: any;
  27. };
  28. activity?: string;
  29. networkConnection?: number;
  30. }
  31. export interface CommandList {
  32. [name: string]: Command<Session> | CommandList;
  33. }
  34. export interface ElementCommandList extends CommandList {
  35. elementIdLocationInView: Command<Session>;
  36. }
  37. export interface StorageCommandList extends CommandList {
  38. getKeys: Command<Session>;
  39. getValue: Command<Session>;
  40. setValue: Command<Session>;
  41. deleteEntry: Command<Session>;
  42. deleteAll: Command<Session>;
  43. getSize: Command<Session>;
  44. }
  45. export interface AppiumAppCommandList extends CommandList {
  46. toBackground: Command<Session>;
  47. closeApp: Command<Session>;
  48. getStrings: Command<Session>;
  49. launch: Command<Session>;
  50. reset: Command<Session>;
  51. }
  52. export interface AppiumDeviceCommandList extends CommandList {
  53. getActivity: Command<Session>;
  54. startActivity: Command<Session>;
  55. hideKeyboard: Command<Session>;
  56. sendKeyEvent: Command<Session>;
  57. pressKeyCode: Command<Session>;
  58. longPressKeyCode: Command<Session>;
  59. installApp: Command<Session>;
  60. isAppInstalled: Command<Session>;
  61. removeApp: Command<Session>;
  62. isLocked: Command<Session>;
  63. lock: Command<Session>;
  64. unlock: Command<Session>;
  65. pullFile: Command<Session>;
  66. pullFolder: Command<Session>;
  67. pushFile: Command<Session>;
  68. getTime: Command<Session>;
  69. openNotifications: Command<Session>;
  70. rotate: Command<Session>;
  71. shake: Command<Session>;
  72. }
  73. export interface AppiumCommandList extends CommandList {
  74. getSettings: Command<Session>;
  75. setSettings: Command<Session>;
  76. setImmediateValue: Command<Session>;
  77. app: AppiumAppCommandList;
  78. device: AppiumDeviceCommandList;
  79. }
  80. export interface ChromiumCommandList extends CommandList {
  81. sendChromiumCommand: Command<Session>;
  82. sendChromiumCommandAndGetResult: Command<Session>;
  83. }
  84. export interface SessionCommandList extends CommandList {
  85. currentContext: Command<Session>;
  86. selectContext: Command<Session>;
  87. listContexts: Command<Session>;
  88. uploadFile: Command<Session>;
  89. getNetworkConnection: Command<Session>;
  90. setNetworkConnection: Command<Session>;
  91. toggleAirplaneMode: Command<Session>;
  92. toggleData: Command<Session>;
  93. toggleWiFi: Command<Session>;
  94. toggleLocationServices: Command<Session>;
  95. getGeolocation: Command<Session>;
  96. setGeolocation: Command<Session>;
  97. getOrientation: Command<Session>;
  98. setOrientation: Command<Session>;
  99. switchToParentFrame: Command<Session>;
  100. fullscreen: Command<Session>;
  101. performMultiAction: Command<Session>;
  102. performTouchAction: Command<Session>;
  103. element: ElementCommandList;
  104. sessionStorage: StorageCommandList;
  105. localStorage: StorageCommandList;
  106. appium: AppiumCommandList;
  107. chromium: ChromiumCommandList;
  108. }