midscene/packages/cli/tests/bin.test.ts

28 lines
789 B
TypeScript
Raw Normal View History

2024-08-08 15:39:07 +08:00
import { execa } from 'execa';
import { describe, test, vi } from 'vitest';
2024-08-08 15:39:07 +08:00
const cliBin = require.resolve('../bin/midscene');
vi.setConfig({
testTimeout: 120 * 1000,
2024-08-08 15:39:07 +08:00
});
const shouldRunAITest =
process.platform !== 'linux' || process.env.AITEST === 'true';
describe.skipIf(!shouldRunAITest)('bin', () => {
test('run yaml scripts', async () => {
const params = ['./tests/midscene_scripts'];
await execa(cliBin, params);
});
2024-08-08 15:39:07 +08:00
test('run yaml scripts with keepWindow', async () => {
const params = ['./tests/midscene_scripts', '--keep-window'];
await execa(cliBin, params);
2024-08-08 15:39:07 +08:00
});
test('run yaml scripts with headed, put options before path', async () => {
const params = ['--headed', './tests/midscene_scripts'];
await execa(cliBin, params);
});
2024-08-08 15:39:07 +08:00
});