Skip to content

feat: prepare to drop the global var - #1144

Merged
KazuCocoa merged 4 commits into
masterfrom
prepare-deprecae
Oct 30, 2026
Merged

KazuCocoa merged 4 commits into
masterfrom
prepare-deprecae

Conversation

@KazuCocoa

@KazuCocoa KazuCocoa commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Make non-global drivers usable independently while retaining explicit global-driver usage (Appium::Driver.new(opts, true)) and implicit promotion through $driver. The default remains non-global; this PR does not remove global support.

Compatibility notes

  • Driver.new(opts) now honors symbol/string global_driver options when the second argument is omitted or nil. Previously, omitting the second argument ignored the hash option. A hash value of true can therefore replace $driver and quit the previous global session. An explicit true/false second argument takes precedence.
  • start_driver quits only the receiving wrapper's previous session, instead of quitting an unrelated $driver session. Callers relying on that cross-driver cleanup must quit the other driver explicitly.
  • Coordinate conversion and Android inspection use the receiving driver rather than an unrelated $driver. Pass an explicit driver to px_to_window_rel when a different session is intended.
  • Re-promoting singleton Appium methods refreshes generated wrappers to use the newly supplied driver instead of retaining an earlier driver.

Validation

  • Unit tests: 43 tests, 100 assertions passed.
  • Local Android functional tests: both global-driver modes passed (100 tests, 150 assertions each).
  • Local changed iOS tests on iOS 26.5: both modes passed (36 tests, 77 assertions each).
  • RuboCop passed.
  • Latest CI on db255c5 still has functional failures in both modes: Android swipe navigation (1 error per mode); iOS swipe and touch-and-hold (2 errors per mode). Full CI is not yet green.

Release notes

The override below supplies explicit changelog entries to Release Please. Use squash merge; Release Please does not support this override with plain merge commits.

BEGIN_COMMIT_OVERRIDE
feat: support independent non-global drivers while preserving explicit global-driver usage and the existing non-global default

fix: honor symbol and string global_driver hash options when the constructor's second argument is omitted or nil; true now replaces the global driver and quits its previous session, while an explicit boolean argument takes precedence

fix: make start_driver quit only its own previous session; callers relying on cleanup of another global driver must quit that driver explicitly

fix: use the receiving driver's session for coordinate conversion and Android inspection instead of an unrelated global driver

fix: refresh generated singleton methods on re-promotion so they use the newly supplied driver rather than the previous driver

fix: clear session and app-string cache on quit and reload app strings for replacement sessions
END_COMMIT_OVERRIDE

Reset Android navigation between affected tests, restore implicit waits and relaunch after reinstall. Use the current startActivity extension, fix capability expectations and synchronize multitouch actions. Remove applesimutils from the iOS workflow.

Validated on Android API 36 with global_driver=true and false: 100 tests and 150 assertions per mode. Unit tests: 43 tests and 100 assertions. RuboCop: 108 files clean.
Use Safari with a local HTML fixture instead of legacy UIWebView. Reset navigation for affected tests, use stable gesture targets, and accept both valid background app states. Allow the iOS HTTP timeout to cover WDA startup and support local Simulator capability overrides.

Validated changed iOS classes on iOS 26.5 with a rebuilt ARM UICatalog and CI-matching Appium 3.9.0 / XCUITest 12.22.4: 36 tests and 77 assertions pass in each global-driver mode. Unit tests: 43 tests / 100 assertions. RuboCop: 109 files clean. Full iOS 18.5 suite remains for CI.
@KazuCocoa
KazuCocoa merged commit 203da2d into master Oct 30, 2026
9 of 15 checks passed
@KazuCocoa
KazuCocoa deleted the prepare-deprecae branch October 30, 2026 06:53
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