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 |
AOpensB3: A uses anAppMetadataorAppIdentifierto open B, via:fdc3.open({appId:"<app-B-ID>"})
AOpensB4: A uses anAppIdentifierto open B and retrieves an updatedAppIdentifierwith aninstanceIdset viaconst instanceIdentifier = await fdc3.open({appId:"<app-B-ID>"}). Ensure that theappIdmatches that requested and that aninstanceIdproperty 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 returns a promise that rejects with an Error with the message "App Not Found" |
AFailsToOpenB3: A uses anAppMetadataorAppIdentifierto open B, via: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 |
AOpensBWithContext3: A uses anAppMetadataorAppIdentifierto open B, via:fdc3.open({appId:"<app-B-ID>"}, <fdc3.instrument context>)
AOpensBWithSpecificContext: Perform AOpensBWithContext3 but replace Bs call withfdc3.addContextListener("fdc3.instrument",handler)AOpensBMultipleListen: PerformAOpensBWithSpecificContextbut B should perform an additionalfdc3.addContextListener("fdc3.contact",handler)prior to the existingaddContextListenerforfdc3.instrument. The correct context listener should receive the context, and the promise completes successfully.AOpensBWithWrongContext: PerformAOpensBWithSpecificContextbut 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.openrejects with an Error with messageAppTimeout