import { defineConfig, devices } from '@playwright/test';
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './src/tests',
timeout: 60 * 1000,
expect: {
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000,
},
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : 1,
reporter: [['html', { open: 'never' }], ['.\\src\\utils\\myReporter.ts']],
use: {
actionTimeout: 0,
baseURL: 'http://localhost:5174',
trace: 'on-first-retry',
headless: true,
},
projects: [
{
use: {
...devices['Desktop Chrome'],
viewport: { width: 1920, height: 1080 },
},
},
],
webServer: [
{
command: '..\\server\\output\\win_mingw64\\bin\\profiler_server.exe --wsPort=9000 --logPath=D:\\MindStudio-Insight_GUI_Test\\GUI\\Ascend-Insight',
reuseExistingServer: !process.env.CI,
},
{
* Use the dev server by default for faster feedback loop.
* Use the preview server on CI for more realistic testing.
* Playwright will re-use the local server if there is already a dev-server running.
*/
command: 'cd ..\\modules\\framework && npm run staging',
url: 'http://127.0.0.1:5174',
reuseExistingServer: !process.env.CI,
},
],
});