Skip to content

Commit ffedae3

Browse files
committed
Run prettifier over the selenium-webdriver node code
1 parent 832a31e commit ffedae3

32 files changed

+882
-648
lines changed

javascript/node/selenium-webdriver/.eslintrc.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,11 @@ module.exports = {
44
node: true,
55
es6: true,
66
},
7-
extends: [
8-
'eslint:recommended',
9-
'plugin:node/recommended',
10-
'plugin:prettier/recommended',
11-
],
7+
extends: ['eslint:recommended', 'plugin:node/recommended', 'plugin:prettier/recommended'],
128
parserOptions: {
139
ecmaVersion: 2022,
1410
},
15-
ignorePatterns: [
16-
'.eslintrc.js',
17-
'.prettierrc',
18-
],
11+
ignorePatterns: ['.eslintrc.js', '.prettierrc'],
1912
plugins: ['no-only-tests'],
2013
rules: {
2114
'no-const-assign': 'error',

javascript/node/selenium-webdriver/CHANGES.md

Lines changed: 523 additions & 341 deletions
Large diffs are not rendered by default.

javascript/node/selenium-webdriver/README.md

Lines changed: 57 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@ Selenium may be installed via npm with
1313
You will need to download additional components to work with each of the major
1414
browsers. The drivers for Chrome, Firefox, and Microsoft's IE and Edge web
1515
browsers are all standalone executables that should be placed on your system
16-
[PATH]. Apple's safaridriver (v10 and above) can be found at the
17-
following path – /usr/bin/safaridriver. To enable automation on safari,
16+
[PATH]. Apple's safaridriver (v10 and above) can be found at the
17+
following path – /usr/bin/safaridriver. To enable automation on safari,
1818
you need to run command `safaridriver --enable`.
1919

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] |
20+
| Browser | Component |
21+
|:------------------|:---------------------------------|
22+
| Chrome | [chromedriver(.exe)][chrome] |
23+
| Internet Explorer | [IEDriverServer.exe][release] |
24+
| Edge | [MicrosoftWebDriver.msi][edge] |
25+
| Firefox | [geckodriver(.exe)][geckodriver] |
26+
| Opera | [operadriver(.exe)][operadriver] |
27+
| Safari | [safaridriver] |
2928

3029
## Usage
3130

@@ -103,6 +102,7 @@ let driver = new webdriver.Builder()
103102
.usingServer('http://localhost:4444/wd/hub')
104103
.build();
105104
```
105+
106106
Or change the Builder's configuration at runtime with the `SELENIUM_REMOTE_URL`
107107
environment variable:
108108

@@ -135,43 +135,44 @@ will also have "best effort" support. Releases older than the latest LTS,
135135
_semver-major_ releases, and all unstable release branches (e.g. "v.Next")
136136
are considered strictly unsupported.
137137

138-
For example, suppose the current LTS and stable releases are v14.20.0 and v18.8.0,
138+
For example, suppose the current LTS and stable releases are v14.20.0 and
139+
v18.8.0,
139140
respectively. Then a Selenium release would have the following support levels:
140141

141-
| Version | Support |
142-
|:----------:|:---------------:|
143-
| <= 14.19 | _unsupported_ |
144-
| 14.20.0 | supported |
145-
| 18.0-7 | best effort |
146-
| 18.8.0 | supported |
147-
| >= 18.8.0 | best effort |
148-
| v.Next | _unsupported_ |
142+
| Version | Support |
143+
|:---------:|:-------------:|
144+
| <= 14.19 | _unsupported_ |
145+
| 14.20.0 | supported |
146+
| 18.0-7 | best effort |
147+
| 18.8.0 | supported |
148+
| >= 18.8.0 | best effort |
149+
| v.Next | _unsupported_ |
149150

150151
### Support Level Definitions
151152

152153
- _supported:_ A selenium-webdriver release will be API compatible with the
153-
platform API, without the use of runtime flags.
154+
platform API, without the use of runtime flags.
154155

155156
- _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.
157+
only guaranteed where required by a _supported_ release. This effectively
158+
means the adoption of new JS features, such as ES2015 modules, will depend
159+
on what is supported in Node's LTS.
159160

160161
- _unsupported:_ Bug submissions will be closed as will-not-fix and API
161-
compatibility is not guaranteed.
162+
compatibility is not guaranteed.
162163

163164
### Projected Support Schedule
164165

165166
If Node releases a new [LTS] each October and a new major version every 6
166167
months, the support window for selenium-webdriver will be roughly:
167168

168-
| Release | Status | END-OF-LIFE |
169-
|:---------:|:----------------:|:------------:|
170-
| v14.x | Maintenance LTS | 2023-04-30 |
171-
| v16.x | Active LTS | 2023-09-11 |
172-
| v18.x | Current | 2025-04-30 |
173-
| v19.x | Pending | 2023-06-01 |
174-
| v20 | Pending | 2026-04-30 |
169+
| Release | Status | END-OF-LIFE |
170+
|:-------:|:---------------:|:-----------:|
171+
| v14.x | Maintenance LTS | 2023-04-30 |
172+
| v16.x | Active LTS | 2023-09-11 |
173+
| v18.x | Current | 2025-04-30 |
174+
| v19.x | Pending | 2023-06-01 |
175+
| v20 | Pending | 2026-04-30 |
175176

176177
## Issues
177178

@@ -180,52 +181,62 @@ the issue tracker
180181

181182
- __Do__ include a detailed description of the problem.
182183
- __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).
184+
interesting stack traces/logs (you may also attach these directly to the bug
185+
report).
185186
- __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.
187+
element on the page" is _not_ a valid report - there's nothing for us to
188+
look into. Expect your bug report to be closed if you do not provide enough
189+
information for us to investigate.
189190
- __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.
191+
inquiries should be directed to the [user forum][users] or #selenium IRC
192+
channel.
192193
- __Do not__ post empty "I see this too" or "Any updates?" comments. These
193-
provide no additional information and clutter the log.
194+
provide no additional information and clutter the log.
194195
- __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.
196+
monitored for updates (especially bugs that are >6 months old). Please open a
197+
new issue and reference the original bug in your report.
197198

198199
## License
199200

200201
Licensed to the Software Freedom Conservancy (SFC) under one
201-
or more contributor license agreements. See the NOTICE file
202+
or more contributor license agreements. See the NOTICE file
202203
distributed with this work for additional information
203-
regarding copyright ownership. The SFC licenses this file
204+
regarding copyright ownership. The SFC licenses this file
204205
to you under the Apache License, Version 2.0 (the
205206
"License"); you may not use this file except in compliance
206-
with the License. You may obtain a copy of the License at
207+
with the License. You may obtain a copy of the License at
207208

208209
http://www.apache.org/licenses/LICENSE-2.0
209210

210211
Unless required by applicable law or agreed to in writing,
211212
software distributed under the License is distributed on an
212213
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
213-
KIND, either express or implied. See the License for the
214+
KIND, either express or implied. See the License for the
214215
specific language governing permissions and limitations
215216
under the License.
216217

217218
[LTS]: https://github.com/nodejs/LTS
219+
218220
[PATH]: http://en.wikipedia.org/wiki/PATH_%28variable%29
221+
219222
[api]: http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/
223+
220224
[chrome]: http://chromedriver.storage.googleapis.com/index.html
225+
221226
[gh]: https://github.com/SeleniumHQ/selenium/
227+
222228
[issues]: https://github.com/SeleniumHQ/selenium/issues
229+
223230
[edge]: http://go.microsoft.com/fwlink/?LinkId=619687
231+
224232
[geckodriver]: https://github.com/mozilla/geckodriver/releases/
233+
225234
[reduction]: http://www.webkit.org/quality/reduction.html
226235

227236
[release]: https://www.selenium.dev/downloads/
228237

229238
[users]: https://groups.google.com/forum/#!forum/selenium-users
239+
230240
[safaridriver]: https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_10_0.html#//apple_ref/doc/uid/TP40014305-CH11-DontLinkElementID_28
241+
231242
[operadriver]: https://github.com/operasoftware/operachromiumdriver/releases

javascript/node/selenium-webdriver/bidi/addInterceptParameters.js

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,72 +15,66 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
const {UrlPattern} = require("./urlPattern");
18+
const { UrlPattern } = require('./urlPattern')
1919

2020
class AddInterceptParameters {
2121
#phases = []
2222
#urlPatterns = []
2323

2424
constructor(phases) {
2525
if (phases instanceof Array) {
26-
phases.forEach(phase => this.#phases.push(phase))
26+
phases.forEach((phase) => this.#phases.push(phase))
2727
} else {
2828
this.#phases.push(phases)
2929
}
3030
}
3131

32-
urlPattern(pattern)
33-
{
32+
urlPattern(pattern) {
33+
if (!pattern instanceof UrlPattern) {
34+
throw new Error(`Pattern must be an instance of UrlPattern. Received: '${pattern})'`)
35+
}
36+
this.#urlPatterns.push(Object.fromEntries(pattern.asMap()))
37+
return this
38+
}
39+
40+
urlPatterns(patterns) {
41+
patterns.forEach((pattern) => {
3442
if (!pattern instanceof UrlPattern) {
35-
throw new Error(`Pattern must be an instance of UrlPattern. Received: '${pattern})'`)
43+
throw new Error(`Pattern must be an instance of UrlPattern. Received:'${pattern}'`)
3644
}
3745
this.#urlPatterns.push(Object.fromEntries(pattern.asMap()))
38-
return this
39-
}
46+
})
47+
return this
48+
}
4049

41-
urlPatterns(patterns)
42-
{
43-
patterns.forEach(pattern => {
44-
if (!pattern instanceof UrlPattern) {
45-
throw new Error(`Pattern must be an instance of UrlPattern. Received:'${pattern}'`)
46-
}
47-
this.#urlPatterns.push(Object.fromEntries(pattern.asMap()))
48-
})
49-
return this
50+
urlStringPattern(pattern) {
51+
if (!pattern instanceof String) {
52+
throw new Error(`Pattern must be an instance of String. Received:'${pattern}'`)
5053
}
5154

52-
urlStringPattern(pattern)
53-
{
55+
this.#urlPatterns.push({ type: 'string', pattern: pattern })
56+
return this
57+
}
58+
59+
urlStringPatterns(patterns) {
60+
patterns.forEach((pattern) => {
5461
if (!pattern instanceof String) {
5562
throw new Error(`Pattern must be an instance of String. Received:'${pattern}'`)
5663
}
64+
this.#urlPatterns.push({ type: 'string', pattern: pattern })
65+
})
66+
return this
67+
}
5768

58-
this.#urlPatterns.push({'type': 'string', 'pattern': pattern})
59-
return this
60-
}
61-
62-
urlStringPatterns(patterns)
63-
{
64-
patterns.forEach(pattern => {
65-
if (!pattern instanceof String) {
66-
throw new Error(`Pattern must be an instance of String. Received:'${pattern}'`)
67-
}
68-
this.#urlPatterns.push({'type': 'string', 'pattern': pattern})
69-
})
70-
return this
69+
asMap() {
70+
const map = new Map()
71+
map.set('phases', this.#phases)
72+
if (this.#urlPatterns.length > 0) {
73+
map.set('urlPatterns', this.#urlPatterns)
7174
}
7275

73-
74-
asMap()
75-
{
76-
const map = new Map()
77-
map.set('phases', this.#phases)
78-
if (this.#urlPatterns.length > 0) {
79-
map.set('urlPatterns', this.#urlPatterns)
80-
}
81-
82-
return map
83-
}
76+
return map
8477
}
78+
}
8579

86-
module.exports = {AddInterceptParameters}
80+
module.exports = { AddInterceptParameters }

javascript/node/selenium-webdriver/bidi/argumentValue.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717

1818
const { LocalValue } = require('./protocolValue')
19+
1920
class ArgumentValue {
2021
constructor(value) {
2122
this.value = value

javascript/node/selenium-webdriver/bidi/browsingContext.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ class BrowsingContext {
7171
this._driver = driver
7272
}
7373

74+
/**
75+
* @returns id
76+
*/
77+
get id() {
78+
return this._id
79+
}
80+
7481
async init({ browsingContextId, type, referenceContext }) {
7582
if (!(await this._driver.getCapabilities()).get('webSocketUrl')) {
7683
throw Error('WebDriver instance must support BiDi protocol')
@@ -101,13 +108,6 @@ class BrowsingContext {
101108
return await this.bidi.send(params)
102109
}
103110

104-
/**
105-
* @returns id
106-
*/
107-
get id() {
108-
return this._id
109-
}
110-
111111
/**
112112
* @param url the url to navigate to
113113
* @param readinessState type of readiness state: "none" / "interactive" / "complete"

0 commit comments

Comments
 (0)