Open Tests
A Opens B
App | Step | Description |
---|---|---|
A | 1. Opening App | App A calls a function (see below) to open a second app, B |
A | 2. Check Metadata | Ensure that the correct app was opened |
AOpensB1
:A uses
fdc3.open("app B Name")
AOpensB2
:A uses
fdc3.open({name: "<app B Name>"})
AOpensB3
: A uses anAppMetadata
orAppIdentifier
to open B, via:fdc3.open({name: "<app B Name>", appId: "<app B ID>"})
fdc3.open({appId: "<app B ID>"})
AOpensB4
:A uses an
AppIdentifier
to open B and retrieves an updatedAppIdentifier
with aninstanceId
set viaconst instanceIdentifier = await fdc3.open({appId: "<app B ID>"})
. Ensure that theappId
matches that requested and that aninstanceId
property has been set.
A Fails To Open Another App
App | Step | Description |
---|---|---|
A | 1. Opening App | App A calls a function (see below) to try and open a non-existent app |
A | 2. Check Error Response | fdc3.open throws an Error with the message "App Not Found"fdc3.open returns a promise that rejects with an Error with the message "App Not Found" |
AFailsToOpenB1
:A uses
fdc3.open("non existent app")
AFailsToOpenB2
:A uses
fdc3.open({name: "non existent app"})
AFailsToOpenB3
: A uses anAppMetadata
orAppIdentifier
to open B, via:fdc3.open({name: "non existent app", appId: "non existent app"})
fdc3.open({appId: "<app B ID>"})
A Opens B With Context
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 |
AOpensBWithContext1
:A uses
fdc3.open("app B Name", <fdc3.instrument context>)
AOpensBWithContext2
:A uses
fdc3.open({name: "<app B Name>"}, <fdc3.instrument context>)
AOpensBWithContext3
: A uses anAppMetadata
orAppIdentifier
to open B, via:fdc3.open({name: "<app B Name>", appId: "<app B ID>"}, <fdc3.instrument context>)
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 additionalfdc3.addContextListener('fdc3.contact', handler)
prior to the existingaddContextListener
forfdc3.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
fdc3.open
call throws an Error with messageAppTimeout
The promise returned to A by
fdc3.open
rejects with an Error with messageAppTimeout