-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add conformance tests into docs #1417
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e6d9bbc
Migrating conformance test definitions into website
kriswest bf1faef
Adding conformance tests into current website version with overview
kriswest a26104f
Adding link to test defs + copying changes to 2.0 and 2.1 versions
kriswest ad16f45
Add admonitions relating to conformance tests
kriswest 85cc2f3
Adjusting definition of what's covered by tests
kriswest 77b6e89
Markdown lint + redacting 1.2 test info so that we can focus on 2.0+ …
kriswest 012d332
Further removals of 1.2 tests
kriswest 1af8cbd
CHANGELOG
kriswest 7cccf17
Merge branch 'main' into conformance-tests-into-docs
kriswest 122f07b
Merge branch 'main' into conformance-tests-into-docs
kriswest 8934705
Merge branch 'main' into conformance-tests-into-docs
kriswest 4099745
consistent quotes, argument patterns etc. in conformance tests
kriswest e4f220f
More consistent language in Basic tests
kriswest 7e64b52
Consistent table formatting in tests
kriswest f06f465
Be more specific about FDC3 version in conformance test BasicGI1
kriswest 961435a
Update docs/api/conformance/App-Channel-Tests.md
kriswest cceae99
Update docs/api/conformance/Intents-Tests.md
kriswest 27baa38
Update docs/api/conformance/Intents-Tests.md
kriswest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,62 @@ | ||
--- | ||
id: App-Channel-Tests | ||
sidebar_label: App Channel Tests | ||
title: App Channel Tests | ||
hide_title: true | ||
--- | ||
|
||
# App Channel Tests | ||
<!-- markdownlint-disable MD033 --> | ||
|
||
## Basic Broadcast | ||
|
||
| App | Step | Details | | ||
|-----|-------------------------|----------------------------------------------------------------------------| | ||
| A | 1. Retrieve `Channel` | Retrieve a `Channel` object representing an 'App' channel called `test-channel` using: <br />`const testChannel = await fdc3.getOrCreateChannel("test-channel")` | | ||
| A | 2. Add Context Listener | Add an _untyped_ context listener to the channel, using: <br /> !`await testChannel.addContextListener(null,handler)` | | ||
| B | 3. Retrieve `Channel` | Retrieve a `Channel` object representing the same 'App' channel A did (`test-channel`)| | ||
| B | 4. Broadcast | Broadcast an `fdc3.instrument` Context to the channel with: <br />`testChannel.broadcast(<fdc3.instrument>)`| | ||
| A | 5. Receive Context | The handler added in step 2 will receive the instrument context. Ensure that the instrument received by A is identical to that sent by B. | | ||
|
||
- `ACBasicUsage1` Perform above test. | ||
|
||
## Current Context | ||
|
||
| App | Step | Details | | ||
|-----|-----------------------------|----------------------------------------------------------------------------| | ||
| B | 1. Retrieve `Channel` |Retrieve a `Channel` object representing an 'App' channel called `test-channel` using: <br />`const testChannel = await fdc3.getOrCreateChannel("test-channel")` | | ||
| B | 2. Broadcast | Broadcast an `fdc3.instrument` to the channel using: <br />`testChannel.broadcast(<fdc3.instrument>)`| | ||
| A | 3. Retrieve `Channel` |Retrieve a `Channel` object representing the same 'App' channel B did (`test-channel`)| | ||
| A | 4. Retrieve Current Context | A gets the _current context_ of the user channel. via: `await testChannel.getCurrentContext()` <br />Ensure that the instrument received by A is identical to that sent by B | | ||
|
||
- `ACBasicUsage2` Perform above test | ||
|
||
## Filtered Context | ||
|
||
| App | Step | Details | | ||
|-----|-------------------------|-----------------------------------------------------------------| | ||
| A | 1. Retrieve `Channel` | Retrieve a `Channel` object representing an 'App' channel called `test-channel` using: <br />`const testChannel = await fdc3.getOrCreateChannel("test-channel")` | | ||
| A | 2. Add Context Listener | Add an _typed_ context listener for `fdc3.instrument`, using: <br />`await testChannel.addContextListener("fdc3.instrument",handler)`| | ||
| B | 3. Retrieve `Channel` | Retrieve a `Channel` object representing the same 'App' channel A did (`test-channel`)| | ||
| B | 4. Broadcast | B broadcasts both an `fdc3.instrument` context and an `fdc3.contact` context, using: <br /> `testChannel.broadcast(<fdc3.instrument>)` <br /> `testChannel.broadcast(<fdc3.contact>)`| | ||
| A | 5. Receive Context | An fdc3.instrument context is received by the handler added in step 2.<br />Ensure that the fdc3.instrument received by A is identical to that sent by B<br />Ensure that the fdc3.contact context is NOT received. | | ||
|
||
- `ACFilteredContext1`: Perform above test. | ||
- `ACFilteredContext2`: Perform above test, but add listeners for both `fdc3.instrument` and `fdc3.contact` in step2. Ensure that both context objects are received. | ||
- `ACFilteredContext3`: Perform above test, except creating a _different_ channel in app B. Check that you _don't_ receive anything (as the channels don't match). | ||
- `ACFilteredContext4`: Perform above test, except that after creating the channel **A** creates another channel with a further _different_ channel id and adds a further context listener to it. Ensure that **A** is still able to receive context on the first channel (i.e. it is unaffected by the additional channel) and does NOT receive anything on the second channel. | ||
- `ACUnsubscribe`: Perform above test, except that after creating the channel **A** then `unsubscribe()`s the listener it added to the channel. Check that **A** does NOT receive anything. | ||
|
||
### App Channel History | ||
|
||
| App | Step | Details | | ||
|-----|-----------------------------|---------------------------------------------------------| | ||
| A | 1. Retrieve `Channel` | Retrieve a `Channel` object representing an 'App' channel called `test-channel` using: <br />`const testChannel = await fdc3.getOrCreateChannel("test-channel")` | | ||
| B | 2. Retrieve `Channel` | Retrieve a `Channel` object representing the same 'App' channel A did (`test-channel`)| | ||
| B | 3. Broadcast | B broadcasts both the instrument context and a contact context, using: <br /> `testChannel.broadcast(<fdc3.instrument>)` <br /> `testChannel.broadcast(<fdc3.contact>)` | | ||
| A | 4. Add Context Listener | A adds a context listener to the channel _after_ B has completed all its broadcasts, via: <br />`await testChannel.addContextListener("fdc3.instrument", handler)` <br /> Ensure that A does NOT receive any context via these listeners (past context is only retrieved via a `getCurrentContext()` call on App channels). | | ||
| A | 5. Retrieve Current Context | A is able to retrieve the most recent context of each context type from the `Channel` via: <br />`const instrument = await testChannel.getCurrentContext('fdc3.instrument')`<br />`const contact = await testChannel.getCurrentContext('fdc3.contact')`<br />Ensure that both contexts retrieved by A are identical to those sent by B| | ||
|
||
- `ACContextHistoryTyped`: Perform above test. | ||
- `ACContextHistoryMultiple`: **B** Broadcasts multiple history items of both types. Ensure that only the last version of each type is received by **A**. | ||
- `ACContextHistoryLast`: In step 5. **A** retrieves the _untyped_ current context of the channel via `const currentContext = await testChannel.getCurrentContext()`. Ensure that A receives only the very last broadcast context item _of any type_. |
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,23 @@ | ||
--- | ||
id: Basic-Tests | ||
sidebar_label: Basic Tests | ||
title: Basic Tests | ||
hide_title: true | ||
--- | ||
|
||
# Basic Tests | ||
<!-- markdownlint-disable MD033 --> | ||
|
||
_These are some basic sanity tests implemented in the FDC3 Conformance Framework. It is expected that Desktop Agent testers will run these first before commencing the much more thorough tests in section 2 onwards._ | ||
|
||
- `BasicCL1`: A context listener can be created for a specific context type by calling `fdc3.addContextListener("fdc3.contact",<handler>)`. A `Listener` object is returned and can be used to remove the listener again by calling its `unsubscribe` function. | ||
- `BasicCL2`: An **unfiltered** context listener can be created by calling `fdc3.addContextListener(null,<handler>)`. A `Listener` object is returned and can be used to remove the listener again by calling its `unsubscribe` function. | ||
- `BasicIL1`: An intent listener can be created for a specific intent by calling `fdc3.addIntentListener(<intentName>,<handler>)`. A `Listener` object is returned and can be used to remove the listener again by calling its `unsubscribe` function. | ||
- `BasicGI1`: An `ImplementationMetadata` object can be retrieved, to find out the version of FDC3 that is in use along with details of the provider, by calling: | ||
- `await fdc3.getInfo()`.w The FDC3 version should match the API version being tested for conformance. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kriswest Accidental leading character. Change ".w The FDC3 version" to ". The FDC3 version". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done on #1426 |
||
- `BasicAC1`: A named 'App' channel can be retrieved via the `fdc3.getOrCreateChannel(<name>)` function. The `Channel` object returned conforms to the defined interface. | ||
- `BasicUC1`: The list available user/system channels can be retrieved as an array of `Channel` Objects conforming to the defined interface. The API call is: | ||
- `await fdc3.getUserChannels()` | ||
- `BasicJC1`: A user/system channel can be joined with the with the channel's id by calling `fdc3.joinUserChannel(<channelId>)`. Having done so, the current channel, retrieved by calling `fdc3.getCurrentChannel()` should NOT be null and should match _the channel id given_. After leaving the current channel by calling `fdc3.leaveCurrentChannel()`, it should go back to being `null`. | ||
- `BasicRI1`: A specified intent can be raised by invoking `fdc3.raiseIntent(<intent name>, <context>)`. A promise should be returned. | ||
- `BasicRI2`: An intent can be raised for some item of context by invoking: `fdc3.raiseIntentForContext(<context>)`. A promise should be returned. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@kriswest Change both
getCurrentContext(..)
references from single quotes to double quotes.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 on #1426