-
Notifications
You must be signed in to change notification settings - Fork 9
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
docs: Explain how FlowStages work and their rationale #558
Conversation
packages/openactive-integration-tests/test/helpers/flow-stages/README.md
Outdated
Show resolved
Hide resolved
FlowStages can then be queried after they've run in order to: | ||
|
||
1. Check that the FlowStage was successful | ||
- This is overridable per-FlowStage. For example, B's Flow Stage considers the run successful if the HTTP response has status 201 |
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.
Are there default success checks? I can't remember if it does a default 200 check? If so something like:
- This is overridable per-FlowStage. For example, B's Flow Stage considers the run successful if the HTTP response has status 201 | |
- This is overridable per-FlowStage. For example, B's Flow Stage considers the run successful if the HTTP response has status 201 as opposed to the default FlowStage behaviour that checks for status 200 |
The only reason I'm wondering whether there's default behaiour is due to the word "overridable". If there's no default behaviour, what's being overridden?
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.
There are not. So I'll change the word overridable
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.
DONE
- This is overridable per-FlowStage. For example, B's Flow Stage considers the run successful if the HTTP response has status 201 | ||
- FlowStage method: `itSuccessChecks()` | ||
2. Perform validation checks on the output | ||
- This is overridable per-FlowStage. In all cases, this is a case of calling [Validator](https://github.com/openactive/data-model-validator) on the HTTP output. |
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.
Same comment here re overridable
packages/openactive-integration-tests/test/helpers/flow-stages/README.md
Outdated
Show resolved
Hide resolved
|
||
Flows, consisting of Flow Stages, run the underlying API calls which are being tested, via Jest in the various Test Suite tests. | ||
|
||
Jest tests involve a custom course of execution, in which setup occurs in `beforeEach`/`beforeAll` hooks, tests are run in `it` hooks, etc. Flow Stages are designed to work with this. |
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.
Jest tests involve a custom course of execution, in which setup occurs in `beforeEach`/`beforeAll` hooks, tests are run in `it` hooks, etc. Flow Stages are designed to work with this. | |
Jest tests involve a custom course of execution, in which setup occurs in `beforeEach`/`beforeAll` hooks and tests are run in `it` hooks, etc. Flow Stages are designed to work with this. |
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've done it slightly differently involving semicolons
packages/openactive-integration-tests/test/helpers/flow-stages/README.md
Outdated
Show resolved
Hide resolved
Co-authored-by: civsiv <[email protected]>
Co-authored-by: civsiv <[email protected]>
Co-authored-by: civsiv <[email protected]>
@civsiv confirmed this as approved on another channel |
Closes #557