interfaces.d.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 SessionCommandList extends CommandList {
  81. currentContext: Command<Session>;
  82. selectContext: Command<Session>;
  83. listContexts: Command<Session>;
  84. uploadFile: Command<Session>;
  85. getNetworkConnection: Command<Session>;
  86. setNetworkConnection: Command<Session>;
  87. toggleAirplaneMode: Command<Session>;
  88. toggleData: Command<Session>;
  89. toggleWiFi: Command<Session>;
  90. toggleLocationServices: Command<Session>;
  91. getGeolocation: Command<Session>;
  92. setGeolocation: Command<Session>;
  93. getOrientation: Command<Session>;
  94. setOrientation: Command<Session>;
  95. switchToParentFrame: Command<Session>;
  96. fullscreen: Command<Session>;
  97. performMultiAction: Command<Session>;
  98. performTouchAction: Command<Session>;
  99. element: ElementCommandList;
  100. sessionStorage: StorageCommandList;
  101. localStorage: StorageCommandList;
  102. appium: AppiumCommandList;
  103. }