Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver Service Fix #168

Merged
merged 112 commits into from
Oct 2, 2023
Merged
Changes from 1 commit
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
7f44ad5
update deps
goosewobbler Aug 24, 2023
3d20091
try
goosewobbler Aug 24, 2023
3552598
remove guard
goosewobbler Aug 25, 2023
cdc59ab
remove test
goosewobbler Aug 25, 2023
17aa40a
update confs
goosewobbler Aug 25, 2023
f6abfdf
delete bat
goosewobbler Aug 25, 2023
c1f378c
delete launcher spec
goosewobbler Aug 25, 2023
1929082
fix scripts & update deps
goosewobbler Aug 25, 2023
7a4c88d
add launcher back
goosewobbler Aug 27, 2023
19752ca
update deps
goosewobbler Aug 27, 2023
f28a1f8
update local integration script
goosewobbler Aug 27, 2023
9d4bc05
reinstate bat
goosewobbler Aug 27, 2023
841cc8a
borrow capabilities mapping from wdio-chromedriver-service
goosewobbler Aug 27, 2023
6033184
reinstate launcher
goosewobbler Aug 27, 2023
162cb06
update TS version
goosewobbler Aug 27, 2023
9f1b8c5
set hostname & port
goosewobbler Aug 27, 2023
27623d3
revert bat change
goosewobbler Aug 27, 2023
cb3217b
put guard back
goosewobbler Aug 27, 2023
0915678
integration tests first
goosewobbler Aug 27, 2023
b74ee32
remove port
goosewobbler Aug 28, 2023
d1bf256
remove hostname
goosewobbler Aug 28, 2023
a457c8b
add debug
goosewobbler Aug 29, 2023
f539ff5
use cross-env
goosewobbler Aug 29, 2023
71d02ed
first pass of capabilities mapping rewrite
goosewobbler Aug 29, 2023
e93aec3
only set capabilities in launcher
goosewobbler Aug 29, 2023
4a68880
update types & cjs
goosewobbler Aug 29, 2023
88db501
use electron for browserName
goosewobbler Aug 29, 2023
b954350
update deps
goosewobbler Aug 29, 2023
93f9355
only integration tests on CI for debugging
goosewobbler Aug 29, 2023
fc34331
only set chromeArgs via appArgs
goosewobbler Aug 29, 2023
4b23b09
improve readability
goosewobbler Aug 29, 2023
55c6534
version handling update
goosewobbler Aug 29, 2023
51e58e0
remove hostname & port
goosewobbler Aug 29, 2023
03bcb5f
move appArgs to capabilities
goosewobbler Aug 29, 2023
1a11d6f
kill launcher
christian-bromann Sep 25, 2023
49d34a7
fix unit tests
christian-bromann Sep 25, 2023
0840bda
fix lock file
christian-bromann Sep 25, 2023
af2d19e
add webdriverio as peer dep
christian-bromann Sep 25, 2023
b80699d
fix cjs build
christian-bromann Sep 26, 2023
2904091
update docs
christian-bromann Sep 26, 2023
9025ce5
improve e2e tests
christian-bromann Sep 26, 2023
96c3133
update deps
goosewobbler Sep 27, 2023
ed62ac9
formatting
goosewobbler Sep 27, 2023
a98648b
more debug
goosewobbler Sep 27, 2023
461d762
Clarify service vs. user managed CD, clean up
goosewobbler Sep 27, 2023
1aa17e8
remove electronVersion, chromedriverCustomPath
goosewobbler Sep 27, 2023
500f287
fix api spec
goosewobbler Sep 27, 2023
00958bb
update browserVersion
goosewobbler Sep 27, 2023
86e1021
update lockfiles
goosewobbler Sep 27, 2023
2fba4d9
add Testrunner type
goosewobbler Sep 27, 2023
923feea
e2es use caps to set options
goosewobbler Sep 27, 2023
5330203
add debug action, update pnpm
goosewobbler Sep 27, 2023
5e0c93e
increase timeout
goosewobbler Sep 27, 2023
9665a08
Merge pull request #191 from webdriverio-community/driver-service-fix-2
goosewobbler Sep 27, 2023
42fb2c8
dynamically create version map
goosewobbler Sep 28, 2023
15f0525
uncomment
goosewobbler Sep 28, 2023
0cd3de1
unused var
goosewobbler Sep 28, 2023
538300a
remove CD download mechanism
goosewobbler Sep 28, 2023
3496f1c
update local integration script
goosewobbler Sep 28, 2023
cfdd8fe
extract versions
goosewobbler Sep 28, 2023
9e85a5d
extract capabilities, support parallel multiremote
goosewobbler Sep 28, 2023
0e6337f
Merge pull request #195 from webdriverio-community/driver-service-fix-2
goosewobbler Sep 28, 2023
c8dfa57
add missing capabilities tests
goosewobbler Sep 28, 2023
522f521
move setup into launcher
christian-bromann Sep 29, 2023
84a3cad
fix linter
christian-bromann Sep 29, 2023
aa5eec0
fix ts issue
christian-bromann Sep 29, 2023
a994184
fix typing issue
christian-bromann Sep 29, 2023
51c740d
extract from utils
goosewobbler Sep 29, 2023
811b1c4
use appBinaryPath
goosewobbler Sep 29, 2023
915439a
formatting fix
goosewobbler Sep 29, 2023
c5d37c9
add types for main & preload
goosewobbler Sep 29, 2023
03c419c
move getBinaryPath to utils, expose
goosewobbler Sep 29, 2023
0c1c48d
update deps
goosewobbler Sep 29, 2023
d3646b2
fix merge
goosewobbler Sep 29, 2023
433a2f8
fix log import
goosewobbler Sep 29, 2023
d776f56
log error
goosewobbler Sep 29, 2023
d14be60
duplicate getBinaryPath to fix build
goosewobbler Sep 29, 2023
6c1fbde
update lock
goosewobbler Sep 29, 2023
278c698
update getBinaryPath
goosewobbler Sep 29, 2023
574d358
update for appBinaryPath
goosewobbler Sep 29, 2023
78124ed
fix linting
goosewobbler Sep 29, 2023
d87b70d
fix formatting
goosewobbler Sep 29, 2023
52833f6
revert ci script
goosewobbler Sep 29, 2023
1e9a1c1
rework examples
goosewobbler Sep 30, 2023
5c12116
use rollup
goosewobbler Sep 30, 2023
c689cc9
fix imports
goosewobbler Sep 30, 2023
0ef3468
update outdir
goosewobbler Sep 30, 2023
3d4072b
use symlinks pt.1
goosewobbler Sep 30, 2023
bd14dd3
use symlinks pt.2
goosewobbler Sep 30, 2023
a9134b0
revert to import
goosewobbler Sep 30, 2023
0cbb239
fix utils typing
goosewobbler Sep 30, 2023
a7291cc
update linting config
goosewobbler Sep 30, 2023
8eabd93
update lockfile
goosewobbler Sep 30, 2023
44fe067
use unknown
goosewobbler Sep 30, 2023
d3fb192
update lockfiles
goosewobbler Sep 30, 2023
dbe2d8b
extract nested ternary
goosewobbler Sep 30, 2023
06a174f
add rule for ternaries, switch to standard filename for flat config
goosewobbler Sep 30, 2023
e733c34
update lockfile
goosewobbler Sep 30, 2023
4341e07
launcher fixes & tests
goosewobbler Sep 30, 2023
d822162
type fix
goosewobbler Sep 30, 2023
94e7f51
clean up
goosewobbler Sep 30, 2023
9fb643b
remove old conf, increase coverage limits
goosewobbler Sep 30, 2023
96de4f8
Merge pull request #196 from webdriverio-community/driver-service-fix-3
goosewobbler Sep 30, 2023
d228170
launcher improvements, more tests
goosewobbler Oct 2, 2023
9719847
delete redundant function
goosewobbler Oct 2, 2023
39295f7
add versions tests
goosewobbler Oct 2, 2023
db1f356
add update script, ignore fixtures
goosewobbler Oct 2, 2023
07713a0
update deps
goosewobbler Oct 2, 2023
e0a5a70
no need to specify eslint config path
goosewobbler Oct 2, 2023
4b0003e
streamline tests, tweak
goosewobbler Oct 2, 2023
807ed1a
Merge pull request #197 from webdriverio-community/driver-service-fix-3
goosewobbler Oct 2, 2023
b349270
Update README.md
goosewobbler Oct 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions src/launcher.ts
Original file line number Diff line number Diff line change
@@ -9,16 +9,6 @@ import { getChromeOptions, getChromedriverOptions, getElectronCapabilities } fro
import { getChromiumVersion, parseVersion } from './versions.js';
import type { ElectronServiceOptions } from './types.js';

function getArrayCapabilities(capabilities: Capabilities.RemoteCapabilities) {
const multiremoteCapabilities = capabilities as Capabilities.MultiRemoteCapabilities[];
return multiremoteCapabilities[0].capabilities
? (multiremoteCapabilities.map((cap) => cap.capabilities) as (
| Capabilities.DesiredCapabilities
| Capabilities.W3CCapabilities
)[])
: (capabilities as (Capabilities.DesiredCapabilities | Capabilities.W3CCapabilities)[]);
}

export default class ElectronLaunchService implements Services.ServiceInstance {
#globalOptions: ElectronServiceOptions;
#projectRoot: string;
@@ -30,10 +20,10 @@ export default class ElectronLaunchService implements Services.ServiceInstance {

async onPrepare(_: never, capabilities: Capabilities.RemoteCapabilities) {
const capsList = Array.isArray(capabilities)
? getArrayCapabilities(capabilities)
? capabilities
: Object.values(capabilities).map((multiremoteOption) => multiremoteOption.capabilities);

const caps = capsList.map((cap) => getElectronCapabilities(cap) as WebDriver.Capabilities[]).flat();
const caps = capsList.flatMap((cap) => getElectronCapabilities(cap) as WebDriver.Capabilities[]);
const pkgJSON = JSON.parse((await fs.readFile(path.join(this.#projectRoot, 'package.json'), 'utf-8')).toString());
const { dependencies, devDependencies } = pkgJSON;
const localElectronVersion = parseVersion(dependencies?.electron || devDependencies?.electron);