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 = { module.exports = {
reactStrictMode: true, reactStrictMode: true,
publicRuntimeConfig: { publicRuntimeConfig: {
CI: process.env.CI CI: process.env.CI,
PLAYWRIGHT: process.env.PLAYWRIGHT
}, },
webpack: (config, { isServer }) => { webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` module // Fixes npm packages that depend on `fs` module

View File

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

View File

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