global-setup.ts 819 B

12345678910111213141516171819202122
  1. import { firefox, type FullConfig } from '@playwright/test';
  2. import { execSync } from 'node:child_process';
  3. import fs from 'fs';
  4. const utils = require('./global-utils');
  5. utils.loadEnv();
  6. async function globalSetup(config: FullConfig) {
  7. // Are we running in docker and the project is mounted ?
  8. const path = (fs.existsSync("/project/playwright/playwright.config.ts") ? "/project/playwright" : ".");
  9. execSync(`docker compose --project-directory ${path} --profile playwright --env-file test.env build VaultwardenPrebuild`, {
  10. env: { ...process.env },
  11. stdio: "inherit"
  12. });
  13. execSync(`docker compose --project-directory ${path} --profile playwright --env-file test.env build Vaultwarden`, {
  14. env: { ...process.env },
  15. stdio: "inherit"
  16. });
  17. }
  18. export default globalSetup;