Skip to content
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

Merged
merged 1 commit into from
Jun 18, 2017
Merged

Architecture overview #132

merged 1 commit into from
Jun 18, 2017

Conversation

DanielMSchmidt
Copy link
Contributor

@DanielMSchmidt DanielMSchmidt commented May 19, 2017

Hey there, just added a bit of docs on how detox works under the hood, I hope it helps 👍👍

%% 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();
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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 :)

Copy link
Contributor Author

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)

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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!

@@ -0,0 +1,11 @@
%% Ca( for flowchart below
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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.

@DanielMSchmidt DanielMSchmidt force-pushed the docs/diagrams branch 3 times, most recently from ce89ba9 to 8524ac9 Compare June 5, 2017 09:01
@DanielMSchmidt
Copy link
Contributor Author

@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.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correlate

@@ -0,0 +1,19 @@
sequenceDiagram
participant Test Runner(1)
participant Detox(3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tester

participant Test Runner(1)
participant Detox(3)
participant Detox Server(5)
participant Detox Client(7)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testee

@@ -0,0 +1,17 @@
# Architecture Deep Dive
Copy link
Member

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
Copy link
Member

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!

%% 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)
Copy link
Member

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.

Copy link
Contributor Author

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 👍

@@ -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)
Copy link
Member

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

@DanielMSchmidt
Copy link
Contributor Author

@rotemmiz Pushed the next iteration, hope it is better suited for merge than the previous one ;)

@rotemmiz rotemmiz merged commit e2a3cc9 into wix:master Jun 18, 2017
@DanielMSchmidt DanielMSchmidt deleted the docs/diagrams branch June 18, 2017 20:48
@DanielMSchmidt
Copy link
Contributor Author

🎉

@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants