Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conformance app #11

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bff5e71
merge master
AidanZealley Mar 7, 2022
c7ca9e3
barebones test running app based on workbench
AidanZealley Mar 8, 2022
46cedcc
add missing files
AidanZealley Mar 8, 2022
30fbae2
update header
AidanZealley Mar 8, 2022
a8fe634
Add initialisation to make sure tests are included
dbutt-scottlogic Mar 9, 2022
e1a92f4
add small test app to experiment with mocha
AidanZealley Mar 11, 2022
fd2816c
Listen to Mocha events for pass/fail of tests
dbutt-scottlogic Mar 11, 2022
557726a
Work on separating the Mocha test run from the UI
dbutt-scottlogic Mar 14, 2022
f5529c9
Working on the command line with examples
dbutt-scottlogic Mar 16, 2022
c40266d
Improve docs around CI testing and include typescript declarations
dbutt-scottlogic Mar 16, 2022
b82f3a1
Merge branch 'cli-run-tests' into conformance-app
dbutt-scottlogic Mar 16, 2022
65a5fda
Migrate new test running code to react app
dbutt-scottlogic Mar 16, 2022
a0b5f73
add ui for tests
AidanZealley Mar 17, 2022
3aa473c
Move test runner to module
dbutt-scottlogic Mar 17, 2022
169bf20
fix formatting
AidanZealley Mar 17, 2022
7e3d09a
merge changes
AidanZealley Mar 17, 2022
d6a0ed3
add ui for test runner
AidanZealley Mar 18, 2022
c9fed91
fix parameter name and remove extra file
AidanZealley Mar 18, 2022
8a3ec62
swap if statement back to show the correct content
AidanZealley Mar 18, 2022
d74067d
Merge branch 'master' into conformance-app
dbutt-scottlogic Mar 22, 2022
0c3d4e5
update main components to mui
AidanZealley Mar 22, 2022
6297184
Merge branch 'conformance-app' of github.com:ScottLogic/FDC3 into con…
dbutt-scottlogic Mar 23, 2022
6ccb61c
Update tests with PR feedback
dbutt-scottlogic Mar 24, 2022
4f4e3dc
add suite title
AidanZealley Mar 24, 2022
9f84623
Update tests with PR feedback
dbutt-scottlogic Mar 24, 2022
1ca70f1
Merge branch 'master' into conformance-app
dbutt-scottlogic Mar 24, 2022
ea532af
Include remaining PR feedback changes
dbutt-scottlogic Mar 24, 2022
c20f1c3
Merge branch 'conformance-app' of github.com:ScottLogic/FDC3 into con…
dbutt-scottlogic Mar 24, 2022
9cd70d0
convert remaining components to mui and remove older material depende…
AidanZealley Mar 24, 2022
881bd8d
convert remaining components to mui and remove older material depende…
AidanZealley Mar 24, 2022
5dc3568
remove old material dependencies and rename folder
AidanZealley Mar 25, 2022
92900f7
merge master and resolve conflicts
AidanZealley Mar 25, 2022
93b6640
Linting and warning fixes
dbutt-scottlogic Mar 25, 2022
4e552c4
Update README
dbutt-scottlogic Mar 25, 2022
ba77010
Remove duplicate README
dbutt-scottlogic Mar 25, 2022
914a6b8
Improve docs for command-line usage
dbutt-scottlogic Mar 28, 2022
e7490ff
wrap errors
AidanZealley Mar 29, 2022
9f4f2ce
make summary sticky
AidanZealley Mar 31, 2022
bf88e8a
redesign summary and add temporarily visible loading bar
AidanZealley Apr 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@
"tsdx": "^0.14.1",
"tslib": "^2.0.1",
"typescript": "^4.0.3"
},
"dependencies": {
"@mui/lab": "^5.0.0-alpha.73"
}
}
1 change: 1 addition & 0 deletions toolbox/fdc3-compliance/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
9 changes: 9 additions & 0 deletions toolbox/fdc3-compliance/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.github/
build/
dist/
node_modules/
*.d.ts
*.md
yarn.lock
package.json
testRunner/
73 changes: 73 additions & 0 deletions toolbox/fdc3-compliance/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"es6": true,
"commonjs": true
},
"extends": ["plugin:react/recommended", "prettier"],
"settings": {
"react": {
"version": "detect"
}
},
"globals": {
"fdc3": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["react", "import", "@typescript-eslint"],
"rules": {
"react/jsx-uses-vars": 2,
"class-methods-use-this": 0,
"no-plusplus": 0,
"no-undef": 2,
"prefer-arrow-callback": 1,
"prefer-destructuring": [
"warn",
{
"object": true,
"array": false
}
],
"quote-props": ["warn", "as-needed"],
"lines-between-class-members": 1,
"@typescript-eslint/no-unused-vars": 1,
"prefer-template": 1,
"arrow-parens": 1,
"no-extra-semi": 1,
"no-shadow": 1,
"import/first": 1,
"@typescript-eslint/no-use-before-define": 1,
"no-redeclare": 1,
"arrow-body-style": [
"warn",
"as-needed",
{
"requireReturnForObjectLiteral": true
}
],
"one-var-declaration-per-line": ["warn", "always"],
"no-mixed-operators": 1,
"no-multiple-empty-lines": 1,
"no-multi-spaces": 1,
"default-case": 1,
"no-unneeded-ternary": 1,
"operator-assignment": ["warn", "never"],
"object-property-newline": [
"warn",
{
"allowAllPropertiesOnSameLine": true
}
],
"new-cap": 1,
"no-case-declarations": 1,
"react/prop-types": 0,
"react/no-string-refs": 0
}
}
26 changes: 24 additions & 2 deletions toolbox/fdc3-compliance/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
node_modules/
build/
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

.eslintcache
npm-debug.log*
yarn-debug.log*
yarn-error.log*
9 changes: 8 additions & 1 deletion toolbox/fdc3-compliance/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Ignore artifacts:
.github/
build/
dist/
node_modules/
*.d.ts
*.md
yarn.lock
package.json
testRunner/
7 changes: 7 additions & 0 deletions toolbox/fdc3-compliance/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"useTabs": true,
"arrowParens": "always",
"trailingComma": "es5",
"proseWrap": "always",
"printWidth": 120
}
3 changes: 3 additions & 0 deletions toolbox/fdc3-compliance/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FDC3 Workbench - Fintech Open Source Foundation (https://www.finos.org/)
Copyright 2021 Cosaic, inc. [email protected]
Copyright 2021 Contributors to the FDC3 standards project
36 changes: 30 additions & 6 deletions toolbox/fdc3-compliance/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# FDC3 Conformance
# <a href='http://fdc3.finos.org'><img src='https://fdc3.finos.org/img/fdc3-logo-2019-color.png' height='150' alt='FDC3 Logo' aria-label='fdc3.finos.org' /></a>

## Background
This project represents a means to confirm conformance of a [desktop agent](https://fdc3.finos.org/docs/api/ref/DesktopAgent) to the [fdc3 api specification](https://fdc3.finos.org/docs/api/spec). See [here](https://fdc3.finos.org/docs/fdc3-compliance) for more information about conformance.
# FDC3 Conformance
This project represents a means to confirm conformance of a [desktop agent](https://fdc3.finos.org/docs/api/ref/DesktopAgent) to the [fdc3 api specification](https://fdc3.finos.org/docs/api/spec).

To do so this application can be launched within the desktop agent which will run a series of tests to verify conformance against the specification.

Expand All @@ -23,12 +23,36 @@ yarn build

`yarn start`

4. Add the URL http://localhost:8080 to your FDC3-enabled container or desktop agent and ensure it has access to the `window.fdc3` object.
4. Add the URL http://localhost:3000 to your FDC3-enabled container or desktop agent and ensure it has access to the `window.fdc3` object.

Alternatively, a full set of static files are available in the `build` folder. Load the index.html file into an environment that has the `window.fdc3` object available.

5. Upon loading the application's index.html, the tests will detect FDC3 and run automatically.

## Application Definition

A basic FDC3 application definition, as defined in the [application directory specification](https://fdc3.finos.org/schemas/1.2/app-directory#tag/Application), is supplied in the [file](./src/appDefinition.json) `appDefinition.json`. This may be useful when adding the conformance tests to an application directory. This file may need to be updated with additional manifest information, depending on the desktop agent. Consult the host environment documentation for information on configuring new applications.

## Integration with automated testing

The test suite can be run independently without interaction - for example as part of a CI build, or from the command line. See TypeScript and JavaScript examples [here](./testRunner/examples/). The test runner can be used as a module to run the compliance test suite.
Perform the following steps to include the module in your code:
- Import the fdc3-compliance module: ```yarn add [path to testRunner folder]```
- Import/require the ```fdc3-compliance``` module in your code
- Call the ```runSilentTests``` function, passing in the fdc3 implementation to be tested

Example:
```javascript
const { runSilentTests } = require("fdc3-compliance");

// Pass in the fdc3 global object to be tested
// Results are returned via callback
runSilentTests(fdc3, (results) => {
// results.stats contains the summary results
// For more details, see the passed and failed arrays
console.log(results.stats);
});
```

The included example code can be run with the following command line:
```bash
node testRunner/examples/ci-test.js
```
29 changes: 29 additions & 0 deletions toolbox/fdc3-compliance/appDefinition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"appId": "fdc3-compliance",
"name": "FDC3 Compliance",
"manifest": "{\"url\":\"http://localhost:3000\"}",
"manifestType": "web",
"version": "1.2",
"title": "FDC3 Compliance",
"tooltip": "FDC3 Compliance Test",
"description": "FDC3 Compliance Test",
"images": [
{
"url": "https://fdc3.finos.org/img/fdc3-logo-2019.png"
}
],
"publisher": "FINOS",
"icons": [
{
"icon": "https://fdc3.finos.org/img/fdc3-logo-2019.png"
}
],
"intents": [
{
"name": "fdc3.conformanceListener",
"displayName": "FDC3 Conformance",
"contexts": ["fdc3.contact"],
"customConfig": {}
}
]
}
106 changes: 71 additions & 35 deletions toolbox/fdc3-compliance/package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,82 @@
{
"name": "fdc3-compliance",
"version": "1.2.0",
"description": "FDC3 Compliance Testing",
"main": "index.js",
"version": "1.0.0",
"private": true,
"homepage": ".",
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.9",
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
"@finos/fdc3": "^1.2.0",
"@fontsource/roboto": "^4.4.5",
"@fontsource/source-code-pro": "^4.5.0",
"@mui/icons-material": "^5.5.1",
"@mui/lab": "^5.0.0-alpha.74",
"@mui/material": "^5.5.1",
"@types/node": "^17.0.21",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"fdc3-compliance": "./testRunner/",
"jsoneditor": "^9.5.6",
"mobx": "^6.3.2",
"mobx-react": "^7.2.0",
"nanoid": "^3.1.31",
"normalize.css": "^8.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"typescript": "^4.1.2",
"web-vitals": "^1.0.1"
},
"scripts": {
"build": "yarn run build:prettier && yarn run build:webpack && yarn run build:copy",
"build:copy": "npx copyfiles --exclude **/*.ts --exclude src/index.html --flat src/*.* build/",
"build:prettier": "prettier --write ./src/**/*.ts",
"build:webpack": "webpack build",
"start": "live-server build",
"test": "test"
"start": "react-scripts start",
"build:app": "react-scripts build",
"build:lib": "cd testRunner && yarn install && yarn build",
"build": "yarn build:lib && yarn install && yarn build:app",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint --cache --quiet **/*.{ts,tsx,js,jsx} && prettier --check **/*.{ts,tsx,js,jsx,json,yml,css,html,md}",
"lint:fix": "eslint --cache --quiet --fix **/*.{ts,tsx,js,jsx} && prettier --write **/*.{ts,tsx,js,jsx} && prettier --write **/*.{json,yml,css,html,md}"
},
"repository": {
"type": "git",
"url": "git+https://github.com/finos/FDC3.git"
"eslintConfig": {
"extends": [
"react-app"
]
},
"author": "",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/finos/FDC3/issues"
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"homepage": "https://github.com/finos/FDC3/toolbox/fdc3-compliance#readme",
"dependencies": {
"@finos/fdc3": "^1.2.0",
"buffer": "^6.0.3",
"devDependencies": {
"@types/jsoneditor": "^8.6.1",
"@types/mocha": "^9.1.0",
"@typescript-eslint/eslint-plugin": "^4.27.0",
"@typescript-eslint/parser": "^4.27.0",
"chai": "^4.3.6",
"html-webpack-plugin": "^5.5.0",
"eslint": "^7.28.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-react": "^7.24.0",
"lint-staged": "^11.0.0",
"mocha": "^9.2.1",
"process": "^0.11.10",
"stream-browserify": "^3.0.0",
"util": "^0.12.4"
"prettier": "^2.3.1",
"pretty-quick": "^3.1.0"
},
"devDependencies": {
"@types/chai": "^4.3.0",
"@types/mocha": "^9.1.0",
"css-loader": "^6.6.0",
"express": "^4.17.3",
"live-server": "^1.2.1",
"prettier": "^2.5.1",
"ts-loader": "^9.2.7",
"typescript": "^4.6.2",
"webpack": "^5.69.1",
"webpack-cli": "^4.9.2"
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
"eslint --cache --quiet --fix",
"prettier --write --prose-wrap never"
],
"*.{json,yml,css,html,md}": "prettier --write --prose-wrap never",
"*.js": "eslint --cache --fix",
"*.{js,css,md}": "prettier --write"
}
}
Binary file added toolbox/fdc3-compliance/public/favicon.ico
Binary file not shown.
Binary file added toolbox/fdc3-compliance/public/fdc3-icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added toolbox/fdc3-compliance/public/fdc3-icon-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions toolbox/fdc3-compliance/public/fdc3-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading