2022-11-05 12:33:20
36阅读
测试用例
const http = require('http');
const { chromium, expect, test } = require('@playwright/test');
http.createServer(function (req, res) {
(async () => {
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext()
const page = await context.newPage();
const obj = {
screenshots: true,
snapshots: true,
sources: true
}
await context.tracing.start(obj)
await page.goto('http://www.good1230.com/');
await context.tracing.stop({ path: "trace.zip" })
})();
res.writeHead(200, { 'Content-Type': 'text/html' });
res.write('Node.js says hello!');
res.end();
}).listen(8080);
最后生成于
2024-06-22 12:07:29
热门推荐:
此内容有帮助 ?
0