You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: attach commands via prototype to allow overrides in descendants - #1110
Command functions were assigned as instance fields, which made them properties: subclasses could not redefine them as methods or call super. Mirror the base-driver layout instead: each command module augments AndroidDriver with method signatures via declare module, and Object.assign(AndroidDriver.prototype, ...) attaches them.
getLogTypes and getLog now live in the class as real overrides using super. Also fix mobileResetGeolocation, which bound resetMockLocation without ever calling it.
…ants
Command functions were assigned as instance fields, which made them
properties: subclasses could not redefine them as methods or call
`super`. Mirror the base-driver layout instead: each command module
augments `AndroidDriver` with method signatures via `declare module`,
and `Object.assign(AndroidDriver.prototype, ...)` attaches them.
`getLogTypes` and `getLog` now live in the class as real overrides using
`super`. Also fix `mobileResetGeolocation`, which bound `resetMockLocation`
without ever calling it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Added test/unit/driver.spec.ts: it checks that commands are prototype (not own) properties, and that a subclass can override a command and call super. Fixed in c8e3bd6.
Stringify arrays/unknown values explicitly in log messages, extend the
no-duplicates suppression over the bare imports in driver.ts, and cover
subclass overrides with `super` in a new unit test.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add regression test for mobileResetGeolocation reset behavior
lib/commands/geolocation.ts:172
mobileResetGeolocation now calls the reset helper instead of returning without doing anything, but test/unit/commands/geolocation.spec.ts only tests enabling mock location. Please add a regression test for a real device that stubs package lookup and ADB operations, calls driver.mobileResetGeolocation(), and checks that appops ... android:mock_location deny runs. This would catch a return to the previous no-op.
Added regression tests for mobileResetGeolocation in dd4071b (checks that appops ... android:mock_location deny runs, and that it throws on emulators). The subclass-override test was added in c8e3bd6 (test/unit/driver.spec.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
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.
Command functions were assigned as instance fields, which made them properties: subclasses could not redefine them as methods or call
super. Mirror the base-driver layout instead: each command module augmentsAndroidDriverwith method signatures viadeclare module, andObject.assign(AndroidDriver.prototype, ...)attaches them.getLogTypesandgetLognow live in the class as real overrides usingsuper. Also fixmobileResetGeolocation, which boundresetMockLocationwithout ever calling it.