refactor: drivers as instances instead of strings#162
Open
gmegidish wants to merge 2 commits into
Open
Conversation
# 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
config.drivernow accepts a driver instance — third-party drivers implementMobilewrightDriverfrom@mobilewright/protocolwith no framework dependency requiredMobilewrightDriverinterface extended with coordinator-side methods (name,allocate,release,setup?,teardown?) so one class covers both the coordinator and worker rolesMobilecliDriverandMobileNextDriverboth implement the unified interface;MobileNextDrivermanages per-device cloud sessions internally via anallocatedSessionsmapNoDeviceAvailableError,AllocationCriteria, andAllocateResultmoved to@mobilewright/protocolso third-party authors have a single, framework-free import targetresolveDriver()compat shim — the legacy{ type: 'mobilecli' }object form still works but logs a deprecation warningallocator-factory.ts,mobilecli-allocator.ts,mobilenext-allocator.ts)DummyDriverreference implementation added to@mobilewright/test— proves the minimal contract a third-party driver must satisfye2e/mobilewright.config.tsrewritten to usenew MobilecliDriver()/new MobileNextDriver()directly