From 5b98bfdf70f0d7718626fb088d11e5910559eec3 Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 11 Nov 2024 17:05:49 +0000 Subject: [PATCH 01/11] Add getAgent test (connection test) + more lint --- docs/api/conformance/Basic-Tests.md | 14 +++++++++++++ docs/api/conformance/Intents-Tests.md | 4 ++-- docs/api/conformance/Metadata-Tests.md | 24 +++++++++++----------- docs/api/conformance/Open-Tests.md | 2 +- docs/api/conformance/Overview.md | 6 ++---- docs/api/conformance/User-Channel-Tests.md | 18 ++++++++-------- 6 files changed, 40 insertions(+), 28 deletions(-) diff --git a/docs/api/conformance/Basic-Tests.md b/docs/api/conformance/Basic-Tests.md index d58c8b3e2..150e366a7 100644 --- a/docs/api/conformance/Basic-Tests.md +++ b/docs/api/conformance/Basic-Tests.md @@ -10,6 +10,20 @@ hide_title: true _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._ +## Connection + +![2.2+](https://img.shields.io/badge/FDC3-2.2+-purple) In FDC3 2.2, a new interface was introduced to support Browser-based FDC3 Desktop Agents, known as a 'Desktop Agent Proxy', and a new [`getAgent`](../ref/GetAgent) API call was introduced to all apps to retrieve the Desktop Agent API via that interface or the existing 'Desktop Agent Preload' interface. This test pack checks that the a connection is made correctly via `getAgent`. + +| App | Step | Description | +|-----|-----------------|----------------------------------------------------------| +| A | `getAgent` | A calls `getAgent` and waits for the promise to resolve to a `DesktopAgent` instance. | +| A | `getInfo` | A can call the `getInfo()` method on the `DesktopAgent` instance to get the `ImplementationMetadata` object.
Check that fdc3Version is set to 2.2.
Check that provider and providerVersion are populated. | +| A | `getUserChannels`| A can call the `getUserChannels()` method on the `DesktopAgent` instance to get the `Channel` objects representing the system channels.
Check **user** channels are returned.| + +- `GetAgentAPI`: Perform the above test. + +## Basic API Usage + - `BasicCL1`: You can create a context listener by calling `fdc3.addContextListener('fdc3.contact',)`. A `Listener` object is returned and can be used to remove the listener again by calling its `unsubscribe` function. - `BasicCL2`: You can create an **unfiltered** context listener by calling `fdc3.addContextListener(null,)`. A `Listener` object is returned and can be used to remove the listener again by calling its `unsubscribe` function. - `BasicIL1`: You can create an intent listener by calling `fdc3.addIntentListener(,)`. A `Listener` object is returned and can be used to remove the listener again by calling its `unsubscribe` function. diff --git a/docs/api/conformance/Intents-Tests.md b/docs/api/conformance/Intents-Tests.md index 3d1c15ed2..c11145814 100644 --- a/docs/api/conformance/Intents-Tests.md +++ b/docs/api/conformance/Intents-Tests.md @@ -27,8 +27,8 @@ You will need to pre-populate the AppDirectory with the following items (some of | App | Usage | ListensFor `(pattern: intent([context-types…]) (=> result-type)`) | On Startup | |-----|-------------------------------------------------------|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------| -| A | Raise Intent tests without results | `aTestingIntent(testContextX,testContextZ)`
`sharedTestingIntent1(testContextX)` | addIntentListener() for given intents | -| B | Raise Intent tests with Context results | `bTestingIntent(testContextY)`
`sharedTestingIntent1(testContextX, testContextY) => testContextY` | addIntentListener() for given intents | +| A | Raise Intent tests without results | `aTestingIntent(testContextX,testContextZ)`
`sharedTestingIntent1(testContextX)` | addIntentListener() for given intents | +| B | Raise Intent tests with Context results | `bTestingIntent(testContextY)`
`sharedTestingIntent1(testContextX, testContextY) => testContextY` | addIntentListener() for given intents | | C | Find Intent tests (never started) | `cTestingIntent(testContextX) => testContextZ` | addIntentListener() for given intents | | D | Find Intent tests (never started) | `sharedTestingIntent2(testContextX) => testContextZ` | addIntentListener() for given intents | | E | Find Intent & Raise Intent with Channel result | `sharedTestingIntent2(testContextY) => channel` | addIntentListener() for given intents | diff --git a/docs/api/conformance/Metadata-Tests.md b/docs/api/conformance/Metadata-Tests.md index 29ebac028..048fee91d 100644 --- a/docs/api/conformance/Metadata-Tests.md +++ b/docs/api/conformance/Metadata-Tests.md @@ -18,7 +18,7 @@ You will need to pre-populate the AppDirectory with the following items: | App | Step | Details | |-----|----------------|---------------------------------------------------------------------------------------------------| -| Test | 1.getAppMetadata | Retrieve metadata for the configured app A with
`const metadata1 = await fdc3.getAppMetadata({appId: ""})` | +| Test | 1.getAppMetadata | Retrieve metadata for the configured app A with
`const metadata1 = await fdc3.getAppMetadata({appId: ""})` | | Test | 2.Confirm | Compare the `AppMetadata` object to the expected definition for the fields provided above during setup and ensure that the metadata matches. An `instanceId` should NOT be set | - `GetAppMetadata`: perform the above steps. @@ -27,11 +27,11 @@ You will need to pre-populate the AppDirectory with the following items: | App | Step | Details | |-----|----------------|---------------------------------------------------------------------------------------------------| -| Test | 1.Open1 | Open a first instance of App A using
`const appIdentifier1 = await fdc3.open({appId: ""})`
and confirm that its `AppIdentifier` contains an `instanceId`. | -| Test | 2.Open2 |Open a second instance of App A using
`const appIdentifier2 = await fdc3.open({appId: ""})`
and confirm that its `AppIdentifier` contains an `instanceId` and that its value differs from that returned for the first instance. | -| Test | 3.getAppMetadata1 | Retrieve metadata for the first instance of the app with
`const metadata1 = fdc3.getAppMetadata(appIdentifier1)` | +| Test | 1.Open1 | Open a first instance of App A using
`const appIdentifier1 = await fdc3.open({appId: ""})`
and confirm that its `AppIdentifier` contains an `instanceId`. | +| Test | 2.Open2 |Open a second instance of App A using
`const appIdentifier2 = await fdc3.open({appId: ""})`
and confirm that its `AppIdentifier` contains an `instanceId` and that its value differs from that returned for the first instance. | +| Test | 3.getAppMetadata1 | Retrieve metadata for the first instance of the app with
`const metadata1 = fdc3.getAppMetadata(appIdentifier1)` | | Test | 4.Confirm1 | Compare the `AppMetadata` object to the expected definition for the fields provided above during setup and ensure that the metadata matches. | -| Test | 5.getAppMetadata2 | Retrieve metadata for the second instance of the app with
`const metadata2 = fdc3.getAppMetadata(appIdentifier2)` | +| Test | 5.getAppMetadata2 | Retrieve metadata for the second instance of the app with
`const metadata2 = fdc3.getAppMetadata(appIdentifier2)` | | Test | 6.Confirm2 | An `instanceId` should be provided, confirm that it matches the one in `appIdentifier2` | - `AppInstanceMetadata`: Perform the above steps. @@ -40,10 +40,10 @@ You will need to pre-populate the AppDirectory with the following items: | App | Step | Details | |-----|----------------|---------------------------------------------------------------------------------------------------| -| Test | 1.Open1 | Open the first instance of App A using
`const appIdentifier1 = await fdc3.open({appId: ""})`
and confirm that its `AppIdentifier` contains an `instanceId`. | -| Test | 2.Open2 |Open a second instance of App A using
`const appIdentifier2 = await fdc3.open({appId: ""})`
and confirm that its `AppIdentifier` contains an `instanceId` and that its value differs from that returned for the first instance. | -| Test | 3.FindInstances | Retrieve details of open instances of app A with
`let instances = await fdc3.findInstances({appId: ""})`
confirm that both `appIdentifier1` and `appIdentifier2` are both present in the array. | -| Test | 4.RaiseIntent | Use `appIdentifier1` to raise an intent and target that instance, with
`const resolution = fdc3.raiseIntent("aTestingIntent", {"type": "testContextX"}, appIdentifier1)` | +| Test | 1.Open1 | Open the first instance of App A using
`const appIdentifier1 = await fdc3.open({appId: ""})`
and confirm that its `AppIdentifier` contains an `instanceId`. | +| Test | 2.Open2 |Open a second instance of App A using
`const appIdentifier2 = await fdc3.open({appId: ""})`
and confirm that its `AppIdentifier` contains an `instanceId` and that its value differs from that returned for the first instance. | +| Test | 3.FindInstances | Retrieve details of open instances of app A with
`let instances = await fdc3.findInstances({appId: ""})`
confirm that both `appIdentifier1` and `appIdentifier2` are both present in the array. | +| Test | 4.RaiseIntent | Use `appIdentifier1` to raise an intent and target that instance, with
`const resolution = fdc3.raiseIntent("aTestingIntent", {"type": "testContextX"}, appIdentifier1)` | | Test | 5.Confirm1 | Check that `resolution.source` matches `appIdentifier1` | | A | 6.ConfirmReceipt | Ensure that the instance of app A represented by `appIdentifier1` received the raised intent | @@ -53,7 +53,7 @@ You will need to pre-populate the AppDirectory with the following items: | App | Step | Details | |-----|----------------|---------------------------------------------------------------------------------------------------| -| Test | 1.getInfo |Retrieve the `ImplementationMetadata` for the DesktopAgent with
- `fdc3.getInfo().then((implMetadata) => { subsequent steps }`
**Note that the use of `then` is deliberate and intended to confirm that a promise returned (as this function switched from synchronous to asynchronous in 2.0)**| +| Test | 1.getInfo |Retrieve the `ImplementationMetadata` for the DesktopAgent with
- `fdc3.getInfo().then((implMetadata) => { subsequent steps }`
**Note that the use of `then` is deliberate and intended to confirm that a promise returned (as this function switched from synchronous to asynchronous in 2.0)**| | Test | 2.CheckVersion | Check that the `fdc3Version` variable is present and at or greater than:
- 2.0
(which you can do with the [`versionIsAtLeast` function from FDC3's Methods.ts](https://github.com/finos/FDC3/blob/add64f8302c6dcdc8437cf0e245101e927b69ec2/src/api/Methods.ts#L207):
`const isFDC3v2 = versionIsAtLeast(implMetadata, "2.0")` | | Test | 3.CheckProvider | Check that the `provider` variable is present and not an empty string | | Test | 4.CheckFeatures | Check that the `optionalFeatures`, `optionalFeatures.OriginatingAppMetadata` and `optionalFeatures.UserChannelMembershipAPIs` variables are all present and that the latter two provide boolean values | @@ -62,8 +62,8 @@ You will need to pre-populate the AppDirectory with the following items: | App | Step | Details | |-----|----------------|---------------------------------------------------------------------------------------------------| -| Test | 1.Open1 | Start an instance of App A with
`const appIdentifier1 = await fdc3.open({appId: ""})`
retrieve its `AppIdentifier` with instance details. Confirm that the `AppIdentifier` contains both an `appId` and `instanceId` | -| A | 2.getInfo | Retrieve the `ImplementationMetadata` for the DesktopAgent with:
`fdc3.getInfo().then((implMetadata) => { ... subsequent steps ...}`
This should include `AppMetadata` for the retrieving app. | +| Test | 1.Open1 | Start an instance of App A with
`const appIdentifier1 = await fdc3.open({appId: ""})`
retrieve its `AppIdentifier` with instance details. Confirm that the `AppIdentifier` contains both an `appId` and `instanceId` | +| A | 2.getInfo | Retrieve the `ImplementationMetadata` for the DesktopAgent with:
`fdc3.getInfo().then((implMetadata) => { ... subsequent steps ...}`
This should include `AppMetadata` for the retrieving app. | | A + Test | 3.Confirm | Check that `implMetadata.appMetadata` contains an `appId` and `instanceId` matching that retrieved in the first step (will require transmission of the details from A to Test or vice-versa). Also compare the `AppMetadata` object to the expected definition for the fields provided above during setup and ensure that the metadata matches. | - `GetInfo2`: Perform the above steps. diff --git a/docs/api/conformance/Open-Tests.md b/docs/api/conformance/Open-Tests.md index 08cb9eb62..261cc61e1 100644 --- a/docs/api/conformance/Open-Tests.md +++ b/docs/api/conformance/Open-Tests.md @@ -34,7 +34,7 @@ hide_title: true | App | Step | Description | |-----|-----------------|----------------------------------------------------------| | A | 1. Opening App |App A opens app B with an `fdc3.instrument` Context Object by calling a function (see below) | -| B | 2. Receive Context | Add an untyped context listener via:
`fdc3.addContextListener(null, handler)`
B receives an `fdc3.instrument` Context Object matching that passed to the `fdc3.open() call made by A | +| B | 2. Receive Context | Add an untyped context listener via:
`fdc3.addContextListener(null, handler)`
B receives an `fdc3.instrument` Context Object matching that passed to the `fdc3.open() call made by A | - `AOpensBWithContext3`: **A** uses an `AppMetadata` or `AppIdentifier` to open B, via: - `fdc3.open({appId: “”}, )` diff --git a/docs/api/conformance/Overview.md b/docs/api/conformance/Overview.md index 7f2089c38..d012f1061 100644 --- a/docs/api/conformance/Overview.md +++ b/docs/api/conformance/Overview.md @@ -9,11 +9,9 @@ hide_title: true This section contains test definitions that are used to test for conformance of a Desktop Agent API implementation with FDC3. -:::warning - -Additions to the conformance tests for functionality introduced in FDC3 2.2 are still to be defined. +:::info -Further, as FDC3 2.1 does not introduce changes to the Desktop Agent API, the conformance test set for FDC3 2.0 remains current at this time. Please see the [FDC3 2.1 Changelog entry](https://github.com/finos/FDC3/blob/main/CHANGELOG.md#fdc3-standard-21---2023-09-13) for more details. +FDC3 2.2 introduces both a new interface to web-based FDC3 Desktop Agent, known as a "Desktop Agent Proxy", as an alternative to the injection of the FDC3 APIat `window.fdc3`, which is now know as a "Desktop Agent Preload" interface `GetAgent`. 2.2 also introduces the [`getAgent`](../ref/GetAgent) function which can be used to connect to either interface and MUST be used by conformance testing apps to retrieve a interface (whichever is provided by the Desktop Agent being tested). ::: diff --git a/docs/api/conformance/User-Channel-Tests.md b/docs/api/conformance/User-Channel-Tests.md index 2ad286908..edc2b795c 100644 --- a/docs/api/conformance/User-Channel-Tests.md +++ b/docs/api/conformance/User-Channel-Tests.md @@ -12,10 +12,10 @@ hide_title: true | App | Step |Details | |-----|--------------------|----------------------------------------------------------------------------------| -| A | 1.addContextListener |A adds an _unfiltered_ Context Listener using `addContextListener(null, handler)`.
A promise resolving to a `Listener` object is returned
Check that this has an `unsubscribe` method. | -| A | 2.joinUserChannel |A joins the first available (non-global) user channel. The available Channels are retrieved with:
`fdc3.getUserChannels()`
The first channel (that does not have the id 'global') is joined with:
`fdc3.joinUserChannel()` | +| A | 1.addContextListener |A adds an _unfiltered_ Context Listener using `addContextListener(null, handler)`.
A promise resolving to a `Listener` object is returned
Check that this has an `unsubscribe` method. | +| A | 2.joinUserChannel |A joins the first available (non-global) user channel. The available Channels are retrieved with:
`fdc3.getUserChannels()`
The first channel (that does not have the id 'global') is joined with:
`fdc3.joinUserChannel()` | | B | 3.joinUserChannel |B joins the same channel as A, via the same process in 2. | -| B | 4.Broadcast | B broadcasts an `fdc3.instrument` context to the channel using `fdc3.broadcast()`.
Check a `void` promise is returned. | +| B | 4.Broadcast | B broadcasts an `fdc3.instrument` context to the channel using `fdc3.broadcast()`.
Check a `void` promise is returned. | | A | 5.Receive Context | A receives the instrument object, matching the one broadcast by B. | - `UCBasicUsage1` Perform above test. @@ -27,10 +27,10 @@ hide_title: true | App | Step |Details | |-----|--------------------|----------------------------------------------------------------------------------| -| A | 1.addContextListener |A adds a `fdc3.instrument` _typed_ Context Listener using `addContextListener("fdc3.instrument", handler)`.
A promise resolving a `Listener` object is returned
Check that this has an `unsubscribe` function.| -| A | 2.joinUserChannel |A joins the first available user channel using:
`getUserChannels()` Check **user** channels are returned.
Call `fdc3.joinChannel()` on the first non-global channel.| +| A | 1.addContextListener |A adds a `fdc3.instrument` _typed_ Context Listener using `addContextListener("fdc3.instrument", handler)`.
A promise resolving a `Listener` object is returned
Check that this has an `unsubscribe` function.| +| A | 2.joinUserChannel |A joins the first available user channel using:
`getUserChannels()` Check **user** channels are returned.
Call `fdc3.joinChannel()` on the first non-global channel.| | B | 3.joinUserChannel |B joins the same channel as A, via the same process in 2. | -| B | 4.Broadcast | B broadcasts:
1.`fdc3.broadcast()`.
2. `fdc3.broadcast()`
Check a `void` promise is returned. | +| B | 4.Broadcast | B broadcasts:
1.`fdc3.broadcast()`.
2. `fdc3.broadcast(
)`
Check a `void` promise is returned. | | A | 5.Receive Context | A receives the `fdc3.instrument` object, matching the one broadcast by B.
Check that the `fdc3.contact` is NOT received. | - `UCFilteredUsage1` Perform above test. @@ -42,10 +42,10 @@ hide_title: true | App | Step | Details | |-----|--------------------|-------------------------------------------------------------------------------------------------------------| -| A | 1.addContextListeners | A sets up two Context Listeners. One for `fdc3.instrument` and one for `fdc3.contact` by calling: `addContextListener ("fdc3.instrument", handler)`
`addContextListener ("fdc3.contact", handler)`
A promise resolving a `Listener` object is returned for each.
Check that this has an `unsubscribe` method for each. | -| A | 2.joinUserChannel |A joins the first available user channel using:
`getUserChannels()` Check **user** channels are returned.
Call `fdc3.joinChannel()` on the first non-global channel.| +| A | 1.addContextListeners | A sets up two Context Listeners. One for `fdc3.instrument` and one for `fdc3.contact` by calling: `addContextListener ("fdc3.instrument", handler)`
`addContextListener ("fdc3.contact", handler)`
A promise resolving a `Listener` object is returned for each.
Check that this has an `unsubscribe` method for each. | +| A | 2.joinUserChannel |A joins the first available user channel using:
`getUserChannels()` Check **user** channels are returned.
Call `fdc3.joinChannel()` on the first non-global channel.| | B | 3.joinUserChannel |B joins the same channel as A, via the same process in 2. | -| B | 4.Broadcast | `fdc3.broadcast()`
`fdc3.broadcast()` . | +| B | 4.Broadcast | `fdc3.broadcast()`
`fdc3.broadcast()` . | | A | 5.Receive Context | A's `fdc3.instrument` object matches the one broadcast by B, and arrives on the correct listener.
A's `fdc3.contact` object matches the one broadcast by B, and arrives on the correct listener. | - `UCFilteredUsage5`: Perform above test. From d53ff6caeb10144ea3c11499e9658106aa7d5d21 Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 11 Nov 2024 17:38:07 +0000 Subject: [PATCH 02/11] Adding userChannelChanged event test --- docs/api/conformance/Intents-Tests.md | 2 +- docs/api/conformance/User-Channel-Tests.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/api/conformance/Intents-Tests.md b/docs/api/conformance/Intents-Tests.md index c11145814..34f478e84 100644 --- a/docs/api/conformance/Intents-Tests.md +++ b/docs/api/conformance/Intents-Tests.md @@ -209,7 +209,7 @@ Finally, please note that this is a larger set of apps than were required for 1. ## Resolving Ambiguous Intents -FDC3 Desktop Agent MUST provide a method of resolving ambiguous intents (i.e. those that might be resolved by multiple applications) or unspecified intents (calls to raiseIntentForContext that return multiple options). This is often accomplished by providing a user interface allowing the user to select the desired target application or intent and application. +An FDC3 Desktop Agent MUST provide a method of resolving ambiguous intents (i.e. those that might be resolved by multiple applications) or unspecified intents (calls to raiseIntentForContext that return multiple options). This is often accomplished by providing a user interface allowing the user to select the desired target application or intent and application. As the methods of resolving ambiguous intents are often user interactive, it is either difficult or impossible to implement an automated test for this. Hence, manual tests should be performed as a final step in a conformance test. These tests are based on the same applications defined for and used in other intent tests - however a separate manual test app should be provided to enable the test. diff --git a/docs/api/conformance/User-Channel-Tests.md b/docs/api/conformance/User-Channel-Tests.md index edc2b795c..7b108c8f4 100644 --- a/docs/api/conformance/User-Channel-Tests.md +++ b/docs/api/conformance/User-Channel-Tests.md @@ -54,3 +54,19 @@ hide_title: true - `UCFilteredUsageUnsubscribe`: Perform above test, except that after joining, **A** then `unsubscribe()`s from the channel using the `listener.unsubscribe` function. Check that **A** does NOT receive anything. - `UCFilteredUsageLeave`: Perform above test, except that immediately after joining, **A** _leaves the channel_, and so receives nothing. - `UCFilteredUsageNoJoin`: Perform the above test, but skip step 2 so that **A** does NOT join a channel. Confirm that the _current channel_ for **A** is NOT set before continuing with the rest of the test. **A** should receive nothing. + +## Event on channel changed + +![2.2+](https://img.shields.io/badge/FDC3-2.2+-purple) In FDC3 2.2, a new interface `addEventListener` function was added allowing an app to listen for events raised. In 2.2 only one event is supported, `userChannelChanged`. + +An FDC3 Desktop Agent MUST provide a method to set the current User Channel for an application. This is often accomplished by providing a control within the user interface of a window or frame, allowing the user to select the desired channel. + +As the method of setting the user channel is user interactive, it is either difficult or impossible to implement an automated test for this. Hence, manual tests should be performed as a final step in a conformance test. A separate manual test app should be provided to enable the test. + +| App | Step | Details | +|---|---|---| +| ChannelChangedEvent | 1. Open the test application | A dedicated test application for FDC3ChannelChangedEvent should be opened. | +| ChannelChangedEvent | 2. Register for `userChannelChanged` event | `await fdc3.addEventListener("userChannelChanged", handler);`
The `handler` function should log or render details of events received| +| User | 3. Set User Channel | The user should set the current user channel of the app and change it a few times. Details of each change should be displayed by the test app. | + +- `2.2-ChannelChangedEvent`: ![2.2+](https://img.shields.io/badge/FDC3-2.2+-purple) Perform the above test. From 16bab760918d77dcaf32c92d56bc946f0b9911c8 Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 11 Nov 2024 17:43:45 +0000 Subject: [PATCH 03/11] CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b3065d365..b07d9db2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Typescript definitions for Web Connection Protocol (WCP). These constitute the messages used to establish connectivity between "@finos/fdc3" and a Browser-Resident DA. ([#1191](https://github.com/finos/FDC3/pull/1191)) * Added support for broadcast actions to the `fdc3.action` context type, allowing an Action to represent the broadcast of a specified context to an app or user channel. ([#1368](https://github.com/finos/FDC3/pull/1368)) * Added conformance tests into the FDC3 API documentation in the current version and backported into 2.0 and 2.1. Removed outdated 1.2 conformance tests (which are preserved in the older 2.0 and 2.1 versions). ([#1417](https://github.com/finos/FDC3/pull/1417)). +* Added conformance tests to documentation for features introduced in FDC3 2.2 (`fdc3.addEventListener`, `PrivateChannel.addEventListener` and `getAgent`). ([#1425](https://github.com/finos/FDC3/pull/1425)) ### Changed From db0ebd39a06479b87be4ec5012ac59bf573262ed Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 11 Nov 2024 17:58:09 +0000 Subject: [PATCH 04/11] Updating privatechannel lifecycle event tests to 2.2 spec --- docs/api/conformance/Intents-Tests.md | 38 ++++++++++++++------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/docs/api/conformance/Intents-Tests.md b/docs/api/conformance/Intents-Tests.md index 34f478e84..62c577866 100644 --- a/docs/api/conformance/Intents-Tests.md +++ b/docs/api/conformance/Intents-Tests.md @@ -186,26 +186,28 @@ Finally, please note that this is a larger set of apps than were required for 1. ## PrivateChannel Lifecycle Events +![2.2+](https://img.shields.io/badge/FDC3-2.2+-purple) In FDC3 2.2, the existing [`PrivateChannel`](../ref/PrivateChannel) lifecycle event functions (`onAddContextListener`, `onUnsubscribe` and `onDisconnect`) functions were deprecated in favour of a new [`addEventListener`](https://fdc3.finos.org/docs/next/api/ref/PrivateChannel#addeventlistener) function which supports events of all three types. Hence, the tests in this section have been updated to use [`addEventListener`](https://fdc3.finos.org/docs/next/api/ref/PrivateChannel#addeventlistener). + | App | Step | Details | |-------|-----------------|---------------------------------------------------------------------------------------------------| -| Test | 1. Raise intent | Test raises an intent with `fdc3.raiseIntent(‘"kTestingIntent", testContextX, {appId: ""})`
starts app K. | -| K | 2. Receive Intent & Context | After starting up, K runs `fdc3.addIntentListener("kTestingIntent")` to register its listener.
It them receives `testContextX`, matching that sent by Test | -| Test | 3. IntentResolution | The `raiseIntent` call returns an `IntentResolution` Object with an `AppIdentifier` as the `source field` with App K's `appId` and `instanceId` set. | -| Test | 4. await results | Test should `await resolution.getResult()` on the `IntentResolution` object returned in the previous step. A promise should be returned quickly. | -| K | 5. Create PrivateChannel and setup event listeners | K should create a `PrivateChannel` object via `const privChan = await fdc3.createPrivateChannel()`,
it should then add listeners for the 3 events offered + a context listener via:
- `const listener1 = await privChan.onAddContextListener(handler1);`
- `const listener2 = await privChan.onUnsubscribe(handler2);`
- `const listener3 = await privChan.onDisconnect(handler3);`
- `const listener4 = await privChan.addContextListener("testContextX", handler4)`
it should then return the `PrivateChannel`. | -| Test | 6. receive PrivateChannel | The promise received by Test from `resolution.getResult()` should resolve to a `PrivateChannel` object. Confirm that the `type` of the Channel object is "private". | -| Test | 7. addContextListener | Test should add a context listener to the PrivateChannel object via `const listener1 = privChan.addContextListener("testContextZ", handler)` | -| K | 8. Receive event & broadcast context | The `onAddContextListener` handler (`listener1`) added in step 5 should fire after Test adds its listener. Once it has, K should broadcast a short stream of `testContextZ` objects, with consecutive integer values in them (e.g. 1-5). | -| Test | 9. Unsubscribe listener | Test should confirm receipt of the expected context objects, in the expected order, broadcast by K. It should then remove its context listener with `listener1.unsubscribe().` | -| K | 10. Receive unsubscribe event | The event handler registered by K via `onUnsubscribe` should fire. If it does not and the test moves to a subsequent step, K should indicate this to the test runner (failing the test).| -| Test | 11. Broadcast context | Test should broadcast at least one `testContextX` object via the PrivateChannel (back to K). | -| K | 12. Receive context | K should confirm receipt of the expected context. If it does not and the test moves to a subsequent step K should indicate this to the test runner (failing the test).| -| Test | 13. re-run addContextListener | Test should (again) add a context listener to the PrivateChannel object via `const listener2 = privChan.addContextListener("testContextZ", handler)` | -| K | 14. Receive event & broadcast context | The `onAddContextListener` handler added in step 5 should (again) fire after Test adds its listener. Once it has, K should again broadcast a short stream of `testContextZ` objects, with consecutive integer values in them (e.g. 6-10). | -| Test | 15. Disconnect | Test should (again) confirm receipt of the expected context objects, in the expected order, broadcast by K. It should then disconnect from the channel with [`privChan.disconnect().`](https://fdc3.finos.org/docs/api/ref/PrivateChannel#disconnect) | -| K | 16. Receive events & cleanup | The `onUnsubscribe` handler added in step 5 should (again) fire after Test calls `privChan.disconnect()`. Subsequently, the `onDisconnect` handler also added in step 5 should fire. Once it has, K can unsubscribe its listeners, indicate to the test runner that all steps were completed and close. | - -- `2.0-PrivateChannelsLifecycleEvents`: Perform the above test. +| Test | 1. Raise intent | Test raises an intent with `fdc3.raiseIntent(‘"kTestingIntent", testContextX, {appId: ""})`
starts app K. | +| K | 2. Receive Intent & Context | After starting up, K runs `fdc3.addIntentListener("kTestingIntent")` to register its listener.
It them receives `testContextX`, matching that sent by Test | +| Test | 3. IntentResolution | The `raiseIntent` call returns an `IntentResolution` Object with an `AppIdentifier` as the `source field` with App K's `appId` and `instanceId` set. | +| Test | 4. await results | Test should `await resolution.getResult()` on the `IntentResolution` object returned in the previous step. A promise should be returned quickly. | +| K | 5. Create PrivateChannel and setup event listeners | K should create a `PrivateChannel` object via `const privChan = await fdc3.createPrivateChannel()`,
it should then add listeners for the 3 events offered + a context listener via:
- `const listener1 = await privChan.addEventListener("addContextListener", handler1);`
- `const listener2 = await privChan.addEventListener("unsubscribe", handler2);`
- `const listener3 = await privChan.addEventListener("disconnect", handler3);`
- `const listener4 = await privChan.addContextListener("testContextX", handler4)`
it should then return the `PrivateChannel`. | +| Test | 6. receive PrivateChannel | The promise received by Test from `resolution.getResult()` should resolve to a `PrivateChannel` object. Confirm that the `type` of the Channel object is "private". | +| Test | 7. addContextListener | Test should add a context listener to the PrivateChannel object via `const testListener1 = privChan.addContextListener("testContextZ", contextHandler)` | +| K | 8. Receive event & broadcast context | The handler for the "addContextListener" event (`handler1`) added in step 5 should fire after Test adds its listener. Once it has, K should broadcast a short stream of `testContextZ` objects, with consecutive integer values in them (e.g. 1-5). | +| Test | 9. Unsubscribe listener | Test should confirm receipt of the expected context objects, in the expected order, broadcast by K. It should then remove its context listener with `testListener1.unsubscribe().` | +| K | 10. Receive unsubscribe event | The "unsubscribe" event handler registered by K (`handler2`) should fire. If it does not and the test moves to a subsequent step, K should indicate this to the test runner (failing the test).| +| Test | 11. Broadcast context | Test should broadcast at least one `testContextX` object via the PrivateChannel (back to K). | +| K | 12. Receive context | K should confirm receipt of the expected context. If it does not and the test moves to a subsequent step K should indicate this to the test runner (failing the test).| +| Test | 13. re-run addContextListener | Test should (again) add a context listener to the PrivateChannel object via `const testListener2 = privChan.addContextListener("testContextZ", contextHandler)` | +| K | 14. Receive event & broadcast context | The "addContextListener" event handler added in step 5 (`handler``) should (again) fire after Test adds its listener. Once it has, K should again broadcast a short stream of `testContextZ` objects, with consecutive integer values in them (e.g. 6-10). | +| Test | 15. Disconnect | Test should (again) confirm receipt of the expected context objects, in the expected order, broadcast by K. It should then disconnect from the channel with [`privChan.disconnect().`](https://fdc3.finos.org/docs/api/ref/PrivateChannel#disconnect) | +| K | 16. Receive events & cleanup | The "unsubscribe" event handler added in step 5 (`handler2`) should (again) fire after Test calls `privChan.disconnect()`. Subsequently, the "disconnect" handler also added in step 5 (`handler3`) should fire. Once it has, K can unsubscribe its listeners, indicate to the test runner that all steps were completed and close. | + +- `2.2-PrivateChannelsLifecycleEvents`: ![2.2+](https://img.shields.io/badge/FDC3-2.2+-purple) Perform the above test. ## Resolving Ambiguous Intents From b054b1d5d4f5642b135dab2a94461e745ad1c993 Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 11 Nov 2024 18:00:54 +0000 Subject: [PATCH 05/11] CHANGELOG corrections --- CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b07d9db2c..2b4fabad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,12 +15,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Added reference materials and supported platforms information for FDC3 in .NET via the [finos/fdc3-dotnet](https://github.com/finos/fdc3-dotnet) project. ([#1108](https://github.com/finos/FDC3/pull/1108)) * Specifications for getAgent() and Browser-Resident Desktop Agents. ([#1191](https://github.com/finos/FDC3/pull/1191)) * Specification for Preload Desktop Agents. This content was previously in the supported platforms section. It had been revised and amended to include recommended behavior related to the new validateAppIdentity() function. ([#1191](https://github.com/finos/FDC3/pull/1191)) -* Added optional validateAppIdentity() function to DesktopAgent interface. ([#1191](https://github.com/finos/FDC3/pull/1191)) * Typescript definitions for getAgent() and related types. ([#1191](https://github.com/finos/FDC3/pull/1191)) * Typescript definitions for Desktop Agent Communication Protocol (DACP). These constitute the internal "wire protocol" that the "@finos/fdc3" library uses to communicate with Browser-Resident DAs. ([#1191](https://github.com/finos/FDC3/pull/1191)) * Typescript definitions for Web Connection Protocol (WCP). These constitute the messages used to establish connectivity between "@finos/fdc3" and a Browser-Resident DA. ([#1191](https://github.com/finos/FDC3/pull/1191)) * Added support for broadcast actions to the `fdc3.action` context type, allowing an Action to represent the broadcast of a specified context to an app or user channel. ([#1368](https://github.com/finos/FDC3/pull/1368)) -* Added conformance tests into the FDC3 API documentation in the current version and backported into 2.0 and 2.1. Removed outdated 1.2 conformance tests (which are preserved in the older 2.0 and 2.1 versions). ([#1417](https://github.com/finos/FDC3/pull/1417)). +* Added conformance tests into the FDC3 API documentation in the current version and back-ported into 2.0 and 2.1. Removed outdated 1.2 conformance tests (which are preserved in the older 2.0 and 2.1 versions). ([#1417](https://github.com/finos/FDC3/pull/1417)). * Added conformance tests to documentation for features introduced in FDC3 2.2 (`fdc3.addEventListener`, `PrivateChannel.addEventListener` and `getAgent`). ([#1425](https://github.com/finos/FDC3/pull/1425)) ### Changed @@ -41,7 +40,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Spin off fileAttachment into its own schema, and correct related examples ([1255](https://github.com/finos/FDC3/issues/1255)) * Added missing `desktopAgent` field to ImplementationMetadata objects returned for all agents connect to a DesktopAgent bridge in Connection Step 6 connectAgentsUpdate messages and refined the schema used to collect this info in step 3 handshake. ([#1177](https://github.com/finos/FDC3/pull/1177)) * Removed the `version` field from `IntentResolution` as there are no version fields for intents in the FDC3 API definitions and hence the field has no purpose. ([#1170](https://github.com/finos/FDC3/pull/1170)) - * Fixed error in the Client-side example from `PrivateChannel` and `addIntentListener` by correcting `id.symbol` to `id.ticker` to align with the `fdc3.instrument` context. ([#1314](https://github.com/finos/FDC3/pull/1314)) ## [npm v2.1.1] - 2024-06-28 From 3e790a2d4af3bfd561361f17372f7b767eb3c16c Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 11 Nov 2024 18:12:25 +0000 Subject: [PATCH 06/11] Adjusting conformance test overview admonitions --- docs/api/conformance/Overview.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/api/conformance/Overview.md b/docs/api/conformance/Overview.md index d012f1061..36e943b04 100644 --- a/docs/api/conformance/Overview.md +++ b/docs/api/conformance/Overview.md @@ -9,13 +9,17 @@ hide_title: true This section contains test definitions that are used to test for conformance of a Desktop Agent API implementation with FDC3. -:::info +:::note FDC3 2.2 introduces both a new interface to web-based FDC3 Desktop Agent, known as a "Desktop Agent Proxy", as an alternative to the injection of the FDC3 APIat `window.fdc3`, which is now know as a "Desktop Agent Preload" interface `GetAgent`. 2.2 also introduces the [`getAgent`](../ref/GetAgent) function which can be used to connect to either interface and MUST be used by conformance testing apps to retrieve a interface (whichever is provided by the Desktop Agent being tested). ::: -You can find the implementation of these tests in the [FDC3 Conformance Framework](https://github.com/finos/FDC3-conformance-framework) project. +:::info + +Where tests were introduced in this version of FDC3, they are labelled with an in the header, like so: ![2.2](https://img.shields.io/badge/FDC3-2.2-purple) + +::: There are currently 6 sections to the tests. @@ -26,8 +30,4 @@ There are currently 6 sections to the tests. - [Metadata Tests](Metadata-Tests.md) - [Intents Tests](Intents-Tests.md) -:::info - -Where tests were introduced in this version of FDC3, they are labelled with an in the header, like so: ![2.2](https://img.shields.io/badge/FDC3-2.2-purple) - -::: +You can find the implementation of these tests in the [FDC3 Conformance Framework](https://github.com/finos/FDC3-conformance-framework) project. From 80d57b89e07d985835b519600aacbcc620e95fc8 Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 11 Nov 2024 18:13:12 +0000 Subject: [PATCH 07/11] Adding 2.2 label in basic tests --- docs/api/conformance/Basic-Tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/conformance/Basic-Tests.md b/docs/api/conformance/Basic-Tests.md index 150e366a7..7757941c8 100644 --- a/docs/api/conformance/Basic-Tests.md +++ b/docs/api/conformance/Basic-Tests.md @@ -20,7 +20,7 @@ _These are some basic sanity tests implemented in the FDC3 Conformance Framework | A | `getInfo` | A can call the `getInfo()` method on the `DesktopAgent` instance to get the `ImplementationMetadata` object.
Check that fdc3Version is set to 2.2.
Check that provider and providerVersion are populated. | | A | `getUserChannels`| A can call the `getUserChannels()` method on the `DesktopAgent` instance to get the `Channel` objects representing the system channels.
Check **user** channels are returned.| -- `GetAgentAPI`: Perform the above test. +- `GetAgentAPI`: ![2.2+](https://img.shields.io/badge/FDC3-2.2+-purple) Perform the above test. ## Basic API Usage From 32787de7202ab7049186c27b1fdd50e69d3f844b Mon Sep 17 00:00:00 2001 From: Kris West Date: Wed, 13 Nov 2024 16:59:12 +0000 Subject: [PATCH 08/11] remove warning about defining 2.2 conformance tests ...as this PR, #1426, does that --- docs/fdc3-compliance.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/fdc3-compliance.md b/docs/fdc3-compliance.md index 31798ef5a..56e144eb8 100644 --- a/docs/fdc3-compliance.md +++ b/docs/fdc3-compliance.md @@ -76,14 +76,6 @@ The FDC3 Standards include a set of [definitions for conformance tests](api/conf The current set of tests focus on the Desktop Agent API and the interface to it. Tests are not yet defined for the App Directory API or Bridging API Parts of the FDC3 Standard, hence, conformance to those parts of the Standard must be determined manually. -:::warning - -Additions to the conformance tests for functionality introduced in FDC3 2.2 are still to be defined. - -Further, as FDC3 2.1 does not introduce changes to the Desktop Agent API, the conformance test set for FDC3 2.0 remains current at this time. Please see the [FDC3 2.1 Changelog entry](https://github.com/finos/FDC3/blob/main/CHANGELOG.md#fdc3-standard-21---2023-09-13) for more details. - -::: - The FDC3 Conformance tests are implemented for JavaScript/TypeScript web applications by the [FDC3 Conformance Framework](https://github.com/finos/FDC3-conformance-framework). Desktop Agent implementors working with web interfaces (Desktop Agent Preload or Desktop Agent Proxy) can clone the conformance framework and run the tests locally to determine if their agent is compliant with the Standard. Once a Desktop Agent has passed the conformance tests locally, its authors can [apply for a formal certification of compliance with the Standard from FINOS](https://github.com/finos/FDC3-conformance-framework/blob/main/instructions.md). Please note the [Terms and Conditions](https://github.com/finos/FDC3-conformance-framework/blob/main/terms-conditions/FDC3-Certified-Terms.md) of the Conformance Program. From 9d884c6355e697fd9817518c57eab13adab6aafb Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 25 Nov 2024 14:36:36 +0000 Subject: [PATCH 09/11] Ensure privateChannel lifecycle events conformance tests also cover null type listeners --- docs/api/conformance/Intents-Tests.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/api/conformance/Intents-Tests.md b/docs/api/conformance/Intents-Tests.md index 62c577866..ac9a5914d 100644 --- a/docs/api/conformance/Intents-Tests.md +++ b/docs/api/conformance/Intents-Tests.md @@ -194,18 +194,18 @@ Finally, please note that this is a larger set of apps than were required for 1. | K | 2. Receive Intent & Context | After starting up, K runs `fdc3.addIntentListener("kTestingIntent")` to register its listener.
It them receives `testContextX`, matching that sent by Test | | Test | 3. IntentResolution | The `raiseIntent` call returns an `IntentResolution` Object with an `AppIdentifier` as the `source field` with App K's `appId` and `instanceId` set. | | Test | 4. await results | Test should `await resolution.getResult()` on the `IntentResolution` object returned in the previous step. A promise should be returned quickly. | -| K | 5. Create PrivateChannel and setup event listeners | K should create a `PrivateChannel` object via `const privChan = await fdc3.createPrivateChannel()`,
it should then add listeners for the 3 events offered + a context listener via:
- `const listener1 = await privChan.addEventListener("addContextListener", handler1);`
- `const listener2 = await privChan.addEventListener("unsubscribe", handler2);`
- `const listener3 = await privChan.addEventListener("disconnect", handler3);`
- `const listener4 = await privChan.addContextListener("testContextX", handler4)`
it should then return the `PrivateChannel`. | +| K | 5. Create PrivateChannel and setup event listeners | K should create a `PrivateChannel` object via `const privChan = await fdc3.createPrivateChannel()`,
it should then add listeners for the 3 events offered + a context listener via:
- `const listener1 = await privChan.addEventListener("addContextListener", handler1);`
- `const listener2 = await privChan.addEventListener("unsubscribe", handler2);`
- `const listener3 = await privChan.addEventListener("disconnect", handler3);`
- `const listener4 = await privChan.addEventListener(null, handler4);`
- `const listener5 = await privChan.addContextListener("testContextX", handler5)`
it should then return the `PrivateChannel`. | | Test | 6. receive PrivateChannel | The promise received by Test from `resolution.getResult()` should resolve to a `PrivateChannel` object. Confirm that the `type` of the Channel object is "private". | | Test | 7. addContextListener | Test should add a context listener to the PrivateChannel object via `const testListener1 = privChan.addContextListener("testContextZ", contextHandler)` | -| K | 8. Receive event & broadcast context | The handler for the "addContextListener" event (`handler1`) added in step 5 should fire after Test adds its listener. Once it has, K should broadcast a short stream of `testContextZ` objects, with consecutive integer values in them (e.g. 1-5). | +| K | 8. Receive event & broadcast context | The handlers for both the "addContextListener" event (`handler1`) and all events (`handler4`) added in step 5 should fire after Test adds its listener. Once it has, K should broadcast a short stream of `testContextZ` objects, with consecutive integer values in them (e.g. 1-5). | | Test | 9. Unsubscribe listener | Test should confirm receipt of the expected context objects, in the expected order, broadcast by K. It should then remove its context listener with `testListener1.unsubscribe().` | -| K | 10. Receive unsubscribe event | The "unsubscribe" event handler registered by K (`handler2`) should fire. If it does not and the test moves to a subsequent step, K should indicate this to the test runner (failing the test).| +| K | 10. Receive unsubscribe event | The handlers for both the "unsubscribe" event (`handler2`)and all events registered by K (`handler4`) should fire. If either does not and the test moves to a subsequent step, K should indicate this to the test runner (failing the test).| | Test | 11. Broadcast context | Test should broadcast at least one `testContextX` object via the PrivateChannel (back to K). | | K | 12. Receive context | K should confirm receipt of the expected context. If it does not and the test moves to a subsequent step K should indicate this to the test runner (failing the test).| | Test | 13. re-run addContextListener | Test should (again) add a context listener to the PrivateChannel object via `const testListener2 = privChan.addContextListener("testContextZ", contextHandler)` | -| K | 14. Receive event & broadcast context | The "addContextListener" event handler added in step 5 (`handler``) should (again) fire after Test adds its listener. Once it has, K should again broadcast a short stream of `testContextZ` objects, with consecutive integer values in them (e.g. 6-10). | +| K | 14. Receive event & broadcast context | Both the "addContextListener" event handler (`handler1`) and handler for all events (`handler4`) added in step 5 should (again) fire after Test adds its listener. Once it has, K should again broadcast a short stream of `testContextZ` objects, with consecutive integer values in them (e.g. 6-10). | | Test | 15. Disconnect | Test should (again) confirm receipt of the expected context objects, in the expected order, broadcast by K. It should then disconnect from the channel with [`privChan.disconnect().`](https://fdc3.finos.org/docs/api/ref/PrivateChannel#disconnect) | -| K | 16. Receive events & cleanup | The "unsubscribe" event handler added in step 5 (`handler2`) should (again) fire after Test calls `privChan.disconnect()`. Subsequently, the "disconnect" handler also added in step 5 (`handler3`) should fire. Once it has, K can unsubscribe its listeners, indicate to the test runner that all steps were completed and close. | +| K | 16. Receive events & cleanup | Both the "unsubscribe" event handler (`handler2`) and handler for all events (`handler4`) added in step 5 should (again) fire after Test calls `privChan.disconnect()`. Subsequently, both the "disconnect" handler (`handler3`) and handler for all events (`handler4`) also added in step 5 should fire. Once they have, K can unsubscribe its listeners, indicate to the test runner that all steps were completed and close. | - `2.2-PrivateChannelsLifecycleEvents`: ![2.2+](https://img.shields.io/badge/FDC3-2.2+-purple) Perform the above test. From c54ad567409e04751e303111ae5c1a5fab0c28f7 Mon Sep 17 00:00:00 2001 From: Kris West Date: Tue, 10 Dec 2024 18:30:17 +0000 Subject: [PATCH 10/11] Apply suggestions from code review Co-authored-by: kemerava <52539182+kemerava@users.noreply.github.com> --- docs/api/conformance/Basic-Tests.md | 6 +++--- docs/api/conformance/Intents-Tests.md | 2 +- docs/api/conformance/Overview.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/api/conformance/Basic-Tests.md b/docs/api/conformance/Basic-Tests.md index 7757941c8..52b76e530 100644 --- a/docs/api/conformance/Basic-Tests.md +++ b/docs/api/conformance/Basic-Tests.md @@ -16,9 +16,9 @@ _These are some basic sanity tests implemented in the FDC3 Conformance Framework | App | Step | Description | |-----|-----------------|----------------------------------------------------------| -| A | `getAgent` | A calls `getAgent` and waits for the promise to resolve to a `DesktopAgent` instance. | -| A | `getInfo` | A can call the `getInfo()` method on the `DesktopAgent` instance to get the `ImplementationMetadata` object.
Check that fdc3Version is set to 2.2.
Check that provider and providerVersion are populated. | -| A | `getUserChannels`| A can call the `getUserChannels()` method on the `DesktopAgent` instance to get the `Channel` objects representing the system channels.
Check **user** channels are returned.| +| A | `getAgent` | App A calls `getAgent` and waits for the promise to resolve to a `DesktopAgent` instance. | +| A | `getInfo` | App A can call the `getInfo()` method on the `DesktopAgent` instance to get the `ImplementationMetadata` object.
Check that fdc3Version is set to 2.2.
Check that provider and providerVersion are populated. | +| A | `getUserChannels`| App A can call the `getUserChannels()` method on the `DesktopAgent` instance to get the `Channel` objects representing the system channels.
Check **user** channels are returned.| - `GetAgentAPI`: ![2.2+](https://img.shields.io/badge/FDC3-2.2+-purple) Perform the above test. diff --git a/docs/api/conformance/Intents-Tests.md b/docs/api/conformance/Intents-Tests.md index ac9a5914d..2a60cce87 100644 --- a/docs/api/conformance/Intents-Tests.md +++ b/docs/api/conformance/Intents-Tests.md @@ -199,7 +199,7 @@ Finally, please note that this is a larger set of apps than were required for 1. | Test | 7. addContextListener | Test should add a context listener to the PrivateChannel object via `const testListener1 = privChan.addContextListener("testContextZ", contextHandler)` | | K | 8. Receive event & broadcast context | The handlers for both the "addContextListener" event (`handler1`) and all events (`handler4`) added in step 5 should fire after Test adds its listener. Once it has, K should broadcast a short stream of `testContextZ` objects, with consecutive integer values in them (e.g. 1-5). | | Test | 9. Unsubscribe listener | Test should confirm receipt of the expected context objects, in the expected order, broadcast by K. It should then remove its context listener with `testListener1.unsubscribe().` | -| K | 10. Receive unsubscribe event | The handlers for both the "unsubscribe" event (`handler2`)and all events registered by K (`handler4`) should fire. If either does not and the test moves to a subsequent step, K should indicate this to the test runner (failing the test).| +| K | 10. Receive unsubscribe event | The handlers for both the "unsubscribe" event (`handler2`) and all events registered by K (`handler4`) should fire. If either does not and the test moves to a subsequent step, K should indicate this to the test runner (failing the test).| | Test | 11. Broadcast context | Test should broadcast at least one `testContextX` object via the PrivateChannel (back to K). | | K | 12. Receive context | K should confirm receipt of the expected context. If it does not and the test moves to a subsequent step K should indicate this to the test runner (failing the test).| | Test | 13. re-run addContextListener | Test should (again) add a context listener to the PrivateChannel object via `const testListener2 = privChan.addContextListener("testContextZ", contextHandler)` | diff --git a/docs/api/conformance/Overview.md b/docs/api/conformance/Overview.md index 36e943b04..78dfb4465 100644 --- a/docs/api/conformance/Overview.md +++ b/docs/api/conformance/Overview.md @@ -11,7 +11,7 @@ This section contains test definitions that are used to test for conformance of :::note -FDC3 2.2 introduces both a new interface to web-based FDC3 Desktop Agent, known as a "Desktop Agent Proxy", as an alternative to the injection of the FDC3 APIat `window.fdc3`, which is now know as a "Desktop Agent Preload" interface `GetAgent`. 2.2 also introduces the [`getAgent`](../ref/GetAgent) function which can be used to connect to either interface and MUST be used by conformance testing apps to retrieve a interface (whichever is provided by the Desktop Agent being tested). +FDC3 2.2 introduces both a new interface to web-based FDC3 Desktop Agent, known as a "Desktop Agent Proxy", as an alternative to the injection of the FDC3 API at `window.fdc3`, which is now know as a "Desktop Agent Preload" interface `GetAgent`. 2.2 also introduces the [`getAgent`](../ref/GetAgent) function which can be used to connect to either interface and MUST be used by conformance testing apps to retrieve a interface (whichever is provided by the Desktop Agent being tested). ::: From b7bfc4cbb4e2eadb57116abecf4b4ad24a85b89a Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 16 Dec 2024 13:04:34 +0000 Subject: [PATCH 11/11] minor formatting in intent tests --- docs/api/conformance/Intents-Tests.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/api/conformance/Intents-Tests.md b/docs/api/conformance/Intents-Tests.md index dc25fe907..e0adbca1d 100644 --- a/docs/api/conformance/Intents-Tests.md +++ b/docs/api/conformance/Intents-Tests.md @@ -27,17 +27,17 @@ You will need to pre-populate the AppDirectory with the following items (some of | App | Usage | ListensFor `(pattern: intent([context-types…]) (=> result-type)`) | On Startup | |-----|-------------------------------------------------------|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------| -| A | Raise Intent tests without results | `aTestingIntent(testContextX,testContextZ)`
`sharedTestingIntent1(testContextX)` | addIntentListener() for given intents | -| B | Raise Intent tests with Context results | `bTestingIntent(testContextY)`
`sharedTestingIntent1(testContextX, testContextY) => testContextY` | addIntentListener() for given intents | -| C | Find Intent tests (never started) | `cTestingIntent(testContextX) => testContextZ` | addIntentListener() for given intents | -| D | Find Intent tests (never started) | `sharedTestingIntent2(testContextX) => testContextZ` | addIntentListener() for given intents | -| E | Find Intent & Raise Intent with Channel result | `sharedTestingIntent2(testContextY) => channel` | addIntentListener() for given intents | -| F | Find Intent & Raise Intent with PrivateChannel result | `sharedTestingIntent2(testContextY) => channel` * | addIntentListener() for given intents | -| G | Find Intent tests (never started) | `sharedTestingIntent2(testContextY)` | addIntentListener() for given intents | +| A | Raise Intent tests without results | `aTestingIntent(testContextX,testContextZ)`
`sharedTestingIntent1(testContextX)` | `addIntentListener()` for given intents | +| B | Raise Intent tests with Context results | `bTestingIntent(testContextY)`
`sharedTestingIntent1(testContextX, testContextY) => testContextY` | `addIntentListener()` for given intents | +| C | Find Intent tests (never started) | `cTestingIntent(testContextX) => testContextZ` | `addIntentListener()` for given intents | +| D | Find Intent tests (never started) | `sharedTestingIntent2(testContextX) => testContextZ` | `addIntentListener()` for given intents | +| E | Find Intent & Raise Intent with Channel result | `sharedTestingIntent2(testContextY) => channel` | `addIntentListener()` for given intents | +| F | Find Intent & Raise Intent with PrivateChannel result | `sharedTestingIntent2(testContextY) => channel` * | `addIntentListener()` for given intents | +| G | Find Intent tests (never started) | `sharedTestingIntent2(testContextY)` | `addIntentListener()` for given intents | | H | Raise Intent (bad config/behavior) | `sharedTestingIntent2(testContextY) => testContextZ` | - no action | -| I | Raise Intent (bad config/behavior) | `sharedTestingIntent2(testContextY) => testContextZ` | addIntentListener(‘MadeUpIntent’, handler) | +| I | Raise Intent (bad config/behavior) | `sharedTestingIntent2(testContextY) => testContextZ` | `addIntentListener(‘MadeUpIntent’, handler)` | | J | PrivateChannels are private | `privateChannelIsPrivate(privateChannelDetails) => privateChannelIsPrivateResult` | Tries to retrieve privateChannel sent in the privateChannelDetails context, fails | -| K | PrivateChannel lifecycle events | `kTestingIntent(testContextX) => channel` | addIntentListener() for given intents | +| K | PrivateChannel lifecycle events | `kTestingIntent(testContextX) => channel` | `addIntentListener()` for given intents | NB: