-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixes the broken end-to-end tests - Changes the playwright test configuration to produce test coverage - Adds end-to-end tests of client to github actions. But these tests fail of non-availability of gitlab instance.
- Loading branch information
1 parent
e744000
commit 14fbd92
Showing
17 changed files
with
2,626 additions
and
2,160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ api/ | |
build/ | ||
config/ | ||
node_modules/ | ||
script/ | ||
script/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
playwright/.auth/ | ||
playwright/.auth/ | ||
test-results/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@into-cps-association/dtaas-web", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Web client for Digital Twin as a Service (DTaaS)", | ||
"main": "index.tsx", | ||
"author": "prasadtalasila <[email protected]> (http://prasad.talasila.in/)", | ||
|
@@ -30,7 +30,8 @@ | |
"stop": "npx kill-port 4000", | ||
"syntax": "npx eslint . --fix", | ||
"test:all": "yarn test:unit && yarn test:int && yarn test:e2e", | ||
"test:e2e": "yarn build && yarn config:test && npx kill-port 4000 && yarn start >/dev/null & playwright test && npx kill-port 4000", | ||
"test:e2e:ext": "cross-env ext=true yarn test:e2e", | ||
"test:e2e": "playwright test -c ./playwright.config.ts", | ||
"test:int": "jest -c ./jest.config.json ../test/integration --setupFilesAfterEnv ./test/integration/jest.setup.ts", | ||
"test:unit": "jest -c ./jest.config.json ../test/unit --setupFilesAfterEnv ./test/unit/jest.setup.ts" | ||
}, | ||
|
@@ -53,6 +54,7 @@ | |
"@types/styled-components": "^5.1.32", | ||
"@typescript-eslint/eslint-plugin": "^6.12.0", | ||
"@typescript-eslint/parser": "^6.12.0", | ||
"cross-env": "^7.0.3", | ||
"dotenv": "^16.1.4", | ||
"eslint": "8.54.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
|
@@ -92,6 +94,7 @@ | |
"@types/react-dom": "^18.2.17", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"monocart-coverage-reports": "^2.10.2", | ||
"playwright": "^1.32.1", | ||
"prettier": "^3.2.4", | ||
"shx": "^0.3.4", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { test as testBase } from '@playwright/test'; | ||
import MCR from 'monocart-coverage-reports'; | ||
import coverageOptions from './mcr.config'; | ||
|
||
// fixtures | ||
const test = testBase.extend<{ | ||
autoTestFixture: string; | ||
}>({ | ||
autoTestFixture: [ | ||
async ({ page }, use) => { | ||
const isChromium = test.info().project.name === 'chromium'; | ||
|
||
// console.log('autoTestFixture setup...'); | ||
// coverage API is chromium only | ||
if (isChromium) { | ||
await Promise.all([ | ||
page.coverage.startJSCoverage({ | ||
resetOnNavigation: false, | ||
}), | ||
page.coverage.startCSSCoverage({ | ||
resetOnNavigation: false, | ||
}), | ||
]); | ||
} | ||
|
||
await use('autoTestFixture'); | ||
|
||
// console.log('autoTestFixture teardown...'); | ||
if (isChromium) { | ||
const [jsCoverage, cssCoverage] = await Promise.all([ | ||
page.coverage.stopJSCoverage(), | ||
page.coverage.stopCSSCoverage(), | ||
]); | ||
const coverageList = [...jsCoverage, ...cssCoverage]; | ||
// console.log(coverageList.map((item) => item.url)); | ||
const mcr = MCR(coverageOptions); | ||
await mcr.add(coverageList); | ||
} | ||
}, | ||
{ | ||
scope: 'test', | ||
auto: true, | ||
}, | ||
], | ||
}); | ||
|
||
export default test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import MCR from 'monocart-coverage-reports'; | ||
import coverageOptions from './mcr.config'; | ||
|
||
async function globalTeardown() { | ||
const mcr = MCR(coverageOptions); | ||
await mcr.generate(); | ||
} | ||
|
||
export default globalTeardown; |
Oops, something went wrong.