Skip to main content
Version: Next

Open Tests

A Opens B

AppStepDescription
A1. Opening AppApp A calls a function (see below) to open a second app, B
A2. Check MetadataEnsure that the correct app was opened
  • AOpensB3: A uses an AppMetadata or AppIdentifier to open B, via:
    • fdc3.open({appId: “<app B ID>”})
  • AOpensB4: A uses an AppIdentifier to open B and retrieves an updated AppIdentifier with an instanceId set via const instanceIdentifier = await fdc3.open({appId: “<app B ID>”}). Ensure that the appId matches that requested and that an instanceId property has been set.

A Fails To Open Another App

AppStepDescription
A1. Opening AppApp A calls a function (see below) to try and open a non-existent app
A2. Check Error Responsefdc3.open returns a promise that rejects with an Error with the message "App Not Found"
  • AFailsToOpenB3: A uses an AppMetadata or AppIdentifier to open B, via:
    • fdc3.open({appId: “<app B ID>”})

A Opens B With Context

AppStepDescription
A1. Opening AppApp A opens app B with an fdc3.instrument Context Object by calling a function (see below)
B2. Receive ContextAdd 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: “<app B ID>”}, <fdc3.instrument context>)
  • AOpensBWithSpecificContext: Perform AOpensBWithContext3 but replace Bs call with fdc3.addContextListener('fdc3.instrument', handler)
  • AOpensBMultipleListen: Perform AOpensBWithSpecificContext but B should perform an additional fdc3.addContextListener('fdc3.contact', handler) prior to the existing addContextListener for fdc3.instrument. The correct context listener should receive the context, and the promise completes successfully.
  • AOpensBWithWrongContext: Perform AOpensBWithSpecificContext but B should add a context listener for the wrong context type (e.g. fdc3.dummyType) instead of the expected type in step 2.
    • Confirm that NO context is received.
    • The promise returned to A by fdc3.open rejects with an Error with message AppTimeout