nocobase2/scripts/moveE2EReportFiles.js
Zeke Zhang df0d3ddee3
perf(e2e): reduce e2e runtime (#4280)
* chore: reuse page instance

* refactor: optimize

* chore: revert

* chore: ignore workflows

* chore: upgrade playwright to 1.44.0

* chore: fix failed tests

* refactor: optimize e2eUtils

* chore: make tests pass

* chore: optimize workflow for e2e

* chore: fix fialed tests

* chore: optimize workflows

* chore: optimize

* chore: fix path

* chore: fix

* chore: test

* chore: fix

* chore: test

* chore: test

* chore: add bot for e2e

* chore: wait to revert

* chore: wait to revert

* chore: fix

* chore: fix

* chore: fix bot

* chore: test

* chore: ignore pro-plugins on PR author is not member

* chore: optimize

* chore: test

* chore: test

* chore: test bot

* chore: remove title link

* chore: fix

* chore: fix error and cache yarn

* chore: optimize md

* chore: add new workflows
2024-05-10 20:51:11 +08:00

32 lines
813 B
JavaScript

const fs = require('fs');
const path = require('path');
const glob = require('glob');
// 源路径和目标路径
const sourcePattern = './storage/playwright/tests-report-blob/blob-*/*';
const targetDir = './storage/playwright/tests-report-blob/';
// 确保目标目录存在
fs.mkdirSync(targetDir, { recursive: true });
// 使用 glob 模块匹配文件
glob(sourcePattern, (err, files) => {
if (err) {
console.error('Error matching files:', err);
return;
}
// 移动每个文件
files.forEach((file) => {
const targetFile = path.join(targetDir, path.basename(file));
fs.rename(file, targetFile, (err) => {
if (err) {
console.error(`Error moving file ${file}:`, err);
} else {
console.log(`Moved file ${file} to ${targetDir}`);
}
});
});
});