Skip to content

Commit

Permalink
Merged main
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed May 16, 2024
2 parents 1ec9ef4 + 747eb4f commit 98cbe21
Show file tree
Hide file tree
Showing 27 changed files with 396 additions and 278 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
[![FINOS - Incubating](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-incubating.svg)](https://finosfoundation.atlassian.net/wiki/display/FINOS/Incubating)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6456/badge)](https://bestpractices.coreinfrastructure.org/projects/6456)

|Version | Release | Specification |
|-----------|---------|--------|
|[FDC3 1.2](https://fdc3.finos.org/docs/1.2/fdc3-intro) | ![GitHub release (latest by date)](https://img.shields.io/github/v/release/finos/FDC3-Conformance-Framework) | [1.2 Tests Specification](https://github.com/finos/FDC3/blob/master/toolbox/fdc3-conformance/FDC3-1.2-Conformance-Test-Cases.md) |
|[FDC3 2.0](https://fdc3.finos.org/docs/fdc3-intro) | _in development_ | [2.0 Tests Specification](https://github.com/finos/FDC3/blob/8166c0e6aa872b2fc7b755384e5b2eeeaf88c732/toolbox/fdc3-conformance/FDC3-2.0-Conformance-Test-Cases.md) |

# FDC3 Conformance Framework

A framework for testing whether desktop containers implement the [FDC3 standard](https://fdc3.finos.org/).

The tests implemented for each FDC3 version are based on the FDC3 Conformance tests specifications defined by the FDC3 maintainers and provided in the main FDC3 repository. Please see [the README file in that repository](https://github.com/finos/FDC3/blob/master/toolbox/fdc3-conformance/README.md) for further details.

Tests are currently implemented for version [1.2](https://fdc3.finos.org/docs/1.2/fdc3-intro) and [2.0](https://fdc3.finos.org/docs/fdc3-intro) of the FDC3 Standard.

## What Is It?

- There are many vendors implementing Desktop Agents for the FDC3 standard.
Expand Down
34 changes: 20 additions & 14 deletions directories/local-conformance-2_0.v2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"applications": [{
"applications": [
{
"appId": "Conformance1",
"name": "Conformance1",
"title": "FDC3 2.0 Conformance Framework",
Expand Down Expand Up @@ -42,7 +43,16 @@
"publisher": "FINOS",
"icons": [{
"src": "http://localhost:3001/finos-icon-256.png"
}]
}],
"interop": {
"intents": {
"listensFor": {
"ConformanceListener": {
"contexts": ["fdc3.nothing"]
}
}
}
}
},
{
"appId": "ChannelsAppId",
Expand Down Expand Up @@ -130,7 +140,7 @@
"contexts": ["testContextX", "testContextZ"]
},
"sharedTestingIntent1": {
"displayName": "Shared Testing Intent",
"displayName": "Shared Testing Intent 1",
"contexts": ["testContextX"]
}
}
Expand Down Expand Up @@ -180,12 +190,8 @@
"interop": {
"intents": {
"listensFor": {
"bTestingIntent": {
"displayName": "B Testing Intent",
"contexts": ["testContextY"]
},
"sharedTestingIntent1": {
"displayName": "Shared Testing Intent",
"displayName": "Shared Testing Intent 1",
"contexts": ["testContextX", "testContextY"],
"resultType": "testContextY"
}
Expand Down Expand Up @@ -289,7 +295,7 @@
"intents": {
"listensFor": {
"sharedTestingIntent2": {
"displayName": "Shared Testing Intent",
"displayName": "Shared Testing Intent 2",
"contexts": ["testContextX"],
"resultType": "testContextZ"
}
Expand Down Expand Up @@ -341,7 +347,7 @@
"intents": {
"listensFor": {
"sharedTestingIntent2": {
"displayName": "Shared Testing Intent",
"displayName": "Shared Testing Intent 2",
"contexts": ["testContextY"],
"resultType": "channel"
}
Expand Down Expand Up @@ -393,7 +399,7 @@
"intents": {
"listensFor": {
"sharedTestingIntent2": {
"displayName": "Shared Testing Intent",
"displayName": "Shared Testing Intent 2",
"contexts": ["testContextY"],
"resultType": "channel<testContextZ>"
}
Expand Down Expand Up @@ -445,7 +451,7 @@
"intents": {
"listensFor": {
"sharedTestingIntent2": {
"displayName": "Shared Testing Intent",
"displayName": "Shared Testing Intent 2",
"contexts": ["testContextY"]
}
}
Expand Down Expand Up @@ -496,7 +502,7 @@
"intents": {
"listensFor": {
"sharedTestingIntent2": {
"displayName": "Shared Testing Intent",
"displayName": "Shared Testing Intent 2",
"contexts": ["testContextY"],
"resultType": "testContextZ"
}
Expand Down Expand Up @@ -548,7 +554,7 @@
"intents": {
"listensFor": {
"sharedTestingIntent2": {
"displayName": "Shared Testing Intent",
"displayName": "Shared Testing Intent 2",
"contexts": ["testContextY"],
"resultType": "testContextZ"
}
Expand Down
6 changes: 5 additions & 1 deletion options/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

For maintainers: Please add any vendor-specific code only in this directory.

For users: Please note that this directory contains vendor-specific extensions to aid in the testing of the conformance of different Desktop Agents. It doesn't form part of the Conformance Framework proper.
For users:

- Please note that this directory contains vendor-specific extensions to aid in the testing of the conformance of different Desktop Agents. It doesn't form part of the Conformance Framework proper.
- If you wish to test glue42 core-plus, you'll need to supply a license key.

7 changes: 1 addition & 6 deletions options/glue/v2.0/glue42/core-plus/startCorePlusRunner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const init = async () => {
const config = {
licenseKey: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcmF0aW9uIjoxNjkzNTE1NjAwLCJ0eXBlIjoidHJpYWwifQ.VOHEfGyNlgTfLexfDWfqUMLgH5pCjLqYjW3mON2J8Ec",
licenseKey: "<<add license key here>",
applications: {
local: [
{
Expand Down Expand Up @@ -53,11 +53,6 @@ const init = async () => {
height: 600,
},
intents: [
{
name: "bTestingIntent",
displayName: "B Testing Intent",
contexts: ["testContextY"],
},
{
name: "sharedTestingIntent1",
displayName: "Shared Testing Intent",
Expand Down
5 changes: 0 additions & 5 deletions options/glue/v2.0/glue42/startRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ const init = async () => {
height: 600,
},
intents: [
{
name: "bTestingIntent",
displayName: "B Testing Intent",
contexts: ["testContextY"],
},
{
name: "sharedTestingIntent1",
displayName: "Shared Testing Intent",
Expand Down
6 changes: 3 additions & 3 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
const constants = {
ShortWait: 1000,
Fdc3Timeout: 500, // The amount of time to wait for the FDC3Ready event during initialisation
TestTimeout: 15000, // Tests that take longer than this (in milliseconds) will fail
WaitTime: 3000, // The amount of time to wait for mock apps to finish processing
WindowCloseWaitTime: 3000, // The amount of time to allow for clean-up of closed windows
TestTimeout: 20000, // Tests that take longer than this (in milliseconds) will fail
WaitTime: 5000, // The amount of time to wait for mock apps to finish processing
WindowCloseWaitTime: 1000, // The amount of time to allow for clean-up of closed windows
NoListenerTimeout: 120000, // the amount of time to allow for a DA to timeout waiting on a context or intent listener
// FDC3 does not define this timeout so this should be extended if the DA uses a longer timeout
ControlChannel: "app-control", //app channel used for passing messages between mock apps and tests
Expand Down
6 changes: 3 additions & 3 deletions src/mock/v2.0/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { closeWindowOnCompletion, onFdc3Ready } from "./mock-functions";
import { DesktopAgent } from "fdc3_2_0/dist/api/DesktopAgent";
import { sendContextToTests } from "./mock-functions";
import { AppControlContext } from "../../context-types";
import { Intent } from "../../test/v2.0/support/intent-support-2.0";
import { ControlContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";
declare let fdc3: DesktopAgent;
onFdc3Ready().then(async () => {
await closeWindowOnCompletion();
Expand All @@ -12,14 +12,14 @@ onFdc3Ready().then(async () => {
// broadcast that this app has received context
if (context.type === "fdc3.instrument") {
await sendContextToTests({
type: "context-received",
type: ControlContextType.contextReceived,
context: context,
} as AppControlContext);
}
});
} catch (ex) {
await sendContextToTests({
type: "context-received",
type: ControlContextType.contextReceived,
errorMessage: `${ex.message ?? ex}`,
} as AppControlContext);
}
Expand Down
8 changes: 4 additions & 4 deletions src/mock/v2.0/intent-a.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { sendContextToTests } from "../v2.0/mock-functions";
import { wait } from "../../utils";
import { IntentUtilityContext } from "../../context-types";
import { IntentResult, DesktopAgent } from "fdc3_2_0";
import { ContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";
import { ContextType, ControlContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";
declare let fdc3: DesktopAgent;

onFdc3Ready().then(async () => {
Expand All @@ -17,7 +17,7 @@ onFdc3Ready().then(async () => {
const { appMetadata } = await fdc3.getInfo();

await sendContextToTests({
type: "aTestingIntent-listener-triggered",
type: ControlContextType.aTestingIntentListenerTriggered,
instanceId: appMetadata.instanceId,
});

Expand All @@ -29,14 +29,14 @@ onFdc3Ready().then(async () => {
await delayExecution(context.delayBeforeReturn);

await sendContextToTests({
type: "sharedTestingIntent1-listener-triggered",
type: ControlContextType.sharedTestingIntent1ListenerTriggered,
});

return context;
});

await sendContextToTests({
type: "intent-app-a-opened",
type: ControlContextType.intentAppAOpened,
});
});

Expand Down
8 changes: 4 additions & 4 deletions src/mock/v2.0/intent-b.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { DesktopAgent } from "fdc3_2_0/dist/api/DesktopAgent";
import { sendContextToTests } from "../v2.0/mock-functions";
import { wait } from "../../utils";
import { AppControlContext, IntentUtilityContext } from "../../context-types";
import { Intent } from "../../test/v2.0/support/intent-support-2.0";
import { ControlContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";
declare let fdc3: DesktopAgent;
onFdc3Ready().then(async () => {
await closeWindowOnCompletion();
Expand All @@ -14,14 +14,14 @@ onFdc3Ready().then(async () => {
// broadcast that this app has received context
if (context.type === "fdc3.instrument") {
await sendContextToTests({
type: "context-received",
type: ControlContextType.contextReceived,
context: context,
} as AppControlContext);
}
});
} catch (ex) {
await sendContextToTests({
type: "context-received",
type: ControlContextType.contextReceived,
errorMessage: `${ex.message ?? ex}`,
} as AppControlContext);
}
Expand All @@ -33,7 +33,7 @@ onFdc3Ready().then(async () => {
}

await sendContextToTests({
type: "sharedTestingIntent1-listener-triggered",
type: ControlContextType.sharedTestingIntent1ListenerTriggered,
});

return context;
Expand Down
6 changes: 3 additions & 3 deletions src/mock/v2.0/intent-c.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { closeWindowOnCompletion, onFdc3Ready } from "./mock-functions";
import { DesktopAgent } from "fdc3_2_0/dist/api/DesktopAgent";
import { sendContextToTests } from "../v2.0/mock-functions";
import { AppControlContext } from "../../context-types";
import { Intent } from "../../test/v2.0/support/intent-support-2.0";
import { ControlContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";
declare let fdc3: DesktopAgent;
onFdc3Ready().then(async () => {
await closeWindowOnCompletion();
Expand All @@ -12,14 +12,14 @@ onFdc3Ready().then(async () => {
// broadcast that this app has received context
if (context.type === "fdc3.instrument") {
await sendContextToTests({
type: "context-received",
type: ControlContextType.contextReceived,
context: context,
} as AppControlContext);
}
});
} catch (ex) {
await sendContextToTests({
type: "context-received",
type: ControlContextType.contextReceived,
errorMessage: `${ex.message ?? ex}`,
} as AppControlContext);
}
Expand Down
16 changes: 10 additions & 6 deletions src/mock/v2.0/intent-e.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import { closeWindowOnCompletion, onFdc3Ready, sendContextToTests, validateContext } from "./mock-functions";
import { DesktopAgent } from "fdc3_2_0";
import { wait } from "../../utils";
import { ContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";
import { ContextType, ControlContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";
import constants from "../../constants";

declare let fdc3: DesktopAgent;

//used in '2.0-RaiseIntentChannelResult'
onFdc3Ready().then(async () => {
await closeWindowOnCompletion();
const { appMetadata } = await fdc3.getInfo();

fdc3.addIntentListener(Intent.sharedTestingIntent2, async (context) => {
validateContext(context.type, ContextType.testContextY);
const channel = await fdc3.getOrCreateChannel("test-channel");

//set-up alert to test framework that the task was completed after a short delay
setTimeout(async () => {
await sendContextToTests({ type: ControlContextType.sharedTestingIntent2ResultSent, id: { key: "uniqueId" }, instanceId: appMetadata.instanceId });
}, constants.ShortWait)

return channel;
});

const { appMetadata } = await fdc3.getInfo();

await wait(); // send context after short delay
await sendContextToTests({ type: ContextType.testContextZ, id: { key: "uniqueId" }, instanceId: appMetadata.instanceId });
});
16 changes: 10 additions & 6 deletions src/mock/v2.0/intent-f.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import { closeWindowOnCompletion, onFdc3Ready, sendContextToTests, validateContext } from "./mock-functions";
import { DesktopAgent } from "fdc3_2_0";
import { wait } from "../../utils";
import { ContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";
import { ContextType, ControlContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";
import constants from "../../constants";
declare let fdc3: DesktopAgent;

//used in '2.0-RaiseIntentPrivateChannelResult'
onFdc3Ready().then(async () => {
await closeWindowOnCompletion();
const { appMetadata } = await fdc3.getInfo();

fdc3.addIntentListener(Intent.sharedTestingIntent2, async (context) => {
validateContext(context.type, ContextType.testContextY);
const privateChannel = await fdc3.createPrivateChannel();

//set-up alert to test framework that the task was completed after a short delay
setTimeout(async () => {
await sendContextToTests({ type: ControlContextType.sharedTestingIntent2ResultSent, id: { key: "uniqueId" }, instanceId: appMetadata.instanceId });
}, constants.ShortWait)

return privateChannel;
});

const { appMetadata } = await fdc3.getInfo();

await wait(); // send context after short delay
await sendContextToTests({ type: ContextType.testContextZ, id: { key: "uniqueId" }, instanceId: appMetadata.instanceId });
});
6 changes: 3 additions & 3 deletions src/mock/v2.0/intent-j.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { closeWindowOnCompletion, onFdc3Ready, sendContextToTests, validateContext } from "./mock-functions";
import { ChannelError, DesktopAgent } from "fdc3_2_0";
import { ContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";
import { ContextType, ControlContextType, Intent } from "../../test/v2.0/support/intent-support-2.0";

declare let fdc3: DesktopAgent;

Expand All @@ -13,10 +13,10 @@ onFdc3Ready().then(async () => {

try {
await fdc3.getOrCreateChannel(context.id.key);
await sendContextToTests({ type: "error", errorMessage: "No error thrown when calling fdc3.getOrCreateChannel('<idPassedInContext>') from the mock app" });
await sendContextToTests({ type: ControlContextType.error, errorMessage: "No error thrown when calling fdc3.getOrCreateChannel('<idPassedInContext>') from the mock app" });
} catch (ex) {
if (ex.message !== ChannelError.AccessDenied) {
await sendContextToTests({ type: "error", errorMessage: `Incorrect error received when calling fdc3.getOrCreateChannel('<idPassedInContext>'). Expected AccessDenied, got ${ex.message}` });
await sendContextToTests({ type: ControlContextType.error, errorMessage: `Incorrect error received when calling fdc3.getOrCreateChannel('<idPassedInContext>'). Expected AccessDenied, got ${ex.message}` });
}
}

Expand Down
Loading

0 comments on commit 98cbe21

Please sign in to comment.