2020-07-24 01:14:36 +03:00
|
|
|
/**
|
|
|
|
* Copyright (c) Microsoft Corporation.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2022-04-25 19:30:14 +03:00
|
|
|
import path from 'path';
|
2023-01-13 00:12:02 +03:00
|
|
|
import { defineConfig } from '@playwright/test';
|
2023-08-25 02:06:41 +03:00
|
|
|
import type { ReporterDescription } from '@playwright/test';
|
2022-04-25 19:30:14 +03:00
|
|
|
import { config as loadEnv } from 'dotenv';
|
|
|
|
loadEnv({ path: path.join(__dirname, '..', '..', '.env') });
|
2020-07-24 01:14:36 +03:00
|
|
|
|
2023-08-25 02:06:41 +03:00
|
|
|
const reporters = () => {
|
|
|
|
const result: ReporterDescription[] = process.env.CI ? [
|
|
|
|
['dot'],
|
|
|
|
['json', { outputFile: path.join(outputDir, 'report.json') }],
|
2023-12-07 07:44:06 +03:00
|
|
|
['blob', { fileName: `${process.env.PWTEST_BOT_NAME}.zip` }],
|
2023-08-25 02:06:41 +03:00
|
|
|
] : [
|
|
|
|
['list'],
|
|
|
|
['html', { open: 'on-failure' }]
|
|
|
|
];
|
|
|
|
return result;
|
|
|
|
};
|
|
|
|
|
2022-05-07 19:17:07 +03:00
|
|
|
const outputDir = path.join(__dirname, '..', '..', 'test-results');
|
2023-01-13 00:12:02 +03:00
|
|
|
export default defineConfig({
|
2022-05-03 22:48:35 +03:00
|
|
|
globalSetup: path.join(__dirname, 'globalSetup'),
|
2022-05-07 19:17:07 +03:00
|
|
|
outputDir,
|
2022-04-25 19:30:14 +03:00
|
|
|
testIgnore: '**\/fixture-scripts/**',
|
|
|
|
timeout: 5 * 60 * 1000,
|
2024-10-01 23:12:38 +03:00
|
|
|
retries: process.env.CI ? 3 : 0,
|
2023-08-25 02:06:41 +03:00
|
|
|
reporter: reporters(),
|
2022-04-25 19:30:14 +03:00
|
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
workers: 1,
|
2022-05-07 05:04:34 +03:00
|
|
|
projects: [
|
|
|
|
{
|
|
|
|
name: 'installation tests',
|
|
|
|
metadata: {
|
|
|
|
nodejsVersion: process.version,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2023-01-13 00:12:02 +03:00
|
|
|
});
|