Skip to content

Commit

Permalink
fix: customize window size in yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyutaotao committed Jan 21, 2025
1 parent aa77a4b commit cb7b1c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'dotenv/config';
import { existsSync } from 'node:fs';
import { join } from 'node:path';
import dotenv from 'dotenv';
import { matchYamlFiles, parseProcessArgs } from './cli-utils';
import { playYamlFiles } from './yaml-runner';

Expand All @@ -9,6 +11,12 @@ Promise.resolve(
const welcome = '\nWelcome to @midscene/cli\n';
console.log(welcome);

const dotEnvConfigFile = join(process.cwd(), '.env');
if (existsSync(dotEnvConfigFile)) {
console.log(`loading .env file from ${dotEnvConfigFile}`);
dotenv.config({ path: dotEnvConfigFile });
}

if (options.url) {
console.error(
'the cli mode is no longer supported, please use yaml file instead. See https://midscenejs.com/automate-with-scripts-in-yaml for more information. Sorry for the inconvenience.',
Expand Down
2 changes: 2 additions & 0 deletions packages/web-integration/src/puppeteer/agent-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export async function puppeteerAgentForTarget(
...(isWindows ? [] : ['--no-sandbox', '--disable-setuid-sandbox']),
'--disable-features=PasswordLeakDetection',
'--disable-save-password-bubble',
'--start-maximized',
`--window-size=${width},${height}`,
],
});
freeFn.push({
Expand Down

0 comments on commit cb7b1c4

Please sign in to comment.