Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions .github/workflows/branch--lint-unit-and-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
- master
- main
paths-ignore:
- 'docs/**'
- '**/README.md'
- "docs/**"
- "**/README.md"
workflow_dispatch:
jobs:
lint-and-test:
Expand Down Expand Up @@ -125,6 +125,11 @@ jobs:
run: |
yarn smoke-tests/designer smoke-test-headless
ls -lah smoke-tests/designer/reports/
- name: Run Lighthouse on urls and validate with lighthouserc
uses: treosh/lighthouse-ci-action@v8
with:
configPath: "./lighthouserc.js"
uploadArtifacts: true
- name: "Tar files"
if: ${{ success() || failure() }}
run: tar -cvf smoke-tests.tar smoke-tests/designer/reports
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ smoke-tests/designer/reports/
*/dist/
*/.dist/
tsconfig.tsbuildinfo
.lighthouseci

.yarn/*
!.yarn/releases
Expand Down
24 changes: 24 additions & 0 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
ci: {
collect: {
url: [
"http://localhost:3000/app",
"http://localhost:3000/app/new",
"http://localhost:3000/app/choose-existing",
"http://localhost:3000/app/designer/test-form-a",
"http://localhost:3009/components/all-components",
],
startServerCommand: "",
},
assert: {
assertions: {
"first-contentful-paint": ["error", { minScore: 0.6 }],
},
preset: "lighthouse:recommended",
},
upload: {
target: "filesystem",
//target: "temporary-public-storage",
},
},
};
2 changes: 1 addition & 1 deletion runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test:dev": "lab -T test/.transform.js -P **/**/*.test.* -v test --coverage-exclude src",
"unit-test": "lab -T test/.transform.js -P **/**/*.test.* -v test -S -v -r console -o stdout -r html -o unit-test.html -I version -l",
"unit-test-cov": "lab -T test/.transform.js -P **/**/*.test.* -v test -t 83 -S -v -r console -o stdout -r lcov -o test-coverage/lab/lcov.info -r html -o test-coverage/lab/unit-test.html -r junit -o test-results/junit/unit-test.xml -I version -l",
"a11y": "node test/audit/components && node lighthouse",
"lighthousea11y": "node test/audit && node lighthouse",
"symlink-env": "./bin/symlink-config",
"type-check": "tsc --noEmit",
"generate-docs": "typedoc src --tsconfig tsconfig.json --out ../docs/runner/typedoc --exclude '**/*+(index|.test|.jest).ts'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,109 +11,91 @@
"name": "textField",
"title": "Text field",
"hint": "Help text",
"options": {},
"schema": {}
},
{
"type": "MultilineTextField",
"name": "multilineTextField",
"title": "Multiline text field",
"hint": "Help text",
"options": {},
"schema": {}
},
{
"type": "NumberField",
"name": "numberField",
"title": "Number field",
"options": {},
"schema": {}
},
{
"type": "DateField",
"name": "dateField",
"title": "Date field",
"options": {},
"schema": {}
},
{
"type": "DatePartsField",
"name": "datePartsField",
"title": "Date parts field",
"options": {},
"schema": {}
},
{
"type": "TimeField",
"name": "timeField",
"title": "Time field",
"options": {},
"schema": {}
},
{
"type": "DateTimeField",
"name": "dateTimeField",
"title": "Date time field",
"options": {},
"schema": {}
},
{
"type": "DateTimePartsField",
"name": "dateTimePartsField",
"title": "Date time parts field",
"options": {},
"schema": {}
},
{
"type": "YesNoField",
"name": "yesNoField",
"title": "Yes/No field",
"options": {},
"schema": {}
},
{
"type": "EmailAddressField",
"name": "emailAddressField",
"title": "Email address field",
"options": {},
"schema": {}
},
{
"type": "TelephoneNumberField",
"name": "telephoneNumberField",
"title": "Telephone number field",
"options": {},
"schema": {}
},
{
"type": "UkAddressField",
"name": "addressField",
"title": "Telephone number field",
"options": {},
"schema": {}
},
{
"type": "RadiosField",
"name": "radiosField",
"title": "Radios field",
"options": {
"list": "companyType"
},
"list": "companyType",
"schema": {}
},
{
"type": "SelectField",
"name": "selectField",
"title": "Select field",
"options": {
"list": "country"
},
"list": "country",
"schema": {}
},
{
"options": {
"list": "horseBreed"
},
"list": "horseBreed",
"type": "CheckboxesField",
"name": "checkboxesField",
"title": "Checkboxes field",
Expand All @@ -123,20 +105,17 @@
{
"type": "Para",
"content": "Paragraph...",
"options": {},
"schema": {}
},
{
"type": "InsetText",
"content": "Inset text",
"options": {},
"schema": {}
},
{
"type": "Details",
"title": "Title",
"content": "Content",
"options": {},
"schema": {}
}
]
Expand All @@ -146,92 +125,72 @@
"title": "All Components Optional",
"components": [
{
"options": {
"required": false
},
"required": false,
"type": "TextField",
"name": "textField",
"title": "Text field",
"hint": "Help text",
"schema": {}
},
{
"options": {
"required": false
},
"required": false,
"type": "MultilineTextField",
"name": "multilineTextField",
"title": "Multiline text field",
"hint": "Help text",
"schema": {}
},
{
"options": {
"required": false
},
"required": false,
"type": "NumberField",
"name": "numberField",
"title": "Number field",
"schema": {}
},
{
"options": {
"required": false
},
"required": false,
"type": "DateField",
"name": "dateField",
"title": "Date field",
"schema": {}
},
{
"options": {
"required": false
},
"required": false,
"type": "DatePartsField",
"name": "datePartsField",
"title": "Date parts field",
"schema": {}
},
{
"options": {
"required": false
},
"required": false,
"type": "TimeField",
"name": "timeField",
"title": "Time field",
"schema": {}
},
{
"options": {
"required": false
},
"required": false,
"type": "DateTimeField",
"name": "dateTimeField",
"title": "Date time field",
"schema": {}
},
{
"options": {
"required": false
},
"required": false,
"type": "DateTimePartsField",
"name": "dateTimePartsField",
"title": "Date time parts field",
"schema": {}
},
{
"options": {
"required": false
},
"required": false,
"type": "YesNoField",
"name": "yesNoField",
"title": "Yes/No field",
"schema": {}
},
{
"options": {
"required": false
},
"required": false,
"type": "EmailAddressField",
"name": "emailAddressField",
"title": "Email address field",
Expand All @@ -256,10 +215,8 @@
"schema": {}
},
{
"options": {
"required": false,
"list": "companyType"
},
"required": false,
"list": "companyType",
"type": "RadiosField",
"name": "radiosField",
"title": "Radios field",
Expand All @@ -269,16 +226,12 @@
"type": "SelectField",
"name": "selectField",
"title": "Select field",
"options": {
"list": "country"
},
"list": "country",
"schema": {}
},
{
"options": {
"required": false,
"list": "horseBreed"
},
"required": false,
"list": "horseBreed",
"type": "CheckboxesField",
"name": "checkboxesField",
"title": "Checkboxes field",
Expand Down
18 changes: 8 additions & 10 deletions runner/test/audit/components.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import createServer from "../../src/server";
import createServer from "src/server";
import lighthouse from "lighthouse";
import chromeLauncher from "chrome-launcher";
import { launch } from "chrome-launcher";
import fs from "fs";

const opts = {
Expand Down Expand Up @@ -29,13 +29,11 @@ createServer({ formFileName: "components.json", formFilePath: __dirname })
});

function launchChromeAndRunLighthouse(url, opts, config = null) {
return chromeLauncher
.launch({ chromeFlags: opts.chromeFlags })
.then((chrome) => {
opts.port = chrome.port;
return lighthouse(url, opts, config).then((results) => {
fs.writeFileSync(`./report.${opts.output}`, results.report);
return chrome.kill().then(() => results.lhr);
});
return launch({ chromeFlags: opts.chromeFlags }).then((chrome) => {
opts.port = chrome.port;
return lighthouse(url, opts, config).then((results) => {
fs.writeFileSync(`./report.${opts.output}`, results.report);
return chrome.kill().then(() => results.lhr);
});
});
}
2 changes: 1 addition & 1 deletion smoke-tests/designer/wdio.conf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { hooks } = require("./support/hooks");
const drivers = {
chrome: { version: "95.0.4638.69" }, // https://chromedriver.chromium.org/
chrome: { version: "97.0.4692.71" }, // https://chromedriver.chromium.org/
firefox: { version: "0.29.1" }, // https://github.com/mozilla/geckodriver/releases
};

Expand Down