chore(e2e): use APP_BASE_URL in codegen

This commit is contained in:
Rain 2023-10-07 12:53:02 +08:00
parent 2fc81524b0
commit b4e8855eca

View File

@ -4,13 +4,13 @@ import { commonConfig, runNocoBase } from './utils';
const runCodegenSync = () => { const runCodegenSync = () => {
try { try {
execSync( execSync(
`npx playwright codegen --load-storage=playwright/.auth/codegen.auth.json http://localhost:${process.env.APP_PORT} --save-storage=playwright/.auth/codegen.auth.json`, `npx playwright codegen --load-storage=playwright/.auth/codegen.auth.json ${process.env.APP_BASE_URL} --save-storage=playwright/.auth/codegen.auth.json`,
commonConfig, commonConfig,
); );
} catch (err) { } catch (err) {
if (err.message.includes('auth.json')) { if (err.message.includes('auth.json')) {
execSync( execSync(
`npx playwright codegen http://localhost:${process.env.APP_PORT} --save-storage=playwright/.auth/codegen.auth.json`, `npx playwright codegen ${process.env.APP_BASE_URL} --save-storage=playwright/.auth/codegen.auth.json`,
commonConfig, commonConfig,
); );
} else { } else {