fix: Tests run against e2e config for both playwright and older tests (#4283)
Co-authored-by: IbrahimCSAE <ibrahim.mdev@gmail.com>
This commit is contained in:
parent
993308b32b
commit
31271aeef7
@ -8,12 +8,7 @@ export default defineConfig({
|
|||||||
workers: process.env.CI ? 1 : undefined,
|
workers: process.env.CI ? 1 : undefined,
|
||||||
snapshotPathTemplate: './tests/screenshots{/projectName}/{testFilePath}/{arg}{ext}',
|
snapshotPathTemplate: './tests/screenshots{/projectName}/{testFilePath}/{arg}{ext}',
|
||||||
outputDir: './tests/test-results',
|
outputDir: './tests/test-results',
|
||||||
reporter: [
|
reporter: [[process.env.CI ? 'blob' : 'html', { outputFolder: './tests/playwright-report' }]],
|
||||||
[
|
|
||||||
process.env.CI ? 'blob' : 'html',
|
|
||||||
{ outputFolder: './tests/playwright-report' },
|
|
||||||
],
|
|
||||||
],
|
|
||||||
timeout: 720 * 1000,
|
timeout: 720 * 1000,
|
||||||
use: {
|
use: {
|
||||||
baseURL: 'http://localhost:3000',
|
baseURL: 'http://localhost:3000',
|
||||||
@ -41,9 +36,9 @@ export default defineConfig({
|
|||||||
//},
|
//},
|
||||||
],
|
],
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'yarn start',
|
command: 'yarn test:e2e:serve',
|
||||||
url: 'http://localhost:3000',
|
url: 'http://localhost:3000',
|
||||||
reuseExistingServer: !process.env.CI,
|
reuseExistingServer: !process.env.CI,
|
||||||
timeout: 120 * 1000,
|
timeout: 240 * 1000,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -6,15 +6,16 @@ import { Page } from '@playwright/test';
|
|||||||
* @param title - The study instance UID of the study to visit
|
* @param title - The study instance UID of the study to visit
|
||||||
* @param mode - The mode to visit the study in
|
* @param mode - The mode to visit the study in
|
||||||
* @param delay - The delay to wait after visiting the study
|
* @param delay - The delay to wait after visiting the study
|
||||||
|
* @param datasources - the data source to load the study from
|
||||||
*/
|
*/
|
||||||
export async function visitStudy(
|
export async function visitStudy(
|
||||||
page: Page,
|
page: Page,
|
||||||
studyInstanceUID: string,
|
studyInstanceUID: string,
|
||||||
mode: string,
|
mode: string,
|
||||||
delay: number = 0
|
delay: number = 0,
|
||||||
|
datasources = 'ohif'
|
||||||
) {
|
) {
|
||||||
await page.goto('/?resultsPerPage=100');
|
await page.goto(`/?resultsPerPage=100&datasources=${datasources}`);
|
||||||
await page.getByTestId('confirm-and-hide-button').click();
|
|
||||||
await page.getByTestId(studyInstanceUID).click();
|
await page.getByTestId(studyInstanceUID).click();
|
||||||
await page.getByRole('button', { name: mode }).click();
|
await page.getByRole('button', { name: mode }).click();
|
||||||
await page.waitForLoadState('domcontentloaded');
|
await page.waitForLoadState('domcontentloaded');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user