tests(increase-coverage): weekly tests PR (#4221)
2
.github/workflows/playwright.yml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
branches: [main, master]
|
branches: [main, master]
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 120
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export default defineConfig({
|
|||||||
snapshotPathTemplate: './tests/screenshots{/projectName}/{testFilePath}/{arg}{ext}',
|
snapshotPathTemplate: './tests/screenshots{/projectName}/{testFilePath}/{arg}{ext}',
|
||||||
outputDir: './tests/test-results',
|
outputDir: './tests/test-results',
|
||||||
reporter: [['html', { outputFolder: './tests/playwright-report' }]],
|
reporter: [['html', { outputFolder: './tests/playwright-report' }]],
|
||||||
timeout: 120 * 1000,
|
timeout: 720 * 1000,
|
||||||
use: {
|
use: {
|
||||||
baseURL: 'http://localhost:3000',
|
baseURL: 'http://localhost:3000',
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry',
|
||||||
|
|||||||
25
tests/3DFourUp.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { test } from '@playwright/test';
|
||||||
|
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '2.16.840.1.114362.1.11972228.22789312658.616067305.306.2';
|
||||||
|
const mode = 'Basic Viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('3D four up Test', async () => {
|
||||||
|
test('should render 3D four up correctly.', async ({ page }) => {
|
||||||
|
await page.getByTestId('Layout').click();
|
||||||
|
await page
|
||||||
|
.locator('div')
|
||||||
|
.filter({ hasText: /^3D four up$/ })
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
|
await checkForScreenshot(
|
||||||
|
page,
|
||||||
|
page,
|
||||||
|
screenShotPaths.threeDFourUp.threeDFourUpDisplayedCorrectly,
|
||||||
|
200
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
25
tests/3DMain.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { test } from '@playwright/test';
|
||||||
|
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '2.16.840.1.114362.1.11972228.22789312658.616067305.306.2';
|
||||||
|
const mode = 'Basic Viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('3D main Test', async () => {
|
||||||
|
test('should render 3D main correctly.', async ({ page }) => {
|
||||||
|
await page.getByTestId('Layout').click();
|
||||||
|
await page
|
||||||
|
.locator('div')
|
||||||
|
.filter({ hasText: /^3D main$/ })
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
|
await checkForScreenshot(
|
||||||
|
page,
|
||||||
|
page,
|
||||||
|
screenShotPaths.threeDMain.threeDMainDisplayedCorrectly,
|
||||||
|
200
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
25
tests/3DOnly.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { test } from '@playwright/test';
|
||||||
|
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '2.16.840.1.114362.1.11972228.22789312658.616067305.306.2';
|
||||||
|
const mode = 'Basic Viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('3D only Test', async () => {
|
||||||
|
test('should render 3D only correctly.', async ({ page }) => {
|
||||||
|
await page.getByTestId('Layout').click();
|
||||||
|
await page
|
||||||
|
.locator('div')
|
||||||
|
.filter({ hasText: /^3D only$/ })
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
|
await checkForScreenshot(
|
||||||
|
page,
|
||||||
|
page,
|
||||||
|
screenShotPaths.threeDOnly.threeDOnlyDisplayedCorrectly,
|
||||||
|
200
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
26
tests/3DPrimary.spec.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { test } from '@playwright/test';
|
||||||
|
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '2.16.840.1.114362.1.11972228.22789312658.616067305.306.2';
|
||||||
|
const mode = 'Basic Viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('3D primary Test', async () => {
|
||||||
|
test('should render 3D primary correctly.', async ({ page }) => {
|
||||||
|
await page.getByTestId('Layout').click();
|
||||||
|
await page
|
||||||
|
.locator('div')
|
||||||
|
.filter({ hasText: /^3D primary$/ })
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
|
|
||||||
|
await checkForScreenshot(
|
||||||
|
page,
|
||||||
|
page,
|
||||||
|
screenShotPaths.threeDPrimary.threeDPrimaryDisplayedCorrectly,
|
||||||
|
200
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
25
tests/AxialPrimary.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { test } from '@playwright/test';
|
||||||
|
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '2.16.840.1.114362.1.11972228.22789312658.616067305.306.2';
|
||||||
|
const mode = 'Basic Viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.describe('Axial Primary Test', async () => {
|
||||||
|
test('should render Axial Primary correctly.', async ({ page }) => {
|
||||||
|
await page.getByTestId('Layout').click();
|
||||||
|
await page
|
||||||
|
.locator('div')
|
||||||
|
.filter({ hasText: /^Axial Primary$/ })
|
||||||
|
.first()
|
||||||
|
.click();
|
||||||
|
await checkForScreenshot(
|
||||||
|
page,
|
||||||
|
page,
|
||||||
|
screenShotPaths.axialPrimary.axialPrimaryDisplayedCorrectly,
|
||||||
|
200
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
18
tests/DicomTagBrowser.spec.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { test } from '@playwright/test';
|
||||||
|
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
|
||||||
|
const mode = 'Basic Viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should display the dicom tag browser', async ({ page }) => {
|
||||||
|
await page.getByTestId('MoreTools-split-button-secondary').click();
|
||||||
|
await page.getByTestId('TagBrowser').click();
|
||||||
|
await checkForScreenshot(
|
||||||
|
page,
|
||||||
|
page,
|
||||||
|
screenShotPaths.dicomTagBrowser.dicomTagBrowserDisplayedCorrectly
|
||||||
|
);
|
||||||
|
});
|
||||||
18
tests/FlipHorizontal.spec.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { test } from '@playwright/test';
|
||||||
|
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '2.16.840.1.114362.1.11972228.22789312658.616067305.306.2';
|
||||||
|
const mode = 'Basic Viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should flip the image horizontally', async ({ page }) => {
|
||||||
|
await page.getByTestId('MoreTools-split-button-secondary').click();
|
||||||
|
await page.getByTestId('flipHorizontal').click();
|
||||||
|
await checkForScreenshot(
|
||||||
|
page,
|
||||||
|
page,
|
||||||
|
screenShotPaths.flipHorizontal.flipHorizontalDisplayedCorrectly
|
||||||
|
);
|
||||||
|
});
|
||||||
14
tests/Invert.spec.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { test } from '@playwright/test';
|
||||||
|
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
|
||||||
|
const mode = 'Basic Viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should invert the image', async ({ page }) => {
|
||||||
|
await page.getByTestId('MoreTools-split-button-secondary').click();
|
||||||
|
await page.getByTestId('invert').click();
|
||||||
|
await checkForScreenshot(page, page, screenShotPaths.invert.invertDisplayedCorrectly);
|
||||||
|
});
|
||||||
18
tests/Reset.spec.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { test } from '@playwright/test';
|
||||||
|
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '2.16.840.1.114362.1.11972228.22789312658.616067305.306.2';
|
||||||
|
const mode = 'Basic Viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should reset the image to its original state', async ({ page }) => {
|
||||||
|
await page.getByTestId('MoreTools-split-button-secondary').click();
|
||||||
|
await page.getByTestId('rotate-right').click();
|
||||||
|
await page.getByTestId('MoreTools-split-button-secondary').click();
|
||||||
|
await page.getByTestId('invert').click();
|
||||||
|
await page.getByTestId('MoreTools-split-button-secondary').click();
|
||||||
|
await page.getByTestId('Reset').click();
|
||||||
|
await checkForScreenshot(page, page, screenShotPaths.reset.resetDisplayedCorrectly);
|
||||||
|
});
|
||||||
14
tests/RotateRight.spec.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { test } from '@playwright/test';
|
||||||
|
import { visitStudy, checkForScreenshot, screenShotPaths } from './utils';
|
||||||
|
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
|
const studyInstanceUID = '1.3.6.1.4.1.25403.345050719074.3824.20170125095438.5';
|
||||||
|
const mode = 'Basic Viewer';
|
||||||
|
await visitStudy(page, studyInstanceUID, mode, 2000);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should rotate the image to the right', async ({ page }) => {
|
||||||
|
await page.getByTestId('MoreTools-split-button-secondary').click();
|
||||||
|
await page.getByTestId('rotate-right').click();
|
||||||
|
await checkForScreenshot(page, page, screenShotPaths.rotateRight.rotateRightDisplayedCorrectly);
|
||||||
|
});
|
||||||
|
After Width: | Height: | Size: 381 KiB |
|
After Width: | Height: | Size: 366 KiB |
|
After Width: | Height: | Size: 522 KiB |
|
After Width: | Height: | Size: 660 KiB |
|
After Width: | Height: | Size: 288 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 198 KiB |
@ -26,6 +26,21 @@ const screenShotPaths = {
|
|||||||
mpr: {
|
mpr: {
|
||||||
mprDisplayedCorrectly: 'mprDisplayedCorrectly.png',
|
mprDisplayedCorrectly: 'mprDisplayedCorrectly.png',
|
||||||
},
|
},
|
||||||
|
threeDFourUp: {
|
||||||
|
threeDFourUpDisplayedCorrectly: 'threeDFourUpDisplayedCorrectly.png',
|
||||||
|
},
|
||||||
|
threeDMain: {
|
||||||
|
threeDMainDisplayedCorrectly: 'threeDMainDisplayedCorrectly.png',
|
||||||
|
},
|
||||||
|
threeDPrimary: {
|
||||||
|
threeDPrimaryDisplayedCorrectly: 'threeDPrimaryDisplayedCorrectly.png',
|
||||||
|
},
|
||||||
|
threeDOnly: {
|
||||||
|
threeDOnlyDisplayedCorrectly: 'threeDOnlyDisplayedCorrectly.png',
|
||||||
|
},
|
||||||
|
axialPrimary: {
|
||||||
|
axialPrimaryDisplayedCorrectly: 'axialPrimaryDisplayedCorrectly.png',
|
||||||
|
},
|
||||||
probe: {
|
probe: {
|
||||||
probeDisplayedCorrectly: 'probeDisplayedCorrectly.png',
|
probeDisplayedCorrectly: 'probeDisplayedCorrectly.png',
|
||||||
},
|
},
|
||||||
@ -35,6 +50,21 @@ const screenShotPaths = {
|
|||||||
spline: {
|
spline: {
|
||||||
splineDisplayedCorrectly: 'splineDisplayedCorrectly.png',
|
splineDisplayedCorrectly: 'splineDisplayedCorrectly.png',
|
||||||
},
|
},
|
||||||
|
dicomTagBrowser: {
|
||||||
|
dicomTagBrowserDisplayedCorrectly: 'dicomTagBrowserDisplayedCorrectly.png',
|
||||||
|
},
|
||||||
|
rotateRight: {
|
||||||
|
rotateRightDisplayedCorrectly: 'rotateRightDisplayedCorrectly.png',
|
||||||
|
},
|
||||||
|
invert: {
|
||||||
|
invertDisplayedCorrectly: 'invertDisplayedCorrectly.png',
|
||||||
|
},
|
||||||
|
flipHorizontal: {
|
||||||
|
flipHorizontalDisplayedCorrectly: 'flipHorizontalDisplayedCorrectly.png',
|
||||||
|
},
|
||||||
|
reset: {
|
||||||
|
resetDisplayedCorrectly: 'resetDisplayedCorrectly.png',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export { screenShotPaths };
|
export { screenShotPaths };
|
||||||
|
|||||||