Skip to content

Commit 680d0bc

Browse files
authored
Merge pull request #260 from jupnit/bugfix/2_0-conformance-osff-2024
Bugfixes: FDC3 2.0 Conformance OSFF 2024
2 parents 747eb4f + 749939e commit 680d0bc

5 files changed

Lines changed: 87 additions & 85 deletions

File tree

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const constants = {
55
ShortWait: 1000,
66
Fdc3Timeout: 500, // The amount of time to wait for the FDC3Ready event during initialisation
77
TestTimeout: 20000, // Tests that take longer than this (in milliseconds) will fail
8+
ManualTimeout: 100000, // Manual tests that take longer than this (in milliseconds) will fail
89
WaitTime: 5000, // The amount of time to wait for mock apps to finish processing
910
WindowCloseWaitTime: 1000, // The amount of time to allow for clean-up of closed windows
1011
NoListenerTimeout: 120000, // the amount of time to allow for a DA to timeout waiting on a context or intent listener

src/test/v2.0/advanced/fdc3.findIntent.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ export default () =>
4141

4242
it("(2.0-FindIntentAppDMultiple1) Should find intent 'sharedTestingIntent2' belonging to multiple apps (intent-a & intent-b)", async () => {
4343
const appIntent = await fdc3.findIntent(Intent.sharedTestingIntent2);
44-
validateAppIntent(appIntent, 6, { name: Intent.sharedTestingIntent2, displayName: "Shared Testing Intent" }, IntentApp.IntentAppD);
44+
validateAppIntent(appIntent, 6, { name: Intent.sharedTestingIntent2, displayName: "Shared Testing Intent 2" }, IntentApp.IntentAppD);
4545
});
4646

4747
it("(IntentAppDMultiple2) Should find intent 'sharedTestingIntent2' belonging to multiple apps (intent-a & intent-b) filtered by specific context 'testContextY'", async () => {
4848
const appIntent = await fdc3.findIntent(Intent.sharedTestingIntent2, { type: ContextType.testContextY });
49-
validateAppIntent(appIntent, 5, { name: Intent.sharedTestingIntent2, displayName: "Shared Testing Intent" }, IntentApp.IntentAppE);
49+
validateAppIntent(appIntent, 5, { name: Intent.sharedTestingIntent2, displayName: "Shared Testing Intent 2" }, IntentApp.IntentAppE);
5050
});
5151

5252
it("(2.0-FindIntentAppDByResultSingle) Should find intent 'cTestingIntent' belonging only to app intent-c with context 'testContextX' and result type 'testContextZ'", async () => {
@@ -61,17 +61,17 @@ export default () =>
6161

6262
it("(2.0-FindIntentAppDByResultMultiple) Should find intent 'sharedTestingIntent1' belonging only to app intent-b with context 'testContextX' and result type 'testContextY'", async () => {
6363
const appIntent = await fdc3.findIntent(Intent.sharedTestingIntent1, { type: ContextType.testContextX }, ContextType.testContextY);
64-
validateAppIntent(appIntent, 1, { name: Intent.sharedTestingIntent1, displayName: "Shared Testing Intent" }, IntentApp.IntentAppB);
64+
validateAppIntent(appIntent, 1, { name: Intent.sharedTestingIntent1, displayName: "Shared Testing Intent 1" }, IntentApp.IntentAppB);
6565
});
6666

6767
it("(2.0-FindIntentAppDByResultChannel1) Should find intent 'sharedTestingIntent2' belonging only to apps intent-e and itent-f with context 'testContextY' and result type 'channel", async () => {
6868
const appIntent = await fdc3.findIntent(Intent.sharedTestingIntent2, { type: ContextType.testContextY }, "channel");
69-
validateAppIntent(appIntent, 2, { name: Intent.sharedTestingIntent2, displayName: "Shared Testing Intent" }, IntentApp.IntentAppE);
69+
validateAppIntent(appIntent, 2, { name: Intent.sharedTestingIntent2, displayName: "Shared Testing Intent 2" }, IntentApp.IntentAppE);
7070
});
7171

7272
it("(2.0-FindIntentAppDByResultChannel2) Should find intent 'sharedTestingIntent2' belonging only to app intent-c with context 'testContextY' and result type 'channel<testContextZ>'", async () => {
7373
const appIntent = await fdc3.findIntent(Intent.sharedTestingIntent2, { type: ContextType.testContextY }, "channel<testContextZ>");
74-
validateAppIntent(appIntent, 1, { name: Intent.sharedTestingIntent2, displayName: "Shared Testing Intent" }, IntentApp.IntentAppF);
74+
validateAppIntent(appIntent, 1, { name: Intent.sharedTestingIntent2, displayName: "Shared Testing Intent 2" }, IntentApp.IntentAppF);
7575
});
7676
});
7777

src/test/v2.0/advanced/fdc3.raiseIntent.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ChannelError, PrivateChannel, Listener } from "fdc3_2_0";
22
import { assert, expect } from "chai";
33
import { RaiseIntentControl2_0, IntentResultType, IntentApp, ContextType, Intent, ControlContextType } from "../support/intent-support-2.0";
44
import { closeMockAppWindow } from "../fdc3-2_0-utils";
5+
import { wait } from "../../../utils";
56

67
const control = new RaiseIntentControl2_0();
78

@@ -103,7 +104,7 @@ export default () =>
103104
const PrivateChannelsLifecycleEvents = "(2.0-PrivateChannelsLifecycleEvents) PrivateChannel lifecycle events are triggered when expected";
104105
it(PrivateChannelsLifecycleEvents, async () => {
105106
errorListener = await control.listenForError();
106-
let onUnsubscribeReceiver = control.receiveContext(ControlContextType.onUnsubscribeTriggered);
107+
const onUnsubscribeReceiver = control.receiveContext(ControlContextType.onUnsubscribeTriggered);
107108
const intentResolution = await control.raiseIntent(Intent.kTestingIntent, ContextType.testContextX, {
108109
appId: IntentApp.IntentAppK,
109110
});
@@ -113,11 +114,12 @@ export default () =>
113114
let listener = await control.receiveContextStreamFromMockApp(<PrivateChannel>result, 1, 5);
114115
control.unsubscribeListener(listener);
115116
await onUnsubscribeReceiver; //should receive context from privChannel.onUnsubscribe in mock app
116-
let textContextXReceiver = control.receiveContext(ContextType.testContextX);
117+
const textContextXReceiver = control.receiveContext(ContextType.testContextX);
118+
await wait(300); // ADDED DUE TO RACE CONDITION in intent-support-2.0.ts/receiveContext on line 12.
117119
control.privateChannelBroadcast(<PrivateChannel>result, ContextType.testContextX);
118120
await textContextXReceiver;
119-
let onUnsubscribeReceiver2 = control.receiveContext(ControlContextType.onUnsubscribeTriggered);
120-
let onDisconnectReceiver = control.receiveContext(ControlContextType.onDisconnectTriggered);
121+
const onUnsubscribeReceiver2 = control.receiveContext(ControlContextType.onUnsubscribeTriggered);
122+
const onDisconnectReceiver = control.receiveContext(ControlContextType.onDisconnectTriggered);
121123
let listener2 = await control.receiveContextStreamFromMockApp(<PrivateChannel>result, 6, 10);
122124
control.disconnectPrivateChannel(<PrivateChannel>result);
123125

Lines changed: 73 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { ResolveError, DesktopAgent } from "fdc3_2_0";
1+
import { DesktopAgent } from "fdc3_2_0";
22

33
import { closeMockAppWindow } from "../fdc3-2_0-utils";
44
import { assert, expect } from "chai";
55
import { APIDocumentation2_0 } from "../apiDocuments-2.0";
66
import { ContextType, IntentApp, Intent, RaiseIntentControl2_0 } from "../support/intent-support-2.0";
7-
import constants from "../../../constants";
87
import { wait } from "../../../utils";
98

109

@@ -19,81 +18,81 @@ declare let fdc3: DesktopAgent;
1918
*/
2019

2120
export let fdc3ResolveAmbiguousIntentTarget_2_0 = () => describe("ResolveAmbiguousIntentTarget_2.0", () => {
22-
after(async function after() {
23-
await closeMockAppWindow(this.currentTest.title);
24-
});
25-
const ResolveAmbiguousIntentTarget = "(ResolveAmbiguousIntentTarget) Should be able to raise intent using Intent and Context and manually select an app out of 'E','F','G','H' and 'I'";
26-
it(ResolveAmbiguousIntentTarget, async () => {
27-
try {
28-
const context = {
29-
type: ContextType.testContextY,
30-
};
31-
await fdc3.raiseIntent(Intent.sharedTestingIntent2, context);
32-
} catch (ex) {
33-
assert.fail(raiseIntentDocs + (ex.message ?? ex));
34-
}
35-
});
21+
after(async function after() {
22+
await closeMockAppWindow(this.currentTest.title);
3623
});
24+
const ResolveAmbiguousIntentTarget = "(ResolveAmbiguousIntentTarget) Should be able to raise intent using Intent and Context and manually select an app out of 'E','F','G','H' and 'I'";
25+
it(ResolveAmbiguousIntentTarget, async () => {
26+
try {
27+
const context = {
28+
type: ContextType.testContextY,
29+
};
30+
await fdc3.raiseIntent(Intent.sharedTestingIntent2, context);
31+
} catch (ex) {
32+
assert.fail(raiseIntentDocs + (ex.message ?? ex));
33+
}
34+
});
35+
});
36+
37+
export let fdc3ResolveAmbiguousContextTarget_2_0 = () => describe("ResolveAmbiguousContextTarget_2.0", () => {
38+
after(async function after() {
39+
await closeMockAppWindow(this.currentTest.title);
40+
});
41+
const ResolveAmbiguousIntentTarget = "(ResolveAmbiguousContextTarget) Should be able to raise intent using ContextY and manually select an app out of 'E','F','G','H' and 'I'";
42+
it(ResolveAmbiguousIntentTarget, async () => {
43+
try {
44+
const context = {
45+
type: ContextType.testContextY,
46+
};
47+
await fdc3.raiseIntentForContext(context);
48+
} catch (ex) {
49+
assert.fail(raiseIntentDocs + (ex.message ?? ex));
50+
}
51+
});
52+
});
3753

38-
export let fdc3ResolveAmbiguousContextTarget_2_0 = () => describe("ResolveAmbiguousContextTarget_2.0", () => {
39-
after(async function after() {
40-
await closeMockAppWindow(this.currentTest.title);
41-
});
42-
const ResolveAmbiguousIntentTarget = "(ResolveAmbiguousContextTarget) Should be able to raise intent using ContextY and manually select an app out of 'E','F','G','H' and 'I'";
43-
it(ResolveAmbiguousIntentTarget, async () => {
44-
try {
45-
const context = {
46-
type: ContextType.testContextY,
47-
};
48-
await fdc3.raiseIntentForContext(context);
49-
} catch (ex) {
50-
assert.fail(raiseIntentDocs + (ex.message ?? ex));
51-
}
52-
});
54+
export let fdc3ResolveAmbiguousIntentTargetMultiInstance_2_0 = () => describe("ResolveAmbiguousIntentTargetMultiInstance_2.0", () => {
55+
after(async function after() {
56+
await closeMockAppWindow(this.currentTest.title);
5357
});
58+
const ResolveAmbiguousIntentTargetMultiInstance = "(ResolveAmbiguousIntentTargetMultiInstance) Open 2 instances of App E and AppF respectively and then should be able to raise intent using Intent and Context and manually select an app out of 'E','F','G','H' and 'I'";
59+
it(ResolveAmbiguousIntentTargetMultiInstance, async () => {
60+
try {
61+
const context = {
62+
type: ContextType.testContextY,
63+
};
64+
await control.openIntentApp(IntentApp.IntentAppE);
65+
await control.openIntentApp(IntentApp.IntentAppE);
66+
await control.openIntentApp(IntentApp.IntentAppF);
67+
await control.openIntentApp(IntentApp.IntentAppF);
68+
await wait(100);
5469

55-
export let fdc3ResolveAmbiguousIntentTargetMultiInstance_2_0 = () => describe("ResolveAmbiguousIntentTargetMultiInstance_2.0", () => {
56-
after(async function after() {
57-
await closeMockAppWindow(this.currentTest.title);
58-
});
59-
const ResolveAmbiguousIntentTargetMultiInstance = "(ResolveAmbiguousIntentTargetMultiInstance) Open 2 instances of App E and AppF respectively and then should be able to raise intent using Intent and Context and manually select an app out of 'E','F','G','H' and 'I'";
60-
it(ResolveAmbiguousIntentTargetMultiInstance, async () => {
61-
try {
62-
const context = {
63-
type: ContextType.testContextY,
64-
};
65-
await control.openIntentApp(IntentApp.IntentAppE);
66-
await control.openIntentApp(IntentApp.IntentAppE);
67-
await control.openIntentApp(IntentApp.IntentAppF);
68-
await control.openIntentApp(IntentApp.IntentAppF);
69-
await wait(100);
70-
71-
await fdc3.raiseIntent(Intent.sharedTestingIntent2, context);
72-
} catch (ex) {
73-
assert.fail(raiseIntentDocs + (ex.message ?? ex));
74-
}
75-
});
70+
await fdc3.raiseIntent(Intent.sharedTestingIntent2, context);
71+
} catch (ex) {
72+
assert.fail(raiseIntentDocs + (ex.message ?? ex));
73+
}
7674
});
75+
});
7776

78-
export let fdc3ResolveAmbiguousContextTargetMultiInstance_2_0 = () => describe("ResolveAmbiguousContextTargetMultiInstance_2.0", () => {
79-
after(async function after() {
80-
await closeMockAppWindow(this.currentTest.title);
81-
});
82-
const ResolveAmbiguousContextTargetMultiInstance = "(ResolveAmbiguousContextTargetMultiInstance) Open 2 instances of App E and AppF respectively and then should be able to raise intent using Context and manually select an app out of 'E','F','G','H' and 'I'";
83-
it(ResolveAmbiguousContextTargetMultiInstance, async () => {
84-
try {
85-
const context = {
86-
type: ContextType.testContextY,
87-
};
88-
await control.openIntentApp(IntentApp.IntentAppE);
89-
await control.openIntentApp(IntentApp.IntentAppE);
90-
await control.openIntentApp(IntentApp.IntentAppF);
91-
await control.openIntentApp(IntentApp.IntentAppF);
92-
await wait(100);
93-
94-
await fdc3.raiseIntentForContext(context);
95-
} catch (ex) {
96-
assert.fail(raiseIntentDocs + (ex.message ?? ex));
97-
}
98-
});
99-
});
77+
export let fdc3ResolveAmbiguousContextTargetMultiInstance_2_0 = () => describe("ResolveAmbiguousContextTargetMultiInstance_2.0", () => {
78+
after(async function after() {
79+
await closeMockAppWindow(this.currentTest.title);
80+
});
81+
const ResolveAmbiguousContextTargetMultiInstance = "(ResolveAmbiguousContextTargetMultiInstance) Open 2 instances of App E and AppF respectively and then should be able to raise intent using Context and manually select an app out of 'E','F','G','H' and 'I'";
82+
it(ResolveAmbiguousContextTargetMultiInstance, async () => {
83+
try {
84+
const context = {
85+
type: ContextType.testContextY,
86+
};
87+
await control.openIntentApp(IntentApp.IntentAppE);
88+
await control.openIntentApp(IntentApp.IntentAppE);
89+
await control.openIntentApp(IntentApp.IntentAppF);
90+
await control.openIntentApp(IntentApp.IntentAppF);
91+
await wait(100);
92+
93+
await fdc3.raiseIntentForContext(context);
94+
} catch (ex) {
95+
assert.fail(raiseIntentDocs + (ex.message ?? ex));
96+
}
97+
});
98+
});

src/test/v2.0/testSuite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ export const executeTestsInBrowser = (pack: string) => {
9999
*/
100100
export const executeManualTestsInBrowser = (pack: string) => {
101101
console.log('Pack',pack);
102-
(mocha as any).timeout(constants.TestTimeout);
102+
(mocha as any).timeout(constants.ManualTimeout);
103103
const suite = allManualTests[pack];
104104
console.log('************ found suite******', suite)
105105
suite.forEach((s) => s());
106106
mocha.run();
107-
};
107+
};

0 commit comments

Comments
 (0)