chore(e2e): Log in via CLI during global setup to update cache (#3235)

* chore(e2e): log in via CLI

* CR

* CR: Rename ci option
This commit is contained in:
Michael Li authored and GitHub committed 2026-04-23 11:57:24 -04:00
1 parent 4f9086642b
commit 6d7e24fdc5
6 files changed
+39 -1

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
/**
* Copyright IBM Corp. 2021, 2026
* SPDX-License-Identifier: BUSL-1.1
*/
import * as boundaryCli from '../helpers/boundary-cli.js';
import baseGlobalSetup from '../global-setup.js';
export default async function globalSetup() {
await baseGlobalSetup();
// when running locally, there's a chance that the cache could be running an
// older version.
// stop the cache if it's running, and the desktop client will automatically
// start the cache after logging in .
await boundaryCli.checkBoundaryCli();
await boundaryCli.stopCache();
}
+1 -1
View File
@@ -6,7 +6,7 @@ import { defineConfig } from '@playwright/test';
/** @type {import('@playwright/test').PlaywrightTestConfig} */
export default defineConfig({
globalSetup: '../global-setup',
globalSetup: './global-setup',
outputDir: './artifacts',
workers: 1, // Tests need to be run in serial, otherwise there may be conflicts when using the CLI
use: {
+1
View File
@@ -4,6 +4,7 @@
*/
import { chromium, test as baseTest, mergeTests } from '@playwright/test';
import { checkEnv } from './helpers/general.js';
import { boundaryApiClientTest } from './helpers/boundary-api-client.js';
import { LoginPage } from './admin/pages/login.js';
+1
View File
@@ -9,6 +9,7 @@ export * from './boundary-cli/accounts.js';
export * from './boundary-cli/aliases.js';
export * from './boundary-cli/auth-methods.js';
export * from './boundary-cli/authenticate.js';
export * from './boundary-cli/cache.js';
export * from './boundary-cli/connect.js';
export * from './boundary-cli/credential-stores.js';
export * from './boundary-cli/credentials.js';
+17
View File
@@ -0,0 +1,17 @@
/**
* Copyright IBM Corp. 2021, 2026
* SPDX-License-Identifier: BUSL-1.1
*/
import { execSync } from 'node:child_process';
/**
* Stops the boundary cache used by the desktop client
*/
export async function stopCache() {
try {
execSync('boundary cache stop');
} catch (e) {
console.log(`${e.stderr}`);
}
}
+1
View File
@@ -25,6 +25,7 @@
"admin:dev:firefox": "pnpm run admin --project=firefox --headed",
"admin:dev:safari": "pnpm run admin --project=webkit --headed",
"desktop": "pnpm run --filter desktop build && pnpm run desktop:dev",
"desktop:local": "SETUP_CLI=true pnpm run desktop",
"desktop:dev": "pnpm playwright test --config desktop/playwright.config.js --reporter=html"
},
"devDependencies": {