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.

constants.js 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.ERROR_REASON = exports.FF_REMOTE_DEBUG_ARG = exports.DRIVER_DEFAULT_ENDPOINT = exports.APPIUM_CAPABILITES = exports.APPIUM_IOS_CAPABILITIES = exports.APPIUM_ANDROID_CAPABILITIES = exports.JSONWP_CAPABILITIES = exports.W3C_CAPABILITIES = exports.W3C_SELECTOR_STRATEGIES = exports.UNICODE_CHARACTERS = exports.WDIO_DEFAULTS = exports.ELEMENT_KEY = void 0;
  4. const HOOK_DEFINITION = {
  5. type: 'object',
  6. validate: (param) => {
  7. if (!Array.isArray(param)) {
  8. throw new Error('a hook option needs to be a list of functions');
  9. }
  10. for (const option of param) {
  11. if (typeof option === 'function') {
  12. continue;
  13. }
  14. throw new Error('expected hook to be type of function');
  15. }
  16. return true;
  17. }
  18. };
  19. exports.ELEMENT_KEY = 'element-6066-11e4-a52e-4f735466cecf';
  20. exports.WDIO_DEFAULTS = {
  21. automationProtocol: {
  22. type: 'string',
  23. validate: (param) => {
  24. if (!['webdriver', 'devtools', './protocol-stub'].includes(param.toLowerCase())) {
  25. throw new Error(`Currently only "webdriver" and "devtools" is supproted as automationProtocol, you set "${param}"`);
  26. }
  27. try {
  28. require.resolve(param);
  29. }
  30. catch (e) {
  31. throw new Error('Automation protocol package is not installed!\n' +
  32. `Please install it via \`npm install ${param}\``);
  33. }
  34. }
  35. },
  36. specs: {
  37. type: 'object',
  38. validate: (param) => {
  39. if (!Array.isArray(param)) {
  40. throw new Error('the "specs" option needs to be a list of strings');
  41. }
  42. }
  43. },
  44. exclude: {
  45. type: 'object',
  46. validate: (param) => {
  47. if (!Array.isArray(param)) {
  48. throw new Error('the "exclude" option needs to be a list of strings');
  49. }
  50. }
  51. },
  52. suites: {
  53. type: 'object'
  54. },
  55. capabilities: {
  56. type: 'object',
  57. validate: (param) => {
  58. if (!Array.isArray(param)) {
  59. if (typeof param === 'object') {
  60. return true;
  61. }
  62. throw new Error('the "capabilities" options needs to be an object or a list of objects');
  63. }
  64. for (const option of param) {
  65. if (typeof option === 'object') {
  66. continue;
  67. }
  68. throw new Error('expected every item of a list of capabilities to be of type object');
  69. }
  70. return true;
  71. },
  72. required: true
  73. },
  74. baseUrl: {
  75. type: 'string'
  76. },
  77. bail: {
  78. type: 'number',
  79. default: 0
  80. },
  81. waitforInterval: {
  82. type: 'number',
  83. default: 500
  84. },
  85. waitforTimeout: {
  86. type: 'number',
  87. default: 3000
  88. },
  89. framework: {
  90. type: 'string'
  91. },
  92. reporters: {
  93. type: 'object',
  94. validate: (param) => {
  95. if (!Array.isArray(param)) {
  96. throw new Error('the "reporters" options needs to be a list of strings');
  97. }
  98. const isValidReporter = (option) => ((typeof option === 'string') ||
  99. (typeof option === 'function'));
  100. for (const option of param) {
  101. if (isValidReporter(option)) {
  102. continue;
  103. }
  104. if (Array.isArray(option) &&
  105. typeof option[1] === 'object' &&
  106. isValidReporter(option[0])) {
  107. continue;
  108. }
  109. throw new Error('a reporter should be either a string in the format "wdio-<reportername>-reporter" ' +
  110. 'or a function/class. Please see the docs for more information on custom reporters ' +
  111. '(https://webdriver.io/docs/customreporter.html)');
  112. }
  113. return true;
  114. }
  115. },
  116. services: {
  117. type: 'object',
  118. validate: (param) => {
  119. if (!Array.isArray(param)) {
  120. throw new Error('the "services" options needs to be a list of strings and/or arrays');
  121. }
  122. for (const option of param) {
  123. if (!Array.isArray(option)) {
  124. if (typeof option === 'string') {
  125. continue;
  126. }
  127. throw new Error('the "services" options needs to be a list of strings and/or arrays');
  128. }
  129. }
  130. return true;
  131. },
  132. default: []
  133. },
  134. execArgv: {
  135. type: 'object',
  136. validate: (param) => {
  137. if (!Array.isArray(param)) {
  138. throw new Error('the "execArgv" options needs to be a list of strings');
  139. }
  140. },
  141. default: []
  142. },
  143. maxInstances: {
  144. type: 'number'
  145. },
  146. maxInstancesPerCapability: {
  147. type: 'number'
  148. },
  149. filesToWatch: {
  150. type: 'object',
  151. validate: (param) => {
  152. if (!Array.isArray(param)) {
  153. throw new Error('the "filesToWatch" options needs to be a list of strings');
  154. }
  155. }
  156. },
  157. onPrepare: HOOK_DEFINITION,
  158. onWorkerStart: HOOK_DEFINITION,
  159. before: HOOK_DEFINITION,
  160. beforeSession: HOOK_DEFINITION,
  161. beforeSuite: HOOK_DEFINITION,
  162. beforeHook: HOOK_DEFINITION,
  163. beforeTest: HOOK_DEFINITION,
  164. beforeCommand: HOOK_DEFINITION,
  165. afterCommand: HOOK_DEFINITION,
  166. afterTest: HOOK_DEFINITION,
  167. afterHook: HOOK_DEFINITION,
  168. afterSuite: HOOK_DEFINITION,
  169. afterSession: HOOK_DEFINITION,
  170. after: HOOK_DEFINITION,
  171. onComplete: HOOK_DEFINITION,
  172. onReload: HOOK_DEFINITION,
  173. beforeFeature: HOOK_DEFINITION,
  174. beforeScenario: HOOK_DEFINITION,
  175. beforeStep: HOOK_DEFINITION,
  176. afterStep: HOOK_DEFINITION,
  177. afterScenario: HOOK_DEFINITION,
  178. afterFeature: HOOK_DEFINITION,
  179. };
  180. exports.UNICODE_CHARACTERS = {
  181. 'NULL': '\uE000',
  182. 'Unidentified': '\uE000',
  183. 'Cancel': '\uE001',
  184. 'Help': '\uE002',
  185. 'Back space': '\uE003',
  186. 'Backspace': '\uE003',
  187. 'Tab': '\uE004',
  188. 'Clear': '\uE005',
  189. 'Return': '\uE006',
  190. 'Enter': '\uE007',
  191. 'Shift': '\uE008',
  192. 'Control': '\uE009',
  193. 'Control Left': '\uE009',
  194. 'Control Right': '\uE051',
  195. 'Alt': '\uE00A',
  196. 'Pause': '\uE00B',
  197. 'Escape': '\uE00C',
  198. 'Space': '\uE00D',
  199. ' ': '\uE00D',
  200. 'Pageup': '\uE00E',
  201. 'PageUp': '\uE00E',
  202. 'Page_Up': '\uE00E',
  203. 'Pagedown': '\uE00F',
  204. 'PageDown': '\uE00F',
  205. 'Page_Down': '\uE00F',
  206. 'End': '\uE010',
  207. 'Home': '\uE011',
  208. 'Left arrow': '\uE012',
  209. 'Arrow_Left': '\uE012',
  210. 'ArrowLeft': '\uE012',
  211. 'Up arrow': '\uE013',
  212. 'Arrow_Up': '\uE013',
  213. 'ArrowUp': '\uE013',
  214. 'Right arrow': '\uE014',
  215. 'Arrow_Right': '\uE014',
  216. 'ArrowRight': '\uE014',
  217. 'Down arrow': '\uE015',
  218. 'Arrow_Down': '\uE015',
  219. 'ArrowDown': '\uE015',
  220. 'Insert': '\uE016',
  221. 'Delete': '\uE017',
  222. 'Semicolon': '\uE018',
  223. 'Equals': '\uE019',
  224. 'Numpad 0': '\uE01A',
  225. 'Numpad 1': '\uE01B',
  226. 'Numpad 2': '\uE01C',
  227. 'Numpad 3': '\uE01D',
  228. 'Numpad 4': '\uE01E',
  229. 'Numpad 5': '\uE01F',
  230. 'Numpad 6': '\uE020',
  231. 'Numpad 7': '\uE021',
  232. 'Numpad 8': '\uE022',
  233. 'Numpad 9': '\uE023',
  234. 'Multiply': '\uE024',
  235. 'Add': '\uE025',
  236. 'Separator': '\uE026',
  237. 'Subtract': '\uE027',
  238. 'Decimal': '\uE028',
  239. 'Divide': '\uE029',
  240. 'F1': '\uE031',
  241. 'F2': '\uE032',
  242. 'F3': '\uE033',
  243. 'F4': '\uE034',
  244. 'F5': '\uE035',
  245. 'F6': '\uE036',
  246. 'F7': '\uE037',
  247. 'F8': '\uE038',
  248. 'F9': '\uE039',
  249. 'F10': '\uE03A',
  250. 'F11': '\uE03B',
  251. 'F12': '\uE03C',
  252. 'Command': '\uE03D',
  253. 'Meta': '\uE03D',
  254. 'Zenkaku_Hankaku': '\uE040',
  255. 'ZenkakuHankaku': '\uE040'
  256. };
  257. exports.W3C_SELECTOR_STRATEGIES = ['css selector', 'link text', 'partial link text', 'tag name', 'xpath'];
  258. exports.W3C_CAPABILITIES = [
  259. 'browserName', 'browserVersion', 'platformName', 'acceptInsecureCerts', 'pageLoadStrategy', 'proxy',
  260. 'setWindowRect', 'timeouts', 'unhandledPromptBehavior'
  261. ];
  262. exports.JSONWP_CAPABILITIES = [
  263. 'browserName', 'version', 'platform', 'javascriptEnabled', 'takesScreenshot', 'handlesAlerts', 'databaseEnabled',
  264. 'locationContextEnabled', 'applicationCacheEnabled', 'browserConnectionEnabled', 'cssSelectorsEnabled',
  265. 'webStorageEnabled', 'rotatable', 'acceptSslCerts', 'nativeEvents', 'proxy'
  266. ];
  267. exports.APPIUM_ANDROID_CAPABILITIES = [
  268. 'appActivity', 'appPackage', 'appWaitActivity', 'appWaitPackage', 'appWaitDuration', 'deviceReadyTimeout',
  269. 'androidCoverage', 'androidCoverageEndIntent', 'androidDeviceReadyTimeout', 'androidInstallTimeout',
  270. 'androidInstallPath', 'adbPort', 'systemPort', 'remoteAdbHost', 'androidDeviceSocket', 'avd', 'avdLaunchTimeout',
  271. 'avdReadyTimeout', 'avdArgs', 'useKeystore', 'keystorePath', 'keystorePassword', 'keyAlias', 'keyPassword',
  272. 'chromedriverExecutable', 'chromedriverExecutableDir', 'chromedriverChromeMappingFile', 'autoWebviewTimeout',
  273. 'intentAction', 'intentCategory', 'intentFlags', 'optionalIntentArguments', 'dontStopAppOnReset',
  274. 'unicodeKeyboard', 'resetKeyboard', 'noSign', 'ignoreUnimportantViews', 'disableAndroidWatchers', 'chromeOptions',
  275. 'recreateChromeDriverSessions', 'nativeWebScreenshot', 'androidScreenshotPath', 'autoGrantPermissions',
  276. 'networkSpeed', 'gpsEnabled', 'isHeadless', 'uiautomator2ServerLaunchTimeout', 'uiautomator2ServerInstallTimeout',
  277. 'otherApps'
  278. ];
  279. exports.APPIUM_IOS_CAPABILITIES = [
  280. 'calendarFormat', 'bundleId', 'udid', 'launchTimeout', 'locationServicesEnabled', 'locationServicesAuthorized',
  281. 'autoAcceptAlerts', 'autoDismissAlerts', 'nativeInstrumentsLib', 'nativeWebTap', 'safariInitialUrl',
  282. 'safariAllowPopups', 'safariIgnoreFraudWarning', 'safariOpenLinksInBackground', 'keepKeyChains',
  283. 'localizableStringsDir', 'processArguments', 'interKeyDelay', 'showIOSLog', 'sendKeyStrategy',
  284. 'screenshotWaitTimeout', 'waitForAppScript', 'webviewConnectRetries', 'appName', 'customSSLCert',
  285. 'webkitResponseTimeout'
  286. ];
  287. exports.APPIUM_CAPABILITES = [
  288. 'automationName', 'platformName', 'platformVersion', 'deviceName', 'app', 'browserName', 'newCommandTimeout',
  289. 'language', 'locale', 'udid', 'orientation', 'autoWebview', 'noReset', 'fullReset', 'eventTimings',
  290. 'enablePerformanceLogging', 'printPageSourceOnFindFailure',
  291. ...exports.APPIUM_ANDROID_CAPABILITIES,
  292. ...exports.APPIUM_IOS_CAPABILITIES
  293. ];
  294. exports.DRIVER_DEFAULT_ENDPOINT = {
  295. method: 'GET',
  296. host: 'localhost',
  297. port: 4444,
  298. path: '/status'
  299. };
  300. exports.FF_REMOTE_DEBUG_ARG = '-remote-debugging-port';
  301. exports.ERROR_REASON = [
  302. 'Failed', 'Aborted', 'TimedOut', 'AccessDenied', 'ConnectionClosed',
  303. 'ConnectionReset', 'ConnectionRefused', 'ConnectionAborted',
  304. 'ConnectionFailed', 'NameNotResolved', 'InternetDisconnected',
  305. 'AddressUnreachable', 'BlockedByClient', 'BlockedByResponse'
  306. ];