chore: add test coverage (#4960)
This commit is contained in:
parent
a41ed3bade
commit
91117f40f8
112
.github/workflows/build-docs.yml
vendored
Normal file
112
.github/workflows/build-docs.yml
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
name: Build and Deploy Docs
|
||||
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
ACTIONS_STEP_DEBUG: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-and-deploy-docs:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
# Need permissions to read actions and pull requests
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
pull-requests: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20 # Or your desired Node version
|
||||
|
||||
- name: Install root dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
# Removed Playwright tests and coverage generation steps
|
||||
|
||||
- name: Find PR and associated workflow run
|
||||
id: find_pr_run
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
MERGE_COMMIT_SHA: ${{ github.sha }}
|
||||
run: |
|
||||
# Find the PR associated with the merge commit SHA
|
||||
# Note: This relies on the merge commit being directly pushed to main
|
||||
PR_DATA=$(gh pr list --state merged --search "$MERGE_COMMIT_SHA" --json number,headRefOid --jq '.[0]')
|
||||
if [ -z "$PR_DATA" ]; then
|
||||
echo "Could not find merged PR for commit $MERGE_COMMIT_SHA."
|
||||
# Decide how to handle - fail, or maybe generate coverage now?
|
||||
# For now, let's fail.
|
||||
exit 1
|
||||
fi
|
||||
PR_HEAD_SHA=$(echo "$PR_DATA" | jq -r '.headRefOid')
|
||||
PR_NUMBER=$(echo "$PR_DATA" | jq -r '.number')
|
||||
echo "Found PR Number: $PR_NUMBER"
|
||||
echo "Found PR Head SHA: $PR_HEAD_SHA"
|
||||
|
||||
# Find the latest workflow run ID for the playwright workflow on the PR head commit
|
||||
# Uses the workflow file name 'playwright.yml'
|
||||
# Remove the --status success flag to find any run
|
||||
RUN_ID=$(gh run list --workflow playwright.yml --commit "$PR_HEAD_SHA" --event pull_request --json databaseId --jq '.[0].databaseId')
|
||||
|
||||
if [ -z "$RUN_ID" ]; then
|
||||
echo "Could not find any 'playwright.yml' run for PR $PR_NUMBER (Head SHA: $PR_HEAD_SHA)."
|
||||
# Decide how to handle - maybe try finding the artifact from the merge commit run if that exists?
|
||||
# For now, let's fail.
|
||||
exit 1
|
||||
fi
|
||||
echo "Found Run ID: $RUN_ID"
|
||||
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Download coverage artifact from PR run
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
mkdir -p ./coverage-artifact
|
||||
gh run download ${{ steps.find_pr_run.outputs.run_id }} -n coverage-report-pr --dir ./coverage-artifact
|
||||
# Check if download was successful (e.g., check if files exist)
|
||||
if [ ! -f ./coverage-artifact/base.css ]; then
|
||||
echo "Failed to download or find expected files in artifact 'coverage-report-pr' from run ${{ steps.find_pr_run.outputs.run_id }}."
|
||||
exit 1
|
||||
fi
|
||||
echo "Artifact downloaded successfully."
|
||||
|
||||
- name: Install docs dependencies
|
||||
run: cd packages/docs && bun install
|
||||
|
||||
- name: Copy coverage to docs static directory
|
||||
run: |
|
||||
# Copy files from the downloaded artifact directory
|
||||
mkdir -p packages/docs/static/coverage
|
||||
cp -r ./coverage-artifact/* packages/docs/static/coverage/
|
||||
# Copy specific asset files from the downloaded artifact root to static root
|
||||
cp ./coverage-artifact/base.css packages/docs/static/
|
||||
cp ./coverage-artifact/block-navigation.js packages/docs/static/
|
||||
cp ./coverage-artifact/prettify.css packages/docs/static/
|
||||
cp ./coverage-artifact/prettify.js packages/docs/static/
|
||||
cp ./coverage-artifact/favicon.png packages/docs/static/
|
||||
cp ./coverage-artifact/sort-arrow-sprite.png packages/docs/static/
|
||||
cp ./coverage-artifact/sorter.js packages/docs/static/
|
||||
|
||||
- name: Build docs
|
||||
run: cd packages/docs && bun run build:docs
|
||||
|
||||
- name: Install Netlify CLI
|
||||
run: bun add -g netlify-cli
|
||||
|
||||
- name: Deploy to Netlify
|
||||
run: |
|
||||
cd packages/docs
|
||||
netlify deploy --dir=build --prod
|
||||
env:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||
98
.github/workflows/codeql.yml
vendored
Normal file
98
.github/workflows/codeql.yml
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL Advanced"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
schedule:
|
||||
- cron: '15 1 * * 5'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze (${{ matrix.language }})
|
||||
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
||||
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
||||
# - https://gh.io/supported-runners-and-hardware-resources
|
||||
# - https://gh.io/using-larger-runners (GitHub.com only)
|
||||
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
permissions:
|
||||
# required for all workflows
|
||||
security-events: write
|
||||
|
||||
# required to fetch internal or private CodeQL packs
|
||||
packages: read
|
||||
|
||||
# only required for workflows in private repositories
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- language: actions
|
||||
build-mode: none
|
||||
- language: javascript-typescript
|
||||
build-mode: none
|
||||
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
||||
# Use `c-cpp` to analyze code written in C, C++ or both
|
||||
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
||||
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
||||
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
||||
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
||||
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Add any setup steps before running the `github/codeql-action/init` action.
|
||||
# This includes steps like installing compilers or runtimes (`actions/setup-node`
|
||||
# or others). This is typically only required for manual builds.
|
||||
# - name: Setup runtime (example)
|
||||
# uses: actions/setup-example@v1
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
# If the analyze step fails for one of the languages you are analyzing with
|
||||
# "We were unable to automatically build your code", modify the matrix above
|
||||
# to set the build mode to "manual" for that language. Then modify this step
|
||||
# to build your code.
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
- if: matrix.build-mode == 'manual'
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'If you are using a "manual" build mode for one or more of the' \
|
||||
'languages you are analyzing, replace this with the commands to build' \
|
||||
'your code, for example:'
|
||||
echo ' make bootstrap'
|
||||
echo ' make release'
|
||||
exit 1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
74
.github/workflows/playwright.yml
vendored
74
.github/workflows/playwright.yml
vendored
@ -1,75 +1,41 @@
|
||||
name: Playwright Tests
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
branches: [master]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
playwright-tests:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mcr.microsoft.com/playwright:v1.51.1-noble
|
||||
runs-on: self-hosted
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||
shardTotal: [10]
|
||||
node-version: [20]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install unzip
|
||||
run: apt-get update && apt-get install -y unzip
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
- name: Set up Git safe directory
|
||||
run: git config --global --add safe.directory /__w/Viewers/Viewers
|
||||
# - name: Install Playwright browsers
|
||||
# run: bun x playwright install-deps chromium
|
||||
- name: Run Playwright tests
|
||||
run: |
|
||||
NODE_OPTIONS="--max_old_space_size=8192" TEST_ENV=true bun x playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
|
||||
|
||||
- name: Upload blob report to GitHub Actions Artifacts
|
||||
export NODE_OPTIONS="--max_old_space_size=10192"
|
||||
bun run test:e2e:coverage
|
||||
- name: create the coverage report
|
||||
run: |
|
||||
bun nyc report --reporter=lcov --reporter=text
|
||||
- name: Upload the coverage report to GitHub Actions Artifacts
|
||||
if: ${{ !cancelled() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: blob-report-${{ matrix.shardIndex }}
|
||||
path: blob-report
|
||||
retention-days: 1
|
||||
|
||||
merge-reports:
|
||||
if: ${{ !cancelled() }}
|
||||
needs: [playwright-tests]
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mcr.microsoft.com/playwright:v1.48.1-focal
|
||||
steps:
|
||||
- name: Install unzip
|
||||
run: apt-get update && apt-get install -y unzip
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
- name: Set up Git safe directory
|
||||
run: git config --global --add safe.directory /__w/Viewers/Viewers
|
||||
- name: Download blob reports from GitHub Actions Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: all-blob-reports
|
||||
pattern: blob-report-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Merge into HTML Report
|
||||
run: bun x playwright merge-reports --reporter html ./all-blob-reports
|
||||
|
||||
- name: Upload HTML report
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: html-report--attempt-${{ github.run_attempt }}
|
||||
path: playwright-report
|
||||
retention-days: 14
|
||||
name: coverage-report-pr
|
||||
path: coverage
|
||||
retention-days: 3
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,7 +1,7 @@
|
||||
# Packages
|
||||
node_modules
|
||||
.cursor/
|
||||
|
||||
.nyc_output/
|
||||
# Output
|
||||
build
|
||||
dist
|
||||
|
||||
24
.nycrc.json
Normal file
24
.nycrc.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"extends": "@istanbuljs/nyc-config-typescript",
|
||||
"instrument": true,
|
||||
"sourceMap": true,
|
||||
"cache": false,
|
||||
"all": true,
|
||||
"include": [
|
||||
"platform/*/src/**/*.ts",
|
||||
"platform/*/src/**/*.js",
|
||||
"extensions/*/src/**/*.ts",
|
||||
"extensions/*/src/**/*.js",
|
||||
"modes/*/src/**/*.ts",
|
||||
"modes/*/src/**/*.js"
|
||||
],
|
||||
"exclude": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.test.ts",
|
||||
"**/test/**",
|
||||
"**/tests/**",
|
||||
"**/examples/**",
|
||||
"**/stories/**",
|
||||
"platform/docs/**"
|
||||
]
|
||||
}
|
||||
@ -26,6 +26,7 @@ const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin'
|
||||
const NODE_ENV = process.env.NODE_ENV;
|
||||
const QUICK_BUILD = process.env.QUICK_BUILD;
|
||||
const BUILD_NUM = process.env.CIRCLE_BUILD_NUM || '0';
|
||||
const IS_COVERAGE = process.env.COVERAGE === 'true';
|
||||
|
||||
// read from ../version.txt
|
||||
const VERSION_NUMBER = fs.readFileSync(path.join(__dirname, '../version.txt'), 'utf8') || '';
|
||||
@ -100,14 +101,30 @@ module.exports = (env, argv, { SRC_DIR, ENTRY }) => {
|
||||
...(isProdBuild
|
||||
? []
|
||||
: [
|
||||
{
|
||||
test: /\.[jt]sx?$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
plugins: isProdBuild ? [] : ['react-refresh/babel'],
|
||||
},
|
||||
},
|
||||
...(IS_COVERAGE
|
||||
? [
|
||||
{
|
||||
test: /\.[jt]sx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-typescript', '@babel/preset-react'],
|
||||
plugins: ['istanbul'],
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
test: /\.[jt]sx?$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
plugins: isProdBuild ? [] : ['react-refresh/babel'],
|
||||
},
|
||||
},
|
||||
]),
|
||||
]),
|
||||
{
|
||||
test: /\.svg?$/,
|
||||
|
||||
@ -24,6 +24,7 @@ module.exports = {
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
plugins: [
|
||||
'babel-plugin-istanbul',
|
||||
'@babel/plugin-proposal-object-rest-spread',
|
||||
'@babel/plugin-syntax-dynamic-import',
|
||||
'@babel/plugin-transform-regenerator',
|
||||
|
||||
10
package.json
10
package.json
@ -54,6 +54,7 @@
|
||||
"test:unit": "jest --collectCoverage",
|
||||
"test:unit:ci": "lerna run test:unit:ci --parallel --stream",
|
||||
"test:e2e": "lerna run test:e2e --stream",
|
||||
"test:e2e:coverage": "nyc --reporter=html yarn run test:e2e:ci -g @debug",
|
||||
"test:e2e:ci": "TEST_ENV=true npx playwright test",
|
||||
"test:e2e:ui": "TEST_ENV=true npx playwright test --ui",
|
||||
"test:e2e:headed": "TEST_ENV=true npx playwright test --headed",
|
||||
@ -93,9 +94,16 @@
|
||||
"@babel/preset-env": "7.24.7",
|
||||
"@babel/preset-react": "^7.16.7",
|
||||
"@babel/preset-typescript": "^7.13.0",
|
||||
"babel-plugin-istanbul": "^7.0.0",
|
||||
"source-map-support": "^0.5.21",
|
||||
"prettier": "^3.3.3",
|
||||
"ts-node": "^10.9.2",
|
||||
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
||||
"istanbul": "0.4.5",
|
||||
"nyc": "^17.1.0",
|
||||
"patch-package": "^8.0.0",
|
||||
"prettier-plugin-tailwindcss": "0.6.9"
|
||||
"prettier-plugin-tailwindcss": "0.6.9",
|
||||
"playwright-test-coverage": "^1.2.12"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
||||
@ -24,6 +24,7 @@ const PROXY_TARGET = process.env.PROXY_TARGET;
|
||||
const PROXY_DOMAIN = process.env.PROXY_DOMAIN;
|
||||
const PROXY_PATH_REWRITE_FROM = process.env.PROXY_PATH_REWRITE_FROM;
|
||||
const PROXY_PATH_REWRITE_TO = process.env.PROXY_PATH_REWRITE_TO;
|
||||
const IS_COVERAGE = process.env.COVERAGE === 'true';
|
||||
|
||||
const OHIF_PORT = Number(process.env.OHIF_PORT || 3000);
|
||||
const ENTRY_TARGET = process.env.ENTRY_TARGET || `${SRC_DIR}/index.js`;
|
||||
@ -134,14 +135,18 @@ module.exports = (env, argv) => {
|
||||
},
|
||||
}),
|
||||
// Generate a service worker for fast local loads
|
||||
new InjectManifest({
|
||||
swDest: 'sw.js',
|
||||
swSrc: path.join(SRC_DIR, 'service-worker.js'),
|
||||
// Need to exclude the theme as it is updated independently
|
||||
exclude: [/theme/],
|
||||
// Cache large files for the manifests to avoid warning messages
|
||||
maximumFileSizeToCacheInBytes: 1024 * 1024 * 50,
|
||||
}),
|
||||
...(IS_COVERAGE
|
||||
? []
|
||||
: [
|
||||
new InjectManifest({
|
||||
swDest: 'sw.js',
|
||||
swSrc: path.join(SRC_DIR, 'service-worker.js'),
|
||||
// Need to exclude the theme as it is updated independently
|
||||
exclude: [/theme/],
|
||||
// Cache large files for the manifests to avoid warning messages
|
||||
maximumFileSizeToCacheInBytes: 1024 * 1024 * 50,
|
||||
}),
|
||||
]),
|
||||
],
|
||||
// https://webpack.js.org/configuration/dev-server/
|
||||
devServer: {
|
||||
|
||||
15
platform/docs/docs/test-coverage.md
Normal file
15
platform/docs/docs/test-coverage.md
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
sidebar_position: 14
|
||||
sidebar_label: Test Coverage
|
||||
---
|
||||
|
||||
# Test Coverage
|
||||
|
||||
## Playwright
|
||||
|
||||
|
||||
Here's the test coverage report for our Playwright tests. Keep in mind that this doesn't include our Cypress tests, so our actual test coverage is likely higher than what's shown. We're focusing on Playwright for future OHIF testing, and we're really pushing to improve that coverage number.
|
||||
|
||||
|
||||
You can view our latest test coverage report here:
|
||||
- [OHIF Playwright Test Coverage Report](https://docs.ohif.org/coverage)
|
||||
17
platform/docs/docs/user-guide/viewer/mpr.md
Normal file
17
platform/docs/docs/user-guide/viewer/mpr.md
Normal file
@ -0,0 +1,17 @@
|
||||
# Multiplanar Reconstruction
|
||||
|
||||
|
||||
## Crosshairs
|
||||
|
||||
|
||||
<div style={{padding:"56.25% 0 0 0", position:"relative"}}>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/Qe3j6I-RdlA?si=UejPdGNSSZBS66qE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
# MPR Slab Oblique
|
||||
|
||||
<div style={{padding:"56.25% 0 0 0", position:"relative"}}>
|
||||
<iframe src="https://player.vimeo.com/video/843233906?badge=0&autopause=0&player_id=0&app_id=58479" frameBorder="0" allow="autoplay; fullscreen; picture-in-picture" allowFullScreen style= {{ position:"absolute",top:0,left:0,width:"100%",height:"100%"}} title="measurement-report"></iframe>
|
||||
</div>
|
||||
@ -4,8 +4,8 @@ export default defineConfig({
|
||||
testDir: './tests',
|
||||
fullyParallel: !!process.env.CI,
|
||||
forbidOnly: !!process.env.CI,
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
retries: process.env.CI ? 3 : 0,
|
||||
workers: process.env.CI ? 8 : undefined,
|
||||
snapshotPathTemplate: './tests/screenshots{/projectName}/{testFilePath}/{arg}{ext}',
|
||||
outputDir: './tests/test-results',
|
||||
reporter: [[process.env.CI ? 'blob' : 'html', { outputFolder: './tests/playwright-report' }]],
|
||||
@ -38,7 +38,7 @@ export default defineConfig({
|
||||
//},
|
||||
],
|
||||
webServer: {
|
||||
command: 'cross-env APP_CONFIG=config/e2e.js yarn start',
|
||||
command: 'cross-env APP_CONFIG=config/e2e.js COVERAGE=true nyc yarn start',
|
||||
url: 'http://localhost:3000',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
timeout: 360_000,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import {
|
||||
visitStudy,
|
||||
checkForScreenshot,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import {
|
||||
visitStudy,
|
||||
checkForScreenshot,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import {
|
||||
visitStudy,
|
||||
checkForScreenshot,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import {
|
||||
visitStudy,
|
||||
checkForScreenshot,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
@ -7,7 +7,7 @@ test.beforeEach(async ({ page }) => {
|
||||
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||
});
|
||||
|
||||
test('should display the circle tool', async ({ page }) => {
|
||||
test('should display the circle tool @debug', async ({ page }) => {
|
||||
await page.getByTestId('MeasurementTools-split-button-secondary').click();
|
||||
await page.getByTestId('CircleROI').click();
|
||||
const locator = page.getByTestId('viewport-pane').locator('canvas');
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Page, test } from '@playwright/test';
|
||||
import { Page, test } from 'playwright-test-coverage';
|
||||
import {
|
||||
visitStudy,
|
||||
checkForScreenshot,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils/index.js';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths, simulateClicksOnElement } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { test, expect } from 'playwright-test-coverage';
|
||||
import { visitStudy, scrollVolumeViewport } from './utils';
|
||||
|
||||
test.skip('PT should show slice closest to CT', async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { test, expect } from 'playwright-test-coverage';
|
||||
import {
|
||||
visitStudy,
|
||||
simulateClicksOnElement,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { expect, test } from 'playwright-test-coverage';
|
||||
import { visitStudy, simulateClicksOnElement, getSUV, clearAllAnnotations } from './utils/index';
|
||||
|
||||
test.skip('should update SUV values correctly.', async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils/index.js';
|
||||
|
||||
test.skip('should render TMTV correctly.', async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { test } from '@playwright/test';
|
||||
import { test } from 'playwright-test-coverage';
|
||||
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { expect } from 'playwright-test-coverage';
|
||||
import { Locator, Page } from 'playwright';
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Page } from "@playwright/test";
|
||||
import { Page } from 'playwright-test-coverage';
|
||||
|
||||
interface WindowWithMousePosition extends Window {
|
||||
mouseX: number;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Page } from '@playwright/test';
|
||||
import { Page } from 'playwright-test-coverage';
|
||||
|
||||
/**
|
||||
* Visit the study
|
||||
|
||||
Loading…
Reference in New Issue
Block a user