Skip to content

Commit

Permalink
Rename DirectSession to DomainSession
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy authored Sep 30, 2021
1 parent 42012c6 commit c8f8ad5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,19 +375,19 @@ in two places of your code:
will use it to interact with the server. This separation of concerns prevents network implementation details to
bleed into the UI code.

You'll typically have two implementations of your `Session` interface - `HttpSession` and `DirectSession`.
You'll typically have two implementations of your `Session` interface - `HttpSession` and `DomainSession`.

The `HttpSession` is where you encapsulate all of the `fetch`, `WebSocket` and `EventSource` logic. This is the class
your UI will use in production. You will also use it in tests.

The `DirectSession` is an implementation that talks directly to the server side domain layer with direct function calls
The `DomainSession` is an implementation that talks directly to the server side domain layer with direct function calls
(without any networking). This implementation will only be used in tests.

By organising your code this way, you have four ways you can run your Cucumber Scenarios.
By organising your code this way, you have four ways you can assemble your system when you run your Cucumber Scenarios.

* `session` tasks using `DirectSession` (fastest tests, domain layer coverage)
* `session` tasks using `DomainSession` (fastest tests, domain layer coverage)
* `session` tasks using `HttpSession` (slower tests, http + domain layer coverage)
* `dom` tasks using `DirectSession` (slower tests, UI + domain layer coverage)
* `dom` tasks using `DomainSession` (slower tests, UI + domain layer coverage)
* `dom` tasks using `HttpSession` (slowest tests, UI + http + domain layer coverage)

In the example we use [world parameters](https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/world.md#world-parameters)
Expand Down

0 comments on commit c8f8ad5

Please sign in to comment.