Skip to content

refactor: drivers as instances instead of strings#162

Open
gmegidish wants to merge 2 commits into
mainfrom
refactor-drivers-as-instances
Open

refactor: drivers as instances instead of strings#162
gmegidish wants to merge 2 commits into
mainfrom
refactor-drivers-as-instances

Conversation

@gmegidish
Copy link
Copy Markdown
Member

@gmegidish gmegidish commented May 27, 2026

Summary

  • config.driver now accepts a driver instance — third-party drivers implement MobilewrightDriver from @mobilewright/protocol with no framework dependency required
  • MobilewrightDriver interface extended with coordinator-side methods (name, allocate, release, setup?, teardown?) so one class covers both the coordinator and worker roles
  • MobilecliDriver and MobileNextDriver both implement the unified interface; MobileNextDriver manages per-device cloud sessions internally via an allocatedSessions map
  • NoDeviceAvailableError, AllocationCriteria, and AllocateResult moved to @mobilewright/protocol so third-party authors have a single, framework-free import target
  • resolveDriver() compat shim — the legacy { type: 'mobilecli' } object form still works but logs a deprecation warning
  • All dead allocator infrastructure deleted (allocator-factory.ts, mobilecli-allocator.ts, mobilenext-allocator.ts)
  • DummyDriver reference implementation added to @mobilewright/test — proves the minimal contract a third-party driver must satisfy
  • e2e/mobilewright.config.ts rewritten to use new MobilecliDriver() / new MobileNextDriver() directly

gmegidish added 2 commits May 25, 2026 17:17
# Conflicts:
#	CHANGELOG.md
#	e2e/mobilewright.config.ts
#	packages/driver-mobilecli/src/driver.ts
#	packages/driver-mobilenext/src/driver.ts
#	packages/mobilewright/src/device-pool/adapters/mobilenext-allocator.ts
#	packages/mobilewright/src/device-pool/allocator-factory.ts
#	packages/mobilewright/src/index.ts
#	packages/mobilewright/src/launchers.ts
@gmegidish gmegidish changed the title refactor: drivers as instances refactor: drivers as instances instead of strings May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant