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:
Bill Wallace 2024-07-09 11:13:07 -04:00 committed by GitHub
parent 993308b32b
commit 31271aeef7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 11 deletions

View File

@ -8,12 +8,7 @@ export default defineConfig({
workers: process.env.CI ? 1 : undefined,
snapshotPathTemplate: './tests/screenshots{/projectName}/{testFilePath}/{arg}{ext}',
outputDir: './tests/test-results',
reporter: [
[
process.env.CI ? 'blob' : 'html',
{ outputFolder: './tests/playwright-report' },
],
],
reporter: [[process.env.CI ? 'blob' : 'html', { outputFolder: './tests/playwright-report' }]],
timeout: 720 * 1000,
use: {
baseURL: 'http://localhost:3000',
@ -41,9 +36,9 @@ export default defineConfig({
//},
],
webServer: {
command: 'yarn start',
command: 'yarn test:e2e:serve',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 120 * 1000,
timeout: 240 * 1000,
},
});

View File

@ -6,15 +6,16 @@ import { Page } from '@playwright/test';
* @param title - The study instance UID of the study to visit
* @param mode - The mode to visit the study in
* @param delay - The delay to wait after visiting the study
* @param datasources - the data source to load the study from
*/
export async function visitStudy(
page: Page,
studyInstanceUID: string,
mode: string,
delay: number = 0
delay: number = 0,
datasources = 'ohif'
) {
await page.goto('/?resultsPerPage=100');
await page.getByTestId('confirm-and-hide-button').click();
await page.goto(`/?resultsPerPage=100&datasources=${datasources}`);
await page.getByTestId(studyInstanceUID).click();
await page.getByRole('button', { name: mode }).click();
await page.waitForLoadState('domcontentloaded');