-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
520d6a3
commit abccac8
Showing
5 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Architecture Deep Dive | ||
The sequence diagram below shows the general communication scheme between the components in Detox. | ||
![architecture overview](img/action-sequence.mmd.png) | ||
|
||
To understand this topic more thoroughly we need to have a look at an example action in detail. The numbers in the listing below corelate with the ones in the diagram. | ||
|
||
### Action (`element.tap`) | ||
|
||
1. `element.tap()` in your test case is invoked. | ||
2. `TapAction` in [`expect.js`](https://github.com/wix/detox/blob/master/detox/src/ios/expect.js) gets invoked | ||
3. `TapAction` instance gets passed to [`invoke.js`](https://github.com/wix/detox/blob/master/detox/src/invoke.js), where it gets transformed to JSON. The resulting JSON corelates more with the native code than with the JS code for better extensibility. | ||
4. JSON gets send to detox-server by [`Client.js`](https://github.com/wix/detox/blob/master/detox/src/client/Client.js) | ||
6. detox-server forwards it to the testee in [`DetoxServer.js`](https://github.com/wix/detox/blob/master/detox-server/src/DetoxServer.js) | ||
7. [`DetoxManager.m`](https://github.com/wix/detox/blob/master/detox/ios/Detox/DetoxManager.m) invokes the [`TestRunner.m`](https://github.com/wix/detox/blob/master/detox/ios/Detox/TestRunner.m). `TestRunner.m` uses [`MethodInvocation.m`](https://github.com/wix/detox/blob/master/detox/ios/Detox/MethodInvocation.m) to map the JSON representation of the native commands into the actual native command and executes it. *(8)* | ||
|
||
|
||
*NOTE: the images can be updated with [mermaid](http://knsv.github.io/mermaid/#mermaid). The files can be found under `img-src`* |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
sequenceDiagram | ||
participant Test Runner(1) | ||
participant Detox(3) | ||
participant Detox Server(5) | ||
participant Detox Client(7) | ||
participant Earl Grey(9) | ||
|
||
%% Note over Test Runner(1),Detox Server(5): Runs on your computer | ||
%% Note over Detox Client(7),Earl Grey(9): Runs on the device | ||
|
||
Test Runner(1)->>Detox(3): assertion / action (2) | ||
Detox(3)->>Detox Server(5): native code as JSON (4) | ||
Detox Server(5)->>Detox Client(7): Websocket connection (6) | ||
Detox Client(7)-x+Earl Grey(9): native invocation (8) | ||
Note left of Earl Grey(9): EarlGrey waits for device to become idle again | ||
Earl Grey(9)->>-Detox Client(7): (10) | ||
Detox Client(7)->>Detox Server(5): (11) | ||
Detox Server(5)->>Detox(3): (12) | ||
Detox(3)->>Test Runner(1): (13) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
mermaid -o '../img' *.mmd |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.