Disable Team tests if required (#234)
1. Add env variables loader using dotenv to e2e tests 2. Skip Team account tests based on variable 3. Remove hardcoded instance of Makerkit in tests
This commit is contained in:
committed by
GitHub
parent
765cef8736
commit
53b09fcb8e
@@ -1,6 +1,11 @@
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
import { config as dotenvConfig } from 'dotenv';
|
||||
|
||||
dotenvConfig();
|
||||
dotenvConfig({ path: '.env.local' });
|
||||
|
||||
const enableBillingTests = process.env.ENABLE_BILLING_TESTS === 'true';
|
||||
const enableTeamAccountTests = (process.env.ENABLE_TEAM_ACCOUNT_TESTS ?? 'true') === 'true';
|
||||
|
||||
const testIgnore: string[] = [];
|
||||
|
||||
@@ -13,6 +18,17 @@ if (!enableBillingTests) {
|
||||
testIgnore.push('*-billing.spec.ts');
|
||||
}
|
||||
|
||||
if (!enableTeamAccountTests) {
|
||||
console.log(
|
||||
`Team account tests are disabled. To enable them, set the environment variable ENABLE_TEAM_ACCOUNT_TESTS=true.`,
|
||||
`Current value: "${process.env.ENABLE_TEAM_ACCOUNT_TESTS}"`,
|
||||
);
|
||||
|
||||
testIgnore.push('*team-accounts.spec.ts');
|
||||
testIgnore.push('*invitations.spec.ts');
|
||||
testIgnore.push('*team-billing.spec.ts');
|
||||
}
|
||||
|
||||
/**
|
||||
* Read environment variables from file.
|
||||
* https://github.com/motdotla/dotenv
|
||||
|
||||
Reference in New Issue
Block a user