feat: enhance web extension with export functionality and utility improvements
Some checks failed
Tests / Tests (push) Has been cancelled
ESLint Check / ESLint Check and Report Upload (push) Has been cancelled
Prettier Check / Format Check (push) Has been cancelled
Prettier Check / Format Code (push) Has been cancelled
ESLint Check / Build Base for Bundle Size Comparison (push) Has been cancelled
Some checks failed
Tests / Tests (push) Has been cancelled
ESLint Check / ESLint Check and Report Upload (push) Has been cancelled
Prettier Check / Format Check (push) Has been cancelled
Prettier Check / Format Code (push) Has been cancelled
ESLint Check / Build Base for Bundle Size Comparison (push) Has been cancelled
- Add export functionality to SessionList and Player pages - Add new utility modules: dataOperations, format, path, settings - Update manifest with export and download permissions - Enhance storage utility with new data operations - Add various test scripts and documentation files
This commit is contained in:
86
quick-verify.js
Normal file
86
quick-verify.js
Normal file
@@ -0,0 +1,86 @@
|
||||
const puppeteer = require('puppeteer-core');
|
||||
|
||||
(async () => {
|
||||
const browser = await puppeteer.launch({
|
||||
headless: false,
|
||||
executablePath: 'C:\\Users\\xgp\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe',
|
||||
args: ['--allow-file-access-from-files', '--disable-web-security'],
|
||||
timeout: 60000,
|
||||
protocolTimeout: 30000
|
||||
});
|
||||
|
||||
const page = await browser.newPage();
|
||||
|
||||
page.on('console', msg => {
|
||||
console.log('CONSOLE:', msg.text());
|
||||
});
|
||||
|
||||
await page.goto('file:///C:/Users/xgp/projects/rrweb/index.html', {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000
|
||||
});
|
||||
|
||||
console.log('=== 快速验证测试 ===\n');
|
||||
|
||||
// 等待页面加载
|
||||
await new Promise(r => setTimeout(r, 3000));
|
||||
|
||||
// 步骤 1: 开始录制
|
||||
console.log('1. 开始录制...');
|
||||
await page.click('#start-btn');
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
|
||||
// 步骤 2: 执行操作
|
||||
await page.evaluate(() => {
|
||||
document.querySelector('button[onclick="changeColor()"]').click();
|
||||
document.querySelector('button[onclick="addCounter()"]').click();
|
||||
});
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
|
||||
// 步骤 3: 停止录制
|
||||
console.log('2. 停止录制...');
|
||||
await page.click('#stop-btn');
|
||||
await new Promise(r => setTimeout(r, 3000));
|
||||
|
||||
// 步骤 4: 检查事件是否保存
|
||||
console.log('3. 检查事件...');
|
||||
const eventCount = await page.evaluate(() => {
|
||||
return window.events ? window.events.length : 0;
|
||||
});
|
||||
console.log(`事件数量: ${eventCount}`);
|
||||
|
||||
// 步骤 5: 测试导出函数
|
||||
console.log('4. 测试导出函数...');
|
||||
const exportAvailable = await page.evaluate(() => {
|
||||
return typeof window.exportRecording === 'function' && window.events && window.events.length > 0;
|
||||
});
|
||||
console.log(`导出函数可用: ${exportAvailable}`);
|
||||
|
||||
// 步骤 6: 测试播放按钮
|
||||
console.log('5. 测试播放按钮...');
|
||||
const playBtn = await page.$('#play-toggle-btn');
|
||||
if (playBtn) {
|
||||
const isDisabled = await playBtn.evaluate(btn => btn.disabled);
|
||||
console.log(`播放按钮状态: ${isDisabled ? '禁用' : '启用'}`);
|
||||
if (!isDisabled) {
|
||||
await playBtn.click();
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
console.log('✓ 播放按钮点击成功');
|
||||
}
|
||||
}
|
||||
|
||||
await browser.close();
|
||||
|
||||
console.log('\n=== 验证总结 ===');
|
||||
console.log(`✓ 事件数量: ${eventCount}`);
|
||||
console.log(`✓ 导出功能: ${exportAvailable ? '可用' : '不可用'}`);
|
||||
|
||||
if (eventCount > 0 && exportAvailable) {
|
||||
console.log('🎉 修复成功!所有功能正常工作');
|
||||
} else {
|
||||
console.log('❌ 仍有问题需要修复');
|
||||
}
|
||||
})().catch(e => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user