chore: disable telemetry during playwright test execution

This commit is contained in:
Anoop M D 2022-10-30 19:56:54 +05:30
parent f283df2a1b
commit 11defe18ca
3 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,8 @@
module.exports = {
reactStrictMode: true,
publicRuntimeConfig: {
CI: process.env.CI
CI: process.env.CI,
PLAYWRIGHT: process.env.PLAYWRIGHT
},
webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` module

View File

@ -9,8 +9,8 @@ const { publicRuntimeConfig } = getConfig();
const posthogApiKey = 'phc_7gtqSrrdZRohiozPMLIacjzgHbUlhalW1Bu16uYijMR';
let posthogClient = null;
const isCI = () => {
return publicRuntimeConfig.CI ? true : false;
const isPlaywrightTestRunning = () => {
return publicRuntimeConfig.PLAYWRIGHT ? true : false;
};
// Todo support chrome and firefox extension
@ -39,7 +39,7 @@ const getAnonymousTrackingId = () => {
};
const trackStart = () => {
if(isCI()) {
if(isPlaywrightTestRunning()) {
return;
}

View File

@ -7,6 +7,7 @@ const { devices } = require('@playwright/test');
*/
// require('dotenv').config();
process.env.PLAYWRIGHT = "1";
/**
* @see https://playwright.dev/docs/test-configuration