Skip to content

Commit 1d42807

Browse files
committed
fix misapplication of geckodriver package (accidentally deleted) [run ci]
1 parent 78060ef commit 1d42807

File tree

1 file changed

+370
-0
lines changed

1 file changed

+370
-0
lines changed
Lines changed: 370 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,370 @@
1+
diff --git a/node_modules/geckodriver/AUTHORS b/node_modules/geckodriver/AUTHORS
2+
old mode 100644
3+
new mode 100755
4+
diff --git a/node_modules/geckodriver/LICENSE b/node_modules/geckodriver/LICENSE
5+
old mode 100644
6+
new mode 100755
7+
diff --git a/node_modules/geckodriver/README.md b/node_modules/geckodriver/README.md
8+
deleted file mode 100644
9+
index 95e3ef0..0000000
10+
--- a/node_modules/geckodriver/README.md
11+
+++ /dev/null
12+
@@ -1,239 +0,0 @@
13+
-Geckodriver [![CI](https://github.com/webdriverio-community/node-geckodriver/actions/workflows/ci.yml/badge.svg)](https://github.com/webdriverio-community/node-geckodriver/actions/workflows/ci.yml) [![Audit](https://github.com/webdriverio-community/node-geckodriver/actions/workflows/audit.yml/badge.svg)](https://github.com/webdriverio-community/node-geckodriver/actions/workflows/audit.yml)
14+
-==========
15+
-
16+
-An NPM wrapper for Mozilla's [Geckodriver](https://github.com/mozilla/geckodriver). It manages to download various (or the latest) Geckodriver versions and provides a programmatic interface to start and stop it within Node.js. __Note:__ this is a wrapper module. If you discover any bugs with Geckodriver, please report them in the [official repository](https://github.com/mozilla/geckodriver).
17+
-
18+
-# Installing
19+
-
20+
-You can install this package via:
21+
-
22+
-```sh
23+
-npm install geckodriver
24+
-```
25+
-
26+
-Or install it globally:
27+
-
28+
-```sh
29+
-npm install -g geckodriver
30+
-```
31+
-
32+
-__Note:__ This installs a `geckodriver` shell script that runs the executable, but on Windows, [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) looks for `geckodriver.exe`. To use a global installation of this package with [`selenium-webdriver`](https://www.npmjs.com/package/selenium-webdriver) on Windows, copy or link `geckodriver.exe` to a location on your `PATH` (such as the NPM bin directory) after installing this package:
33+
-
34+
-```sh
35+
-mklink %USERPROFILE%\AppData\Roaming\npm\geckodriver.exe %USERPROFILE%\AppData\Roaming\npm\node_modules\geckodriver\geckodriver.exe
36+
-```
37+
-
38+
-Once installed you can start Geckodriver via:
39+
-
40+
-```sh
41+
-npx geckodriver --port=4444
42+
-```
43+
-
44+
-By default, this package downloads Geckodriver when used for the first time through the CLI or the programmatic interface. If you like to download it as part of the NPM install process, set the `GECKODRIVER_AUTO_INSTALL` environment flag, e.g.:
45+
-
46+
-```sh
47+
-GECKODRIVER_AUTO_INSTALL=1 npm i
48+
-```
49+
-
50+
-To get a list of available CLI options run `npx geckodriver --help`. By default, this package downloads the latest version of the driver. If you prefer to have it install a custom Geckodriver version you can define the environment variable `GECKODRIVER_VERSION` when running in CLI, e.g.:
51+
-
52+
-```sh
53+
-$ npm i geckodriver
54+
-$ GECKODRIVER_VERSION="0.31.0" npx geckodriver --version
55+
-geckodriver 0.31.0 (b617178ef491 2022-04-06 11:57 +0000)
56+
-
57+
-The source code of this program is available from
58+
-testing/geckodriver in https://hg.mozilla.org/mozilla-central.
59+
-
60+
-This program is subject to the terms of the Mozilla Public License 2.0.
61+
-You can obtain a copy of the license at https://mozilla.org/MPL/2.0/.
62+
-```
63+
-
64+
-## Setting a CDN URL for binary download
65+
-
66+
-To set an alternate CDN location for Geckodriver binaries, set the `GECKODRIVER_CDNURL` like this:
67+
-
68+
-```sh
69+
-GECKODRIVER_CDNURL=https://INTERNAL_CDN/geckodriver/download
70+
-```
71+
-
72+
-Binaries on your CDN should be located in a subdirectory of the above base URL. For example, `/vxx.xx.xx/*.tar.gz` should be located under `/geckodriver/download` above.
73+
-
74+
-Alternatively, you can add the same property to your .npmrc file.
75+
-
76+
-The default location is set to https://github.com/mozilla/geckodriver/releases/download
77+
-
78+
-## Setting a PROXY URL
79+
-
80+
-Use `HTTPS_PROXY` or `HTTP_PROXY` to set your proxy URL.
81+
-
82+
-# Programmatic Interface
83+
-
84+
-You can import this package with Node.js and start the driver as part of your script and use it e.g. with [WebdriverIO](https://webdriver.io).
85+
-
86+
-## Exported Methods
87+
-
88+
-The package exports a `start` and `download` method.
89+
-
90+
-### `start`
91+
-
92+
-Starts a Geckodriver instance and returns a [`ChildProcess`](https://nodejs.org/api/child_process.html#class-childprocess). If Geckodriver is not downloaded it will download it for you.
93+
-
94+
-__Params:__ `GeckodriverParameters` - options to pass into Geckodriver (see below)
95+
-
96+
-__Example:__
97+
-
98+
-```js
99+
-import { start } from 'geckodriver';
100+
-import { remote } from 'webdriverio';
101+
-import waitPort from 'wait-port';
102+
-
103+
-/**
104+
- * first start Geckodriver
105+
- */
106+
-const cp = await start({ port: 4444 });
107+
-
108+
-/**
109+
- * wait for Geckodriver to be up
110+
- */
111+
-await waitPort({ port: 4444 });
112+
-
113+
-/**
114+
- * then start WebdriverIO session
115+
- */
116+
-const browser = await remote({ capabilities: { browserName: 'firefox' } });
117+
-await browser.url('https://webdriver.io');
118+
-console.log(await browser.getTitle()); // prints "WebdriverIO · Next-gen browser and mobile automation test framework for Node.js | WebdriverIO"
119+
-
120+
-/**
121+
- * kill Geckodriver process
122+
- */
123+
-cp.kill();
124+
-```
125+
-
126+
-__Note:__ as you can see in the example above this package does not wait for the driver to be up, you have to manage this yourself through packages like [`wait-on`](https://github.com/jeffbski/wait-on).
127+
-
128+
-### `download`
129+
-
130+
-Method to download a Geckodriver with a particular version. If a version parameter is omitted it tries to download the latest available version of the driver.
131+
-
132+
-__Params:__ `string` - version of Geckodriver to download (optional)
133+
-
134+
-## CJS Support
135+
-
136+
-In case your module uses CJS you can use this package as follows:
137+
-
138+
-```js
139+
-const { start } = require('geckodriver')
140+
-// see example above
141+
-```
142+
-
143+
-## Options
144+
-
145+
-The `start` method offers the following options to be passed on to the actual Geckodriver CLI.
146+
-
147+
-### `allowHosts`
148+
-
149+
-List of host names to allow. By default, the value of --host is allowed, and in addition, if that's a well-known local address, other variations on well-known local addresses are allowed. If --allow-hosts is provided only exactly those hosts are allowed.
150+
-
151+
-Type: `string[]`<br />
152+
-Default: `[]`
153+
-
154+
-### `allowOrigins`
155+
-List of request origins to allow. These must be formatted as `scheme://host:port`. By default, any request with an origin header is rejected. If `--allow-origins` is provided then only exactly those origins are allowed.
156+
-
157+
-Type: `string[]`<br />
158+
-Default: `[]`
159+
-
160+
-### `binary`
161+
-Path to the Firefox binary.
162+
-
163+
-Type: `string`
164+
-
165+
-### `connectExisting`
166+
-Connect to an existing Firefox instance.
167+
-
168+
-Type: `boolean`<br />
169+
-Default: `false`
170+
-
171+
-### `host`
172+
-Host IP to use for WebDriver server.
173+
-
174+
-Type: `string`<br />
175+
-Default: `0.0.0.0`
176+
-
177+
-### `jsdebugger`
178+
-Attach browser toolbox debugger for Firefox.
179+
-
180+
-Type: `boolean`<br />
181+
-Default: `false`
182+
-
183+
-### `log`
184+
-Set Gecko log level [possible values: `fatal`, `error`, `warn`, `info`, `config`, `debug`, `trace`].
185+
-
186+
-Type: `string`
187+
-
188+
-### `logNoTruncated`
189+
-Write server log to file instead of stderr, increases log level to `INFO`.
190+
-
191+
-Type: `boolean`
192+
-
193+
-### `marionetteHost`
194+
-Host to use to connect to Gecko.
195+
-
196+
-Type: `boolean`<br />
197+
-Default: `127.0.0.1`
198+
-
199+
-### `marionettePort`
200+
-Port to use to connect to Gecko.
201+
-
202+
-Type: `number`<br />
203+
-Default: `0`
204+
-
205+
-### `port`
206+
-Port to listen on.
207+
-
208+
-Type: `number`
209+
-
210+
-### `profileRoot`
211+
-Directory in which to create profiles. Defaults to the system temporary directory.
212+
-
213+
-Type: `string`
214+
-
215+
-### `geckoDriverVersion`
216+
-A version of Geckodriver to start. See https://github.com/mozilla/geckodriver/releases for all available versions, platforms and architecture.
217+
-
218+
-Type: `string`
219+
-
220+
-### `customGeckoDriverPath`
221+
-Don't download Geckodriver, instead use a custom path to it, e.g. a cached binary.
222+
-
223+
-Type: `string`<br />
224+
-Default: `process.env.GECKODRIVER_PATH`
225+
-
226+
-### `cacheDir`
227+
-The path to the root of the cache directory.
228+
-
229+
-Type: `string`<br />
230+
-Default: `process.env.GECKODRIVER_CACHE_DIR || os.tmpdir()`
231+
-
232+
-### `spawnOpts`
233+
-Options to pass into the geckodriver process. This can be useful if needing
234+
-Firefox to spawn with `MOZ_` prefix variables, such as `MOZ_HEADLESS_WIDTH`.
235+
-See https://nodejs.org/api/child_process.html#child_processspawncommand-args-options for
236+
-all options.
237+
-
238+
-Type: `SpawnOptionsWithoutStdio | SpawnOptionsWithStdioTuple`<br />
239+
-Default: `undefined`
240+
-
241+
-# Other Browser Driver
242+
-
243+
-If you also look for other browser driver NPM wrappers, you can find them here:
244+
-
245+
-- Chrome: [giggio/node-chromedriver](https://github.com/giggio/node-chromedriver)
246+
-- Microsoft Edge: [webdriverio-community/node-edgedriver](https://github.com/webdriverio-community/node-edgedriver)
247+
-- Safari: [webdriverio-community/node-safaridriver](https://github.com/webdriverio-community/node-safaridriver)
248+
-
249+
----
250+
-
251+
-For more information on WebdriverIO see the [homepage](https://webdriver.io).
252+
diff --git a/node_modules/geckodriver/dist/cjs/index.d.ts b/node_modules/geckodriver/dist/cjs/index.d.ts
253+
old mode 100644
254+
new mode 100755
255+
diff --git a/node_modules/geckodriver/dist/cjs/index.d.ts.map b/node_modules/geckodriver/dist/cjs/index.d.ts.map
256+
old mode 100644
257+
new mode 100755
258+
diff --git a/node_modules/geckodriver/dist/cjs/index.js b/node_modules/geckodriver/dist/cjs/index.js
259+
old mode 100644
260+
new mode 100755
261+
diff --git a/node_modules/geckodriver/dist/cjs/index.js.map b/node_modules/geckodriver/dist/cjs/index.js.map
262+
old mode 100644
263+
new mode 100755
264+
diff --git a/node_modules/geckodriver/dist/cli.d.ts b/node_modules/geckodriver/dist/cli.d.ts
265+
old mode 100644
266+
new mode 100755
267+
diff --git a/node_modules/geckodriver/dist/cli.d.ts.map b/node_modules/geckodriver/dist/cli.d.ts.map
268+
old mode 100644
269+
new mode 100755
270+
diff --git a/node_modules/geckodriver/dist/cli.js b/node_modules/geckodriver/dist/cli.js
271+
old mode 100644
272+
new mode 100755
273+
diff --git a/node_modules/geckodriver/dist/cli.js.map b/node_modules/geckodriver/dist/cli.js.map
274+
old mode 100644
275+
new mode 100755
276+
diff --git a/node_modules/geckodriver/dist/constants.d.ts b/node_modules/geckodriver/dist/constants.d.ts
277+
old mode 100644
278+
new mode 100755
279+
diff --git a/node_modules/geckodriver/dist/constants.d.ts.map b/node_modules/geckodriver/dist/constants.d.ts.map
280+
old mode 100644
281+
new mode 100755
282+
diff --git a/node_modules/geckodriver/dist/constants.js b/node_modules/geckodriver/dist/constants.js
283+
old mode 100644
284+
new mode 100755
285+
diff --git a/node_modules/geckodriver/dist/constants.js.map b/node_modules/geckodriver/dist/constants.js.map
286+
old mode 100644
287+
new mode 100755
288+
diff --git a/node_modules/geckodriver/dist/index.d.ts b/node_modules/geckodriver/dist/index.d.ts
289+
old mode 100644
290+
new mode 100755
291+
diff --git a/node_modules/geckodriver/dist/index.d.ts.map b/node_modules/geckodriver/dist/index.d.ts.map
292+
old mode 100644
293+
new mode 100755
294+
diff --git a/node_modules/geckodriver/dist/index.js b/node_modules/geckodriver/dist/index.js
295+
old mode 100644
296+
new mode 100755
297+
index 2edc6d2..d0b456e
298+
--- a/node_modules/geckodriver/dist/index.js
299+
+++ b/node_modules/geckodriver/dist/index.js
300+
@@ -1,10 +1,14 @@
301+
import cp from 'node:child_process';
302+
import logger from '@wdio/logger';
303+
+import debugModule from 'debug'
304+
import { download as downloadDriver } from './install.js';
305+
import { hasAccess, parseParams } from './utils.js';
306+
import { DEFAULT_HOSTNAME } from './constants.js';
307+
const log = logger('geckodriver');
308+
export async function start(params) {
309+
+ // wrap in cypress debugger statement to avoid extraneous messages to the console
310+
+ log.setLevel(debugModule.enabled('cypress-verbose:server:browsers:geckodriver') ? 'info' : 'silent')
311+
+
312+
const { cacheDir, customGeckoDriverPath, spawnOpts, ...startArgs } = params;
313+
let geckoDriverPath = (customGeckoDriverPath ||
314+
process.env.GECKODRIVER_PATH ||
315+
diff --git a/node_modules/geckodriver/dist/index.js.map b/node_modules/geckodriver/dist/index.js.map
316+
old mode 100644
317+
new mode 100755
318+
diff --git a/node_modules/geckodriver/dist/install.d.ts b/node_modules/geckodriver/dist/install.d.ts
319+
old mode 100644
320+
new mode 100755
321+
diff --git a/node_modules/geckodriver/dist/install.d.ts.map b/node_modules/geckodriver/dist/install.d.ts.map
322+
old mode 100644
323+
new mode 100755
324+
diff --git a/node_modules/geckodriver/dist/install.js b/node_modules/geckodriver/dist/install.js
325+
old mode 100644
326+
new mode 100755
327+
index c27c805..ac53518
328+
--- a/node_modules/geckodriver/dist/install.js
329+
+++ b/node_modules/geckodriver/dist/install.js
330+
@@ -70,6 +70,8 @@ async function downloadZip(res, cacheDir) {
331+
* download on install
332+
*/
333+
if (process.argv[1] && process.argv[1].endsWith('/dist/install.js') && process.env.GECKODRIVER_AUTO_INSTALL) {
334+
- await download().then(() => log.info('Success!'), (err) => log.error(`Failed to install Geckodriver: ${err.stack}`));
335+
+ // removing the await here as packherd cannot bundle with a top-level await.
336+
+ // This only has an impact if invoking from a CLI context, which cypress is not.
337+
+ download().then(() => log.info('Success!'), (err) => log.error(`Failed to install Geckodriver: ${err.stack}`));
338+
}
339+
//# sourceMappingURL=install.js.map
340+
\ No newline at end of file
341+
diff --git a/node_modules/geckodriver/dist/install.js.map b/node_modules/geckodriver/dist/install.js.map
342+
old mode 100644
343+
new mode 100755
344+
diff --git a/node_modules/geckodriver/dist/types.d.ts b/node_modules/geckodriver/dist/types.d.ts
345+
old mode 100644
346+
new mode 100755
347+
diff --git a/node_modules/geckodriver/dist/types.d.ts.map b/node_modules/geckodriver/dist/types.d.ts.map
348+
old mode 100644
349+
new mode 100755
350+
diff --git a/node_modules/geckodriver/dist/types.js b/node_modules/geckodriver/dist/types.js
351+
old mode 100644
352+
new mode 100755
353+
diff --git a/node_modules/geckodriver/dist/types.js.map b/node_modules/geckodriver/dist/types.js.map
354+
old mode 100644
355+
new mode 100755
356+
diff --git a/node_modules/geckodriver/dist/utils.d.ts b/node_modules/geckodriver/dist/utils.d.ts
357+
old mode 100644
358+
new mode 100755
359+
diff --git a/node_modules/geckodriver/dist/utils.d.ts.map b/node_modules/geckodriver/dist/utils.d.ts.map
360+
old mode 100644
361+
new mode 100755
362+
diff --git a/node_modules/geckodriver/dist/utils.js b/node_modules/geckodriver/dist/utils.js
363+
old mode 100644
364+
new mode 100755
365+
diff --git a/node_modules/geckodriver/dist/utils.js.map b/node_modules/geckodriver/dist/utils.js.map
366+
old mode 100644
367+
new mode 100755
368+
diff --git a/node_modules/geckodriver/tsconfig.tsbuildinfo b/node_modules/geckodriver/tsconfig.tsbuildinfo
369+
old mode 100644
370+
new mode 100755

0 commit comments

Comments
 (0)