Skip to content

Commit

Permalink
Testing idea for next generation of the conformance framework
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed Jul 9, 2024
1 parent 4433915 commit 93c6bc3
Show file tree
Hide file tree
Showing 7 changed files with 2,523 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# dependencies
/node_modules
/ng/node_modules

# build output
/dist
6 changes: 6 additions & 0 deletions ng/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<html>
<body>
<p>Hello Vite!</p>
<script src="src/ui/testing-app.ts"></script>
</body>
</html>
2,452 changes: 2,452 additions & 0 deletions ng/package-lock.json

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions ng/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "fdc3-conformance",
"private": true,
"version": "2.2-alpha",
"scripts": {
"dev": "vite --port 3001"
},
"dependencies": {
"@cucumber/cucumber": "^10.8.0",
"@cucumber/html-formatter": "^21.4.0",
"@finos/fdc3": "^2.1.0-beta.6",
"tsx": "^4.5.0",
"typescript": "^5.3.2"
},
"devDependencies": {
"vite": "^5.3.3"
}
}
1 change: 1 addition & 0 deletions ng/src/ui/testing-app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert("hello")
30 changes: 30 additions & 0 deletions ng/test/features/intents-tests.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Feature: FDC3 Raise Intents

Background:
Given A Desktop Agent in "api1"
And "textContextX" is a context object with the following contents
| type |
| textContextX |
And the following apps are configured with the following behaviours
| App | Usage | ListensFor (pattern: intent([context-types…]) (=> result-type)) | On Startup |
| A | Raise Intent tests without results | aTestingIntent(testContextX,testContextZ) sharedTestingIntent1(testContextX) | addIntentListener() for given intents |
| B | Raise Intent tests with Context results | bTestingIntent(testContextY) sharedTestingIntent1(testContextX, testContextY) => testContextY | addIntentListener() for given intents |
| C | Find Intent tests (never started) | cTestingIntent(testContextX) => testContextZ | addIntentListener() for given intents |
| D | Find Intent tests (never started) | sharedTestingIntent2(testContextX) => testContextZ | addIntentListener() for given intents |
| E | Find Intent & Raise Intent with Channel result | sharedTestingIntent2(testContextY) => channel | addIntentListener() for given intents |
| F | Find Intent & Raise Intent with PrivateChannel result | sharedTestingIntent2(testContextY) => channel<testContextZ> * | addIntentListener() for given intents |
| G | Find Intent tests (never started) | sharedTestingIntent2(testContextY) | addIntentListener() for given intents |
| H | Raise Intent (bad config/behavior) | sharedTestingIntent2(testContextY) => testContextZ | - no action |
| I | Raise Intent (bad config/behavior) | sharedTestingIntent2(testContextY) => testContextZ | addIntentListener(‘MadeUpIntent’, handler) |
| J | PrivateChannels are private | privateChannelIsPrivate(privateChannelDetails) => privateChannelIsPrivateResult | Tries to retrieve privateChannel sent in the privateChannelDetails context, fails |
| K | PrivateChannel lifecycle events | kTestingIntent(testContextX) => channel<testContextZ> | addIntentListener() for given intents |

Scenario: 2.0-RaiseIntentSingleResolve
When I call "api1" with "raiseIntent" with parameters "aTestingIntent" and "{testContextX}"
And I refer to {result} as "intentResolution"
Then "{intentResoltion}" is an object with the following contents
| source.appId | intent | source.instanceId |
| A | aTestingIntent | <exists> |
And I call "intentResolution" with "getResult"
And "{result}" is void
And I can close the app with instanceId "{intentResoltion.source.instanceId}"
15 changes: 15 additions & 0 deletions ng/test/features/open-tests.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Feature: FDC3 Open
App A calls a function (see below) to open a second app, B

Background:
Given A Desktop Agent in "api1"
And "AppB" is the ID of an FDC3 Application named "AppBName"

@FDC3-1.2
Scenario: AOpensB1
When I call "api1" with "open" with parameter "AppBName"
Then "{result}" is an object with the following contents
| appIdentifier | instanceId |
| AppB | <exists> |
And I receive an "app-opened" event with appId "AppB"
And I can close the app with instanceId "{result.instanceId}"

0 comments on commit 93c6bc3

Please sign in to comment.