Skip to main content
Version: Next

Metadata & Instance Test Cases

You will need to pre-populate the AppDirectory with the following items:

AppRequired Metadata
AGeneric AppD Record which contains at least the following fields:
- name
- version
- title
- tooltip
- description
- icons (Array<Icon>)
- screenshots (Array<Image>)
- interop.intents.listensFor (aTestingIntent with at least context type testContextX)

Retrieve AppMetadata

AppStepDetails
Test1.getAppMetadataRetrieve metadata for the configured app A with
const metadata1 = await fdc3.getAppMetadata({appId: "<A's appId>"})
Test2.ConfirmCompare 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.

Instance Metadata

AppStepDetails
Test1.Open1Open a first instance of App A using
const appIdentifier1 = await fdc3.open({appId: "<A's appId>"})
and confirm that its AppIdentifier contains an instanceId.
Test2.Open2Open a second instance of App A using
const appIdentifier2 = await fdc3.open({appId: "<A's appId>"})
and confirm that its AppIdentifier contains an instanceId and that its value differs from that returned for the first instance.
Test3.getAppMetadata1Retrieve metadata for the first instance of the app with
const metadata1 = fdc3.getAppMetadata(appIdentifier1)
Test4.Confirm1Compare the AppMetadata object to the expected definition for the fields provided above during setup and ensure that the metadata matches.
Test5.getAppMetadata2Retrieve metadata for the second instance of the app with
const metadata2 = fdc3.getAppMetadata(appIdentifier2)
Test6.Confirm2An instanceId should be provided, confirm that it matches the one in appIdentifier2
  • AppInstanceMetadata: Perform the above steps.

Finding Instances

AppStepDetails
Test1.Open1Open the first instance of App A using
const appIdentifier1 = await fdc3.open({appId: "<A's appId>"})
and confirm that its AppIdentifier contains an instanceId.
Test2.Open2Open a second instance of App A using
const appIdentifier2 = await fdc3.open({appId: "<A's appId>"})
and confirm that its AppIdentifier contains an instanceId and that its value differs from that returned for the first instance.
Test3.FindInstancesRetrieve details of open instances of app A with
let instances = await fdc3.findInstances({appId: "<A's appId>"})
confirm that both appIdentifier1 and appIdentifier2 are both present in the array.
Test4.RaiseIntentUse appIdentifier1 to raise an intent and target that instance, with
const resolution = fdc3.raiseIntent("aTestingIntent", {"type": "testContextX"}, appIdentifier1)
Test5.Confirm1Check that resolution.source matches appIdentifier1
A6.ConfirmReceiptEnsure that the instance of app A represented by appIdentifier1 received the raised intent
  • FindInstances: Perform the above steps.

Getting Info For The Agent

AppStepDetails
Test1.getInfoRetrieve 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)
Test2.CheckVersionCheck 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:
const isFDC3v2 = versionIsAtLeast(implMetadata, "2.0")
Test3.CheckProviderCheck that the provider variable is present and not an empty string
Test4.CheckFeaturesCheck that the optionalFeatures, optionalFeatures.OriginatingAppMetadata and optionalFeatures.UserChannelMembershipAPIs variables are all present and that the latter two provide boolean values
  • GetInfo1: Perform the above steps.
AppStepDetails
Test1.Open1Start an instance of App A with
const appIdentifier1 = await fdc3.open({appId: "<A's appId>"})
retrieve its AppIdentifier with instance details. Confirm that the AppIdentifier contains both an appId and instanceId
A2.getInfoRetrieve the ImplementationMetadata for the DesktopAgent with:
fdc3.getInfo().then((implMetadata) => { ... subsequent steps ...}
This should include AppMetadata for the retrieving app.
A + Test3.ConfirmCheck 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.