tests(increase-coverage): weekly tests PR (#4221)

This commit is contained in:
Ibrahim 2024-06-12 10:36:13 -04:00 committed by GitHub
parent 727088f3dc
commit 09853abc52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 240 additions and 2 deletions

View File

@ -6,7 +6,7 @@ on:
branches: [main, master]
jobs:
test:
timeout-minutes: 60
timeout-minutes: 120
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

View File

@ -9,7 +9,7 @@ export default defineConfig({
snapshotPathTemplate: './tests/screenshots{/projectName}/{testFilePath}/{arg}{ext}',
outputDir: './tests/test-results',
reporter: [['html', { outputFolder: './tests/playwright-report' }]],
timeout: 120 * 1000,
timeout: 720 * 1000,
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',

25
tests/3DFourUp.spec.ts Normal file
View 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
View 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
View 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
View 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
);
});
});

View 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
);
});
});

View 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
);
});

View 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
View 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
View 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
View 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);
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

View File

@ -26,6 +26,21 @@ const screenShotPaths = {
mpr: {
mprDisplayedCorrectly: 'mprDisplayedCorrectly.png',
},
threeDFourUp: {
threeDFourUpDisplayedCorrectly: 'threeDFourUpDisplayedCorrectly.png',
},
threeDMain: {
threeDMainDisplayedCorrectly: 'threeDMainDisplayedCorrectly.png',
},
threeDPrimary: {
threeDPrimaryDisplayedCorrectly: 'threeDPrimaryDisplayedCorrectly.png',
},
threeDOnly: {
threeDOnlyDisplayedCorrectly: 'threeDOnlyDisplayedCorrectly.png',
},
axialPrimary: {
axialPrimaryDisplayedCorrectly: 'axialPrimaryDisplayedCorrectly.png',
},
probe: {
probeDisplayedCorrectly: 'probeDisplayedCorrectly.png',
},
@ -35,6 +50,21 @@ const screenShotPaths = {
spline: {
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 };