Detox icon indicating copy to clipboard operation
Detox copied to clipboard

[Epic 🔥] iOS: Support for System Dialogs

Open asafkorem opened this issue 1 year ago • 2 comments

iOS: Support System Dialog interactions via XCUITest

Description

Elevate Detox's iOS testing capabilities through interaction with system dialogs, overcoming limitations in automated testing scenarios that involve system-level interactions.

Impact

This initiative broadens Detox's application in testing environments, enabling seamless automation of scenarios involving authentication prompts, permission dialogs, and other system interactions. It facilitates more comprehensive test suites, supporting multi-app flows and real device testing without additional code signing hurdles.

Resolves https://github.com/wix/Detox/issues/4275, https://github.com/wix/Detox/issues/3227, https://github.com/wix/Detox/issues/3017

Solution Details

The general approach is to implement this support by integrating XCUITest into Detox.

  1. XCUITest Integration: Establish a communication channel between Detox and XCUITest to enable direct interaction with iOS system dialogs.
  2. Support System Dialogs in regular Matchers: Utilize XCUITest matchers for detecting and interacting with UI elements in system dialogs. Implement as a fallback for the current matching mechanism.
  3. Support Basic Interactions on Dialog Buttons: Implement functionality for tapping on dialog buttons, crucial for testing permissions, alerts, and other system prompts.

Integrating XCUITest to support system dialogs will mark a significant advancement in Detox (iOS), ensuring more robust and comprehensive testing capabilities. This will enable features that were not supported until now, such as interactions with unmocked push notifications and social login flows.

### Tasks
- [ ] https://github.com/wix/Detox/issues/4433
- [ ] https://github.com/wix/Detox/issues/4434
- [ ] https://github.com/wix/Detox/issues/4435

asafkorem avatar Apr 01 '24 11:04 asafkorem

This initiative broadens Detox's application in testing environments, enabling seamless automation of scenarios involving authentication prompts, permission dialogs, and other system interactions. It facilitates more comprehensive test suites, supporting multi-app flows and real device testing without additional code signing hurdles.

Does this imply enabling testing on physical iOS devices, as recorded in #95?

josmithua avatar Apr 15 '24 20:04 josmithua

@josmithua No, this will enable permission request handling for hardware device testing in the future, but it doesn't enable hardware support at the moment. The support requires more than that, especially because we deeply rely on simctl for the device APIs. We'll have to implement a separate driver and a different setup for that.

asafkorem avatar Apr 21 '24 14:04 asafkorem

Closed as finished.

asafkorem avatar Jul 14 '24 14:07 asafkorem