UrgentcareCLI 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (308) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +60 -25
  4. data/Notes +1 -1
  5. data/README.md +5 -5
  6. data/Rakefile +2 -0
  7. data/UrgentCare.gemspec +3 -3
  8. data/background.jpg +0 -0
  9. data/lib/UrgentCare.rb +3 -0
  10. data/lib/UrgentCare/CLI.rb +6 -2
  11. data/lib/UrgentCare/version.rb +1 -1
  12. data/lib/Urgentcare/Scraper.rb +65 -23
  13. data/node_modules/.bin/rimraf +1 -0
  14. data/node_modules/.package-lock.json +250 -0
  15. data/node_modules/balanced-match/.github/FUNDING.yml +2 -0
  16. data/node_modules/balanced-match/LICENSE.md +21 -0
  17. data/node_modules/balanced-match/README.md +97 -0
  18. data/node_modules/balanced-match/index.js +62 -0
  19. data/node_modules/balanced-match/package.json +48 -0
  20. data/node_modules/brace-expansion/LICENSE +21 -0
  21. data/node_modules/brace-expansion/README.md +129 -0
  22. data/node_modules/brace-expansion/index.js +201 -0
  23. data/node_modules/brace-expansion/package.json +47 -0
  24. data/node_modules/concat-map/.travis.yml +4 -0
  25. data/node_modules/concat-map/LICENSE +18 -0
  26. data/node_modules/concat-map/README.markdown +62 -0
  27. data/node_modules/concat-map/example/map.js +6 -0
  28. data/node_modules/concat-map/index.js +13 -0
  29. data/node_modules/concat-map/package.json +43 -0
  30. data/node_modules/concat-map/test/map.js +39 -0
  31. data/node_modules/core-util-is/LICENSE +19 -0
  32. data/node_modules/core-util-is/README.md +3 -0
  33. data/node_modules/core-util-is/float.patch +604 -0
  34. data/node_modules/core-util-is/lib/util.js +107 -0
  35. data/node_modules/core-util-is/package.json +32 -0
  36. data/node_modules/core-util-is/test.js +68 -0
  37. data/node_modules/fs.realpath/LICENSE +43 -0
  38. data/node_modules/fs.realpath/README.md +33 -0
  39. data/node_modules/fs.realpath/index.js +66 -0
  40. data/node_modules/fs.realpath/old.js +303 -0
  41. data/node_modules/fs.realpath/package.json +26 -0
  42. data/node_modules/glob/LICENSE +21 -0
  43. data/node_modules/glob/README.md +375 -0
  44. data/node_modules/glob/changelog.md +67 -0
  45. data/node_modules/glob/common.js +234 -0
  46. data/node_modules/glob/glob.js +788 -0
  47. data/node_modules/glob/package.json +51 -0
  48. data/node_modules/glob/sync.js +484 -0
  49. data/node_modules/immediate/LICENSE.txt +20 -0
  50. data/node_modules/immediate/README.md +93 -0
  51. data/node_modules/immediate/dist/immediate.js +75 -0
  52. data/node_modules/immediate/dist/immediate.min.js +1 -0
  53. data/node_modules/immediate/lib/browser.js +69 -0
  54. data/node_modules/immediate/lib/index.js +73 -0
  55. data/node_modules/immediate/package.json +42 -0
  56. data/node_modules/inflight/LICENSE +15 -0
  57. data/node_modules/inflight/README.md +37 -0
  58. data/node_modules/inflight/inflight.js +54 -0
  59. data/node_modules/inflight/package.json +29 -0
  60. data/node_modules/inherits/LICENSE +16 -0
  61. data/node_modules/inherits/README.md +42 -0
  62. data/node_modules/inherits/inherits.js +9 -0
  63. data/node_modules/inherits/inherits_browser.js +27 -0
  64. data/node_modules/inherits/package.json +29 -0
  65. data/node_modules/isarray/.npmignore +1 -0
  66. data/node_modules/isarray/.travis.yml +4 -0
  67. data/node_modules/isarray/Makefile +6 -0
  68. data/node_modules/isarray/README.md +60 -0
  69. data/node_modules/isarray/component.json +19 -0
  70. data/node_modules/isarray/index.js +5 -0
  71. data/node_modules/isarray/package.json +45 -0
  72. data/node_modules/isarray/test.js +20 -0
  73. data/node_modules/jszip/.codeclimate.yml +16 -0
  74. data/node_modules/jszip/.editorconfig +8 -0
  75. data/node_modules/jszip/.jshintignore +1 -0
  76. data/node_modules/jszip/.jshintrc +21 -0
  77. data/node_modules/jszip/.travis.yml +17 -0
  78. data/node_modules/jszip/CHANGES.md +163 -0
  79. data/node_modules/jszip/LICENSE.markdown +651 -0
  80. data/node_modules/jszip/README.markdown +35 -0
  81. data/node_modules/jszip/dist/jszip.js +30 -0
  82. data/node_modules/jszip/dist/jszip.min.js +13 -0
  83. data/node_modules/jszip/index.d.ts +270 -0
  84. data/node_modules/jszip/lib/base64.js +106 -0
  85. data/node_modules/jszip/lib/compressedObject.js +74 -0
  86. data/node_modules/jszip/lib/compressions.js +14 -0
  87. data/node_modules/jszip/lib/crc32.js +77 -0
  88. data/node_modules/jszip/lib/defaults.js +11 -0
  89. data/node_modules/jszip/lib/external.js +19 -0
  90. data/node_modules/jszip/lib/flate.js +85 -0
  91. data/node_modules/jszip/lib/generate/ZipFileWorker.js +540 -0
  92. data/node_modules/jszip/lib/generate/index.js +57 -0
  93. data/node_modules/jszip/lib/index.js +52 -0
  94. data/node_modules/jszip/lib/license_header.js +11 -0
  95. data/node_modules/jszip/lib/load.js +81 -0
  96. data/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
  97. data/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
  98. data/node_modules/jszip/lib/nodejsUtils.js +57 -0
  99. data/node_modules/jszip/lib/object.js +389 -0
  100. data/node_modules/jszip/lib/readable-stream-browser.js +9 -0
  101. data/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
  102. data/node_modules/jszip/lib/reader/DataReader.js +116 -0
  103. data/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
  104. data/node_modules/jszip/lib/reader/StringReader.js +38 -0
  105. data/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
  106. data/node_modules/jszip/lib/reader/readerFor.js +28 -0
  107. data/node_modules/jszip/lib/signature.js +7 -0
  108. data/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
  109. data/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
  110. data/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
  111. data/node_modules/jszip/lib/stream/DataWorker.js +116 -0
  112. data/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
  113. data/node_modules/jszip/lib/stream/StreamHelper.js +212 -0
  114. data/node_modules/jszip/lib/support.js +38 -0
  115. data/node_modules/jszip/lib/utf8.js +275 -0
  116. data/node_modules/jszip/lib/utils.js +476 -0
  117. data/node_modules/jszip/lib/zipEntries.js +262 -0
  118. data/node_modules/jszip/lib/zipEntry.js +294 -0
  119. data/node_modules/jszip/lib/zipObject.js +133 -0
  120. data/node_modules/jszip/package.json +63 -0
  121. data/node_modules/jszip/vendor/FileSaver.js +247 -0
  122. data/node_modules/lie/README.md +62 -0
  123. data/node_modules/lie/dist/lie.js +350 -0
  124. data/node_modules/lie/dist/lie.min.js +1 -0
  125. data/node_modules/lie/dist/lie.polyfill.js +358 -0
  126. data/node_modules/lie/dist/lie.polyfill.min.js +1 -0
  127. data/node_modules/lie/lib/browser.js +273 -0
  128. data/node_modules/lie/lib/index.js +298 -0
  129. data/node_modules/lie/license.md +7 -0
  130. data/node_modules/lie/lie.d.ts +244 -0
  131. data/node_modules/lie/package.json +69 -0
  132. data/node_modules/lie/polyfill.js +4 -0
  133. data/node_modules/minimatch/LICENSE +15 -0
  134. data/node_modules/minimatch/README.md +209 -0
  135. data/node_modules/minimatch/minimatch.js +923 -0
  136. data/node_modules/minimatch/package.json +30 -0
  137. data/node_modules/once/LICENSE +15 -0
  138. data/node_modules/once/README.md +79 -0
  139. data/node_modules/once/once.js +42 -0
  140. data/node_modules/once/package.json +33 -0
  141. data/node_modules/pako/CHANGELOG.md +164 -0
  142. data/node_modules/pako/LICENSE +21 -0
  143. data/node_modules/pako/README.md +191 -0
  144. data/node_modules/pako/dist/pako.js +6818 -0
  145. data/node_modules/pako/dist/pako.min.js +1 -0
  146. data/node_modules/pako/dist/pako_deflate.js +3997 -0
  147. data/node_modules/pako/dist/pako_deflate.min.js +1 -0
  148. data/node_modules/pako/dist/pako_inflate.js +3300 -0
  149. data/node_modules/pako/dist/pako_inflate.min.js +1 -0
  150. data/node_modules/pako/index.js +14 -0
  151. data/node_modules/pako/lib/deflate.js +400 -0
  152. data/node_modules/pako/lib/inflate.js +423 -0
  153. data/node_modules/pako/lib/utils/common.js +105 -0
  154. data/node_modules/pako/lib/utils/strings.js +187 -0
  155. data/node_modules/pako/lib/zlib/README +59 -0
  156. data/node_modules/pako/lib/zlib/adler32.js +51 -0
  157. data/node_modules/pako/lib/zlib/constants.js +68 -0
  158. data/node_modules/pako/lib/zlib/crc32.js +59 -0
  159. data/node_modules/pako/lib/zlib/deflate.js +1874 -0
  160. data/node_modules/pako/lib/zlib/gzheader.js +58 -0
  161. data/node_modules/pako/lib/zlib/inffast.js +345 -0
  162. data/node_modules/pako/lib/zlib/inflate.js +1556 -0
  163. data/node_modules/pako/lib/zlib/inftrees.js +343 -0
  164. data/node_modules/pako/lib/zlib/messages.js +32 -0
  165. data/node_modules/pako/lib/zlib/trees.js +1222 -0
  166. data/node_modules/pako/lib/zlib/zstream.js +47 -0
  167. data/node_modules/pako/package.json +44 -0
  168. data/node_modules/path-is-absolute/index.js +20 -0
  169. data/node_modules/path-is-absolute/license +21 -0
  170. data/node_modules/path-is-absolute/package.json +43 -0
  171. data/node_modules/path-is-absolute/readme.md +59 -0
  172. data/node_modules/process-nextick-args/index.js +45 -0
  173. data/node_modules/process-nextick-args/license.md +19 -0
  174. data/node_modules/process-nextick-args/package.json +25 -0
  175. data/node_modules/process-nextick-args/readme.md +18 -0
  176. data/node_modules/readable-stream/.travis.yml +34 -0
  177. data/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  178. data/node_modules/readable-stream/GOVERNANCE.md +136 -0
  179. data/node_modules/readable-stream/LICENSE +47 -0
  180. data/node_modules/readable-stream/README.md +58 -0
  181. data/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
  182. data/node_modules/readable-stream/duplex-browser.js +1 -0
  183. data/node_modules/readable-stream/duplex.js +1 -0
  184. data/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
  185. data/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
  186. data/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
  187. data/node_modules/readable-stream/lib/_stream_transform.js +214 -0
  188. data/node_modules/readable-stream/lib/_stream_writable.js +687 -0
  189. data/node_modules/readable-stream/lib/internal/streams/BufferList.js +79 -0
  190. data/node_modules/readable-stream/lib/internal/streams/destroy.js +74 -0
  191. data/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  192. data/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  193. data/node_modules/readable-stream/package.json +52 -0
  194. data/node_modules/readable-stream/passthrough.js +1 -0
  195. data/node_modules/readable-stream/readable-browser.js +7 -0
  196. data/node_modules/readable-stream/readable.js +19 -0
  197. data/node_modules/readable-stream/transform.js +1 -0
  198. data/node_modules/readable-stream/writable-browser.js +1 -0
  199. data/node_modules/readable-stream/writable.js +8 -0
  200. data/node_modules/rimraf/LICENSE +15 -0
  201. data/node_modules/rimraf/README.md +101 -0
  202. data/node_modules/rimraf/bin.js +50 -0
  203. data/node_modules/rimraf/package.json +29 -0
  204. data/node_modules/rimraf/rimraf.js +372 -0
  205. data/node_modules/safe-buffer/LICENSE +21 -0
  206. data/node_modules/safe-buffer/README.md +584 -0
  207. data/node_modules/safe-buffer/index.d.ts +187 -0
  208. data/node_modules/safe-buffer/index.js +62 -0
  209. data/node_modules/safe-buffer/package.json +37 -0
  210. data/node_modules/selenium-webdriver/CHANGES.md +1114 -0
  211. data/node_modules/selenium-webdriver/LICENSE +202 -0
  212. data/node_modules/selenium-webdriver/NOTICE +2 -0
  213. data/node_modules/selenium-webdriver/README.md +229 -0
  214. data/node_modules/selenium-webdriver/chrome.js +295 -0
  215. data/node_modules/selenium-webdriver/chromium.js +829 -0
  216. data/node_modules/selenium-webdriver/devtools/CDPConnection.js +35 -0
  217. data/node_modules/selenium-webdriver/edge.js +224 -0
  218. data/node_modules/selenium-webdriver/example/chrome_android.js +45 -0
  219. data/node_modules/selenium-webdriver/example/chrome_mobile_emulation.js +46 -0
  220. data/node_modules/selenium-webdriver/example/firefox_channels.js +84 -0
  221. data/node_modules/selenium-webdriver/example/google_search.js +50 -0
  222. data/node_modules/selenium-webdriver/example/google_search_test.js +70 -0
  223. data/node_modules/selenium-webdriver/example/headless.js +63 -0
  224. data/node_modules/selenium-webdriver/example/logging.js +64 -0
  225. data/node_modules/selenium-webdriver/firefox.js +789 -0
  226. data/node_modules/selenium-webdriver/http/index.js +324 -0
  227. data/node_modules/selenium-webdriver/http/util.js +172 -0
  228. data/node_modules/selenium-webdriver/ie.js +503 -0
  229. data/node_modules/selenium-webdriver/index.js +825 -0
  230. data/node_modules/selenium-webdriver/io/exec.js +162 -0
  231. data/node_modules/selenium-webdriver/io/index.js +348 -0
  232. data/node_modules/selenium-webdriver/io/zip.js +223 -0
  233. data/node_modules/selenium-webdriver/lib/atoms/find-elements.js +123 -0
  234. data/node_modules/selenium-webdriver/lib/atoms/get-attribute.js +101 -0
  235. data/node_modules/selenium-webdriver/lib/atoms/is-displayed.js +101 -0
  236. data/node_modules/selenium-webdriver/lib/atoms/mutation-listener.js +55 -0
  237. data/node_modules/selenium-webdriver/lib/by.js +415 -0
  238. data/node_modules/selenium-webdriver/lib/capabilities.js +553 -0
  239. data/node_modules/selenium-webdriver/lib/command.js +206 -0
  240. data/node_modules/selenium-webdriver/lib/error.js +605 -0
  241. data/node_modules/selenium-webdriver/lib/http.js +704 -0
  242. data/node_modules/selenium-webdriver/lib/input.js +946 -0
  243. data/node_modules/selenium-webdriver/lib/logging.js +661 -0
  244. data/node_modules/selenium-webdriver/lib/promise.js +285 -0
  245. data/node_modules/selenium-webdriver/lib/proxy.js +212 -0
  246. data/node_modules/selenium-webdriver/lib/session.js +77 -0
  247. data/node_modules/selenium-webdriver/lib/symbols.js +37 -0
  248. data/node_modules/selenium-webdriver/lib/until.js +429 -0
  249. data/node_modules/selenium-webdriver/lib/webdriver.js +2919 -0
  250. data/node_modules/selenium-webdriver/net/index.js +107 -0
  251. data/node_modules/selenium-webdriver/net/portprober.js +75 -0
  252. data/node_modules/selenium-webdriver/opera.js +406 -0
  253. data/node_modules/selenium-webdriver/package.json +54 -0
  254. data/node_modules/selenium-webdriver/proxy.js +32 -0
  255. data/node_modules/selenium-webdriver/remote/index.js +624 -0
  256. data/node_modules/selenium-webdriver/safari.js +168 -0
  257. data/node_modules/selenium-webdriver/testing/index.js +504 -0
  258. data/node_modules/set-immediate-shim/index.js +7 -0
  259. data/node_modules/set-immediate-shim/package.json +34 -0
  260. data/node_modules/set-immediate-shim/readme.md +31 -0
  261. data/node_modules/string_decoder/.travis.yml +50 -0
  262. data/node_modules/string_decoder/LICENSE +48 -0
  263. data/node_modules/string_decoder/README.md +47 -0
  264. data/node_modules/string_decoder/lib/string_decoder.js +296 -0
  265. data/node_modules/string_decoder/package.json +31 -0
  266. data/node_modules/tmp/CHANGELOG.md +288 -0
  267. data/node_modules/tmp/LICENSE +21 -0
  268. data/node_modules/tmp/README.md +365 -0
  269. data/node_modules/tmp/lib/tmp.js +780 -0
  270. data/node_modules/tmp/node_modules/.bin/rimraf +1 -0
  271. data/node_modules/tmp/node_modules/rimraf/CHANGELOG.md +65 -0
  272. data/node_modules/tmp/node_modules/rimraf/LICENSE +15 -0
  273. data/node_modules/tmp/node_modules/rimraf/README.md +101 -0
  274. data/node_modules/tmp/node_modules/rimraf/bin.js +68 -0
  275. data/node_modules/tmp/node_modules/rimraf/package.json +32 -0
  276. data/node_modules/tmp/node_modules/rimraf/rimraf.js +360 -0
  277. data/node_modules/tmp/package.json +58 -0
  278. data/node_modules/util-deprecate/History.md +16 -0
  279. data/node_modules/util-deprecate/LICENSE +24 -0
  280. data/node_modules/util-deprecate/README.md +53 -0
  281. data/node_modules/util-deprecate/browser.js +67 -0
  282. data/node_modules/util-deprecate/node.js +6 -0
  283. data/node_modules/util-deprecate/package.json +27 -0
  284. data/node_modules/wrappy/LICENSE +15 -0
  285. data/node_modules/wrappy/README.md +36 -0
  286. data/node_modules/wrappy/package.json +29 -0
  287. data/node_modules/wrappy/wrappy.js +33 -0
  288. data/node_modules/ws/LICENSE +21 -0
  289. data/node_modules/ws/README.md +496 -0
  290. data/node_modules/ws/browser.js +8 -0
  291. data/node_modules/ws/index.js +10 -0
  292. data/node_modules/ws/lib/buffer-util.js +129 -0
  293. data/node_modules/ws/lib/constants.js +10 -0
  294. data/node_modules/ws/lib/event-target.js +184 -0
  295. data/node_modules/ws/lib/extension.js +223 -0
  296. data/node_modules/ws/lib/limiter.js +55 -0
  297. data/node_modules/ws/lib/permessage-deflate.js +517 -0
  298. data/node_modules/ws/lib/receiver.js +507 -0
  299. data/node_modules/ws/lib/sender.js +405 -0
  300. data/node_modules/ws/lib/stream.js +165 -0
  301. data/node_modules/ws/lib/validation.js +104 -0
  302. data/node_modules/ws/lib/websocket-server.js +418 -0
  303. data/node_modules/ws/lib/websocket.js +942 -0
  304. data/node_modules/ws/package.json +56 -0
  305. data/package-lock.json +458 -0
  306. data/package.json +5 -0
  307. data/selenium.log +1 -0
  308. metadata +314 -19
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2021 Software Freedom Conservancy (SFC)
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,2 @@
1
+ Copyright 2011-2021 Software Freedom Conservancy
2
+ Copyright 2004-2011 Selenium committers
@@ -0,0 +1,229 @@
1
+ # selenium-webdriver
2
+
3
+ Selenium is a browser automation library. Most often used for testing
4
+ web-applications, Selenium may be used for any task that requires automating
5
+ interaction with the browser.
6
+
7
+ ## Installation
8
+
9
+ Selenium may be installed via npm with
10
+
11
+ npm install selenium-webdriver
12
+
13
+ You will need to download additional components to work with each of the major
14
+ browsers. The drivers for Chrome, Firefox, and Microsoft's IE and Edge web
15
+ browsers are all standalone executables that should be placed on your system
16
+ [PATH]. Apple's safaridriver is shipped with Safari 10 for OS X El Capitan and
17
+ macOS Sierra. You will need to enable Remote Automation in the Develop menu of
18
+ Safari 10 before testing.
19
+
20
+
21
+ | Browser | Component |
22
+ | ----------------- | ---------------------------------- |
23
+ | Chrome | [chromedriver(.exe)][chrome] |
24
+ | Internet Explorer | [IEDriverServer.exe][release] |
25
+ | Edge | [MicrosoftWebDriver.msi][edge] |
26
+ | Firefox | [geckodriver(.exe)][geckodriver] |
27
+ | Opera | [operadriver(.exe)][operadriver] |
28
+ | Safari | [safaridriver] |
29
+
30
+ ## Usage
31
+
32
+ The sample below and others are included in the `example` directory. You may
33
+ also find the tests for selenium-webdriver informative.
34
+
35
+ ```javascript
36
+ const {Builder, By, Key, until} = require('selenium-webdriver');
37
+
38
+ (async function example() {
39
+ let driver = await new Builder().forBrowser('firefox').build();
40
+ try {
41
+ await driver.get('http://www.google.com/ncr');
42
+ await driver.findElement(By.name('q')).sendKeys('webdriver', Key.RETURN);
43
+ await driver.wait(until.titleIs('webdriver - Google Search'), 1000);
44
+ } finally {
45
+ await driver.quit();
46
+ }
47
+ })();
48
+ ```
49
+
50
+ ### Using the Builder API
51
+
52
+ The `Builder` class is your one-stop shop for configuring new WebDriver
53
+ instances. Rather than clutter your code with branches for the various browsers,
54
+ the builder lets you set all options in one flow. When you call
55
+ `Builder#build()`, all options irrelevant to the selected browser are dropped:
56
+
57
+ ```javascript
58
+ const webdriver = require('selenium-webdriver');
59
+ const chrome = require('selenium-webdriver/chrome');
60
+ const firefox = require('selenium-webdriver/firefox');
61
+
62
+ let driver = new webdriver.Builder()
63
+ .forBrowser('firefox')
64
+ .setChromeOptions(/* ... */)
65
+ .setFirefoxOptions(/* ... */)
66
+ .build();
67
+ ```
68
+
69
+ Why would you want to configure options irrelevant to the target browser? The
70
+ `Builder`'s API defines your _default_ configuration. You can change the target
71
+ browser at runtime through the `SELENIUM_BROWSER` environment variable. For
72
+ example, the `example/google_search.js` script is configured to run against
73
+ Firefox. You can run the example against other browsers just by changing the
74
+ runtime environment
75
+
76
+ # cd node_modules/selenium-webdriver
77
+ node example/google_search
78
+ SELENIUM_BROWSER=chrome node example/google_search
79
+ SELENIUM_BROWSER=safari node example/google_search
80
+
81
+ ### The Standalone Selenium Server
82
+
83
+ The standalone Selenium Server acts as a proxy between your script and the
84
+ browser-specific drivers. The server may be used when running locally, but it's
85
+ not recommend as it introduces an extra hop for each request and will slow
86
+ things down. The server is required, however, to use a browser on a remote host
87
+ (most browser drivers, like the IEDriverServer, do not accept remote
88
+ connections).
89
+
90
+ To use the Selenium Server, you will need to install the
91
+ [JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html) and
92
+ download the latest server from [Selenium][release]. Once downloaded, run the
93
+ server with
94
+
95
+ java -jar selenium-server-standalone-2.45.0.jar
96
+
97
+ You may configure your tests to run against a remote server through the Builder
98
+ API:
99
+
100
+ ```javascript
101
+ let driver = new webdriver.Builder()
102
+ .forBrowser('firefox')
103
+ .usingServer('http://localhost:4444/wd/hub')
104
+ .build();
105
+ ```
106
+ Or change the Builder's configuration at runtime with the `SELENIUM_REMOTE_URL`
107
+ environment variable:
108
+
109
+ SELENIUM_REMOTE_URL="http://localhost:4444/wd/hub" node script.js
110
+
111
+ You can experiment with these options using the `example/google_search.js`
112
+ script provided with `selenium-webdriver`.
113
+
114
+ ## Documentation
115
+
116
+ API documentation is available online from the [Selenium project][api].
117
+ Additional resources include
118
+
119
+ - the #selenium channel on freenode IRC
120
+ - the [selenium-users@googlegroups.com][users] list
121
+ - [SeleniumHQ](https://selenium.dev/documentation/) documentation
122
+
123
+ ## Contributing
124
+
125
+ Contributions are accepted either through [GitHub][gh] pull requests or patches
126
+ via the [Selenium issue tracker][issues].
127
+
128
+ ## Node Support Policy
129
+
130
+ Each version of selenium-webdriver will support the latest _semver-minor_
131
+ version of the [LTS] and stable Node releases. All _semver-major_ &
132
+ _semver-minor_ versions between the LTS and stable release will have "best
133
+ effort" support. Following a Selenium release, any _semver-minor_ Node releases
134
+ will also have "best effort" support. Releases older than the latest LTS,
135
+ _semver-major_ releases, and all unstable release branches (e.g. "v.Next")
136
+ are considered strictly unsupported.
137
+
138
+ For example, suppose the current LTS and stable releases are v6.9.5 and v7.5.0,
139
+ respectively. Then a Selenium release would have the following support levels:
140
+
141
+ | Version | Support |
142
+ | ------- | ------------- |
143
+ | <= 6.8 | _unsupported_ |
144
+ | 6.9 | supported |
145
+ | 7.0-4 | best effort |
146
+ | 7.5 | supported |
147
+ | >= 7.5 | best effort |
148
+ | v.Next | _unsupported_ |
149
+
150
+ ### Support Level Definitions
151
+
152
+ - _supported:_ A selenium-webdriver release will be API compatible with the
153
+ platform API, without the use of runtime flags.
154
+
155
+ - _best effort:_ Bugs will be investigated as time permits. API compatibility is
156
+ only guaranteed where required by a _supported_ release. This effectively
157
+ means the adoption of new JS features, such as ES2015 modules, will depend
158
+ on what is supported in Node's LTS.
159
+
160
+ - _unsupported:_ Bug submissions will be closed as will-not-fix and API
161
+ compatibility is not guaranteed.
162
+
163
+ ### Projected Support Schedule
164
+
165
+ If Node releases a new [LTS] each October and a new major version every 6
166
+ months, the support window for selenium-webdriver will be roughly:
167
+
168
+ | Date | LTS | Stable |
169
+ | --------- | ---: | -----: |
170
+ | (current) | 8.9 | 9.0 |
171
+ | 2018-04 | 8.x | 10.0 |
172
+ | 2018-10 | 10.x | 11.0 |
173
+ | 2019-04 | 10.x | 12.0 |
174
+ | 2019-10 | 12.x | 13.0 |
175
+
176
+ ## Issues
177
+
178
+ Please report any issues using the [Selenium issue tracker][issues]. When using
179
+ the issue tracker
180
+
181
+ - __Do__ include a detailed description of the problem.
182
+ - __Do__ include a link to a [gist](http://gist.github.com/) with any
183
+ interesting stack traces/logs (you may also attach these directly to the bug
184
+ report).
185
+ - __Do__ include a [reduced test case][reduction]. Reporting "unable to find
186
+ element on the page" is _not_ a valid report - there's nothing for us to
187
+ look into. Expect your bug report to be closed if you do not provide enough
188
+ information for us to investigate.
189
+ - __Do not__ use the issue tracker to submit basic help requests. All help
190
+ inquiries should be directed to the [user forum][users] or #selenium IRC
191
+ channel.
192
+ - __Do not__ post empty "I see this too" or "Any updates?" comments. These
193
+ provide no additional information and clutter the log.
194
+ - __Do not__ report regressions on closed bugs as they are not actively
195
+ monitored for updates (especially bugs that are >6 months old). Please open a
196
+ new issue and reference the original bug in your report.
197
+
198
+ ## License
199
+
200
+ Licensed to the Software Freedom Conservancy (SFC) under one
201
+ or more contributor license agreements. See the NOTICE file
202
+ distributed with this work for additional information
203
+ regarding copyright ownership. The SFC licenses this file
204
+ to you under the Apache License, Version 2.0 (the
205
+ "License"); you may not use this file except in compliance
206
+ with the License. You may obtain a copy of the License at
207
+
208
+ http://www.apache.org/licenses/LICENSE-2.0
209
+
210
+ Unless required by applicable law or agreed to in writing,
211
+ software distributed under the License is distributed on an
212
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
213
+ KIND, either express or implied. See the License for the
214
+ specific language governing permissions and limitations
215
+ under the License.
216
+
217
+ [LTS]: https://github.com/nodejs/LTS
218
+ [PATH]: http://en.wikipedia.org/wiki/PATH_%28variable%29
219
+ [api]: http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/
220
+ [chrome]: http://chromedriver.storage.googleapis.com/index.html
221
+ [gh]: https://github.com/SeleniumHQ/selenium/
222
+ [issues]: https://github.com/SeleniumHQ/selenium/issues
223
+ [edge]: http://go.microsoft.com/fwlink/?LinkId=619687
224
+ [geckodriver]: https://github.com/mozilla/geckodriver/releases/
225
+ [reduction]: http://www.webkit.org/quality/reduction.html
226
+ [release]: http://selenium-release.storage.googleapis.com/index.html
227
+ [users]: https://groups.google.com/forum/#!forum/selenium-users
228
+ [safaridriver]: https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_10_0.html#//apple_ref/doc/uid/TP40014305-CH11-DontLinkElementID_28
229
+ [operadriver]: https://github.com/operasoftware/operachromiumdriver/releases
@@ -0,0 +1,295 @@
1
+ // Licensed to the Software Freedom Conservancy (SFC) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The SFC licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+
18
+ /**
19
+ * @fileoverview Defines a {@linkplain Driver WebDriver} client for the Chrome
20
+ * web browser. Before using this module, you must download the latest
21
+ * [ChromeDriver release] and ensure it can be found on your system [PATH].
22
+ *
23
+ * There are three primary classes exported by this module:
24
+ *
25
+ * 1. {@linkplain ServiceBuilder}: configures the
26
+ * {@link selenium-webdriver/remote.DriverService remote.DriverService}
27
+ * that manages the [ChromeDriver] child process.
28
+ *
29
+ * 2. {@linkplain Options}: defines configuration options for each new Chrome
30
+ * session, such as which {@linkplain Options#setProxy proxy} to use,
31
+ * what {@linkplain Options#addExtensions extensions} to install, or
32
+ * what {@linkplain Options#addArguments command-line switches} to use when
33
+ * starting the browser.
34
+ *
35
+ * 3. {@linkplain Driver}: the WebDriver client; each new instance will control
36
+ * a unique browser session with a clean user profile (unless otherwise
37
+ * configured through the {@link Options} class).
38
+ *
39
+ * __Headless Chrome__ <a id="headless"></a>
40
+ *
41
+ * To start Chrome in headless mode, simply call
42
+ * {@linkplain Options#headless Options.headless()}.
43
+ *
44
+ * let chrome = require('selenium-webdriver/chrome');
45
+ * let {Builder} = require('selenium-webdriver');
46
+ *
47
+ * let driver = new Builder()
48
+ * .forBrowser('chrome')
49
+ * .setChromeOptions(new chrome.Options().headless())
50
+ * .build();
51
+ *
52
+ * __Customizing the ChromeDriver Server__ <a id="custom-server"></a>
53
+ *
54
+ * By default, every Chrome session will use a single driver service, which is
55
+ * started the first time a {@link Driver} instance is created and terminated
56
+ * when this process exits. The default service will inherit its environment
57
+ * from the current process and direct all output to /dev/null. You may obtain
58
+ * a handle to this default service using
59
+ * {@link #getDefaultService getDefaultService()} and change its configuration
60
+ * with {@link #setDefaultService setDefaultService()}.
61
+ *
62
+ * You may also create a {@link Driver} with its own driver service. This is
63
+ * useful if you need to capture the server's log output for a specific session:
64
+ *
65
+ * let chrome = require('selenium-webdriver/chrome');
66
+ *
67
+ * let service = new chrome.ServiceBuilder()
68
+ * .loggingTo('/my/log/file.txt')
69
+ * .enableVerboseLogging()
70
+ * .build();
71
+ *
72
+ * let options = new chrome.Options();
73
+ * // configure browser options ...
74
+ *
75
+ * let driver = chrome.Driver.createSession(options, service);
76
+ *
77
+ * Users should only instantiate the {@link Driver} class directly when they
78
+ * need a custom driver service configuration (as shown above). For normal
79
+ * operation, users should start Chrome using the
80
+ * {@link selenium-webdriver.Builder}.
81
+ *
82
+ * __Working with Android__ <a id="android"></a>
83
+ *
84
+ * The [ChromeDriver][android] supports running tests on the Chrome browser as
85
+ * well as [WebView apps][webview] starting in Android 4.4 (KitKat). In order to
86
+ * work with Android, you must first start the adb
87
+ *
88
+ * adb start-server
89
+ *
90
+ * By default, adb will start on port 5037. You may change this port, but this
91
+ * will require configuring a [custom server](#custom-server) that will connect
92
+ * to adb on the {@linkplain ServiceBuilder#setAdbPort correct port}:
93
+ *
94
+ * let service = new chrome.ServiceBuilder()
95
+ * .setAdbPort(1234)
96
+ * build();
97
+ * // etc.
98
+ *
99
+ * The ChromeDriver may be configured to launch Chrome on Android using
100
+ * {@link Options#androidChrome()}:
101
+ *
102
+ * let driver = new Builder()
103
+ * .forBrowser('chrome')
104
+ * .setChromeOptions(new chrome.Options().androidChrome())
105
+ * .build();
106
+ *
107
+ * Alternatively, you can configure the ChromeDriver to launch an app with a
108
+ * Chrome-WebView by setting the {@linkplain Options#androidActivity
109
+ * androidActivity} option:
110
+ *
111
+ * let driver = new Builder()
112
+ * .forBrowser('chrome')
113
+ * .setChromeOptions(new chrome.Options()
114
+ * .androidPackage('com.example')
115
+ * .androidActivity('com.example.Activity'))
116
+ * .build();
117
+ *
118
+ * [Refer to the ChromeDriver site] for more information on using the
119
+ * [ChromeDriver with Android][android].
120
+ *
121
+ * [ChromeDriver]: https://chromedriver.chromium.org/
122
+ * [ChromeDriver release]: http://chromedriver.storage.googleapis.com/index.html
123
+ * [PATH]: http://en.wikipedia.org/wiki/PATH_%28variable%29
124
+ * [android]: https://chromedriver.chromium.org/getting-started/getting-started---android
125
+ * [webview]: https://developer.chrome.com/multidevice/webview/overview
126
+ */
127
+
128
+ 'use strict'
129
+
130
+ const io = require('./io')
131
+ const { Browser } = require('./lib/capabilities')
132
+ const chromium = require('./chromium')
133
+
134
+ /**
135
+ * Name of the ChromeDriver executable.
136
+ * @type {string}
137
+ * @const
138
+ */
139
+ const CHROMEDRIVER_EXE =
140
+ process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver'
141
+
142
+ /** @type {remote.DriverService} */
143
+ let defaultService = null
144
+
145
+ /**
146
+ * Creates {@link selenium-webdriver/remote.DriverService} instances that manage
147
+ * a [ChromeDriver](https://chromedriver.chromium.org/)
148
+ * server in a child process.
149
+ */
150
+ class ServiceBuilder extends chromium.ServiceBuilder {
151
+ /**
152
+ * @param {string=} opt_exe Path to the server executable to use. If omitted,
153
+ * the builder will attempt to locate the chromedriver on the current
154
+ * PATH.
155
+ * @throws {Error} If provided executable does not exist, or the chromedriver
156
+ * cannot be found on the PATH.
157
+ */
158
+ constructor(opt_exe) {
159
+ let exe = opt_exe || locateSynchronously()
160
+ if (!exe) {
161
+ throw Error(
162
+ `The ChromeDriver could not be found on the current PATH. Please ` +
163
+ `download the latest version of the ChromeDriver from ` +
164
+ `http://chromedriver.storage.googleapis.com/index.html and ensure ` +
165
+ `it can be found on your PATH.`
166
+ )
167
+ }
168
+ super(exe)
169
+ }
170
+ }
171
+
172
+ /**
173
+ * Class for managing ChromeDriver specific options.
174
+ */
175
+ class Options extends chromium.Options {
176
+ /**
177
+ * Sets the path to the Chrome binary to use. On Mac OS X, this path should
178
+ * reference the actual Chrome executable, not just the application binary
179
+ * (e.g. "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome").
180
+ *
181
+ * The binary path be absolute or relative to the chromedriver server
182
+ * executable, but it must exist on the machine that will launch Chrome.
183
+ *
184
+ * @param {string} path The path to the Chrome binary to use.
185
+ * @return {!Options} A self reference.
186
+ */
187
+ setChromeBinaryPath(path) {
188
+ return this.setBinaryPath(path)
189
+ }
190
+
191
+ /**
192
+ * Configures the ChromeDriver to launch Chrome on Android via adb. This
193
+ * function is shorthand for
194
+ * {@link #androidPackage options.androidPackage('com.android.chrome')}.
195
+ * @return {!Options} A self reference.
196
+ */
197
+ androidChrome() {
198
+ return this.androidPackage('com.android.chrome')
199
+ }
200
+
201
+ /**
202
+ * Sets the path to Chrome's log file. This path should exist on the machine
203
+ * that will launch Chrome.
204
+ * @param {string} path Path to the log file to use.
205
+ * @return {!Options} A self reference.
206
+ */
207
+ setChromeLogFile(path) {
208
+ return this.setBrowserLogFile(path)
209
+ }
210
+
211
+ /**
212
+ * Sets the directory to store Chrome minidumps in. This option is only
213
+ * supported when ChromeDriver is running on Linux.
214
+ * @param {string} path The directory path.
215
+ * @return {!Options} A self reference.
216
+ */
217
+ setChromeMinidumpPath(path) {
218
+ return this.setBrowserMinidumpPath(path)
219
+ }
220
+ }
221
+
222
+ /**
223
+ * Creates a new WebDriver client for Chrome.
224
+ */
225
+ class Driver extends chromium.Driver {
226
+ /**
227
+ * Creates a new session with the ChromeDriver.
228
+ *
229
+ * @param {(Capabilities|Options)=} opt_config The configuration options.
230
+ * @param {(remote.DriverService|http.Executor)=} opt_serviceExecutor Either
231
+ * a DriverService to use for the remote end, or a preconfigured executor
232
+ * for an externally managed endpoint. If neither is provided, the
233
+ * {@linkplain ##getDefaultService default service} will be used by
234
+ * default.
235
+ * @return {!Driver} A new driver instance.
236
+ */
237
+ static createSession(opt_config, opt_serviceExecutor) {
238
+ let caps = opt_config || new Options()
239
+ return /** @type {!Driver} */ (super.createSession(
240
+ caps,
241
+ opt_serviceExecutor
242
+ ))
243
+ }
244
+ }
245
+
246
+ /**
247
+ * _Synchronously_ attempts to locate the chromedriver executable on the current
248
+ * system.
249
+ *
250
+ * @return {?string} the located executable, or `null`.
251
+ */
252
+ function locateSynchronously() {
253
+ return io.findInPath(CHROMEDRIVER_EXE, true)
254
+ }
255
+
256
+ /**
257
+ * Sets the default service to use for new ChromeDriver instances.
258
+ * @param {!remote.DriverService} service The service to use.
259
+ * @throws {Error} If the default service is currently running.
260
+ */
261
+ function setDefaultService(service) {
262
+ if (defaultService && defaultService.isRunning()) {
263
+ throw Error(
264
+ `The previously configured ChromeDriver service is still running. ` +
265
+ `You must shut it down before you may adjust its configuration.`
266
+ )
267
+ }
268
+ defaultService = service
269
+ }
270
+
271
+ /**
272
+ * Returns the default ChromeDriver service. If such a service has not been
273
+ * configured, one will be constructed using the default configuration for
274
+ * a ChromeDriver executable found on the system PATH.
275
+ * @return {!remote.DriverService} The default ChromeDriver service.
276
+ */
277
+ function getDefaultService() {
278
+ if (!defaultService) {
279
+ defaultService = new ServiceBuilder().build()
280
+ }
281
+ return defaultService
282
+ }
283
+
284
+ Options.prototype.CAPABILITY_KEY = 'goog:chromeOptions'
285
+ Options.prototype.BROWSER_NAME_VALUE = Browser.CHROME
286
+ Driver.getDefaultService = getDefaultService
287
+ Driver.prototype.VENDOR_COMMAND_PREFIX = 'goog'
288
+
289
+ // PUBLIC API
290
+ exports.Driver = Driver
291
+ exports.Options = Options
292
+ exports.ServiceBuilder = ServiceBuilder
293
+ exports.getDefaultService = getDefaultService
294
+ exports.setDefaultService = setDefaultService
295
+ exports.locateSynchronously = locateSynchronously