-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Architecture overview #132
Conversation
docs/img-src/action-sequence.mmd
Outdated
%% Note over mocha,Detox Server: Runs on your computer | ||
%% Note over Detox Client,Earl Grey: Runs on the device | ||
|
||
mocha->>Detox Server: element(by.label('Click Me')).tap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detox is unopinionated re test runner, change mocha to "test runner"
Detox server is actually something else. detox-server
is a different module that runs a web socket server, letting both tester (detox logic inside a test runner) and testee (detox code inside a device) communicate with each other. Both tester and testee are websocket clients
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explaining 👍
@@ -0,0 +1,3 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be too picky, but the img output is not pretty enough. I imagine something slicker :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know a better alternative for mermaid? I would love to have something with a source code, because it makes the whole thing extensible to other developers. (in contrast to a PS file or something)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mermeid might be a good solution, but we need to either restructure the diagram, or at least remove the arrows going from one end point to itself, it makes the diagram much clearer IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I will try a few more ways and link them here so we can discuss it on a visual basis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new way is much nicer!
docs/img-src/architecture.mmd
Outdated
@@ -0,0 +1,11 @@ | |||
%% Ca( for flowchart below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diagram doesn't make much sense, what's the addition on top of the bigger diagram ?
I think its a bit confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it helped my understand which parts of the system even exist in detox and what their responsibilities are, but I can remove it if you don't like it
@@ -0,0 +1,3 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mermeid might be a good solution, but we need to either restructure the diagram, or at least remove the arrows going from one end point to itself, it makes the diagram much clearer IMO.
ce89ba9
to
8524ac9
Compare
@rotemmiz I redid the diagram and move a lot of its complexity to text so it is more extensible. I hope to extend it in the future with other kinds of interactions like assertions or device rotation or other things. |
docs/Guide.Architecture.md
Outdated
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correlate
docs/img-src/action-sequence.mmd
Outdated
@@ -0,0 +1,19 @@ | |||
sequenceDiagram | |||
participant Test Runner(1) | |||
participant Detox(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tester
docs/img-src/action-sequence.mmd
Outdated
participant Test Runner(1) | ||
participant Detox(3) | ||
participant Detox Server(5) | ||
participant Detox Client(7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testee
docs/Guide.Architecture.md
Outdated
@@ -0,0 +1,17 @@ | |||
# Architecture Deep Dive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is less of an architecture overview and more of a "How Detox Works" document, it is also not really a guide.
After going through the docs again, I think it best fits as a subsection/example in Introduction.HowDetoxWorks.md
@@ -0,0 +1,3 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new way is much nicer!
docs/img-src/action-sequence.mmd
Outdated
%% 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should only number the actions, not the participants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain that a bit? would you name Test Runner, Detox, etc only in the text? I would find that a bit confusing if you try to get a general overview of what exactly is happening 👍
docs/Guide.Contributing.md
Outdated
@@ -94,4 +93,8 @@ To run the e2e tests, after the application was built. | |||
npm run e2e | |||
``` | |||
|
|||
### Architecture | |||
|
|||
For more details on how Detox works under the hood, please see [our Architecture Guide](Guide.Architecture.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This relates to "How Detox Works", not a part of Contributing
8524ac9
to
abccac8
Compare
abccac8
to
344d59e
Compare
@rotemmiz Pushed the next iteration, hope it is better suited for merge than the previous one ;) |
🎉 |
Hey there, just added a bit of docs on how detox works under the hood, I hope it helps 👍👍