log all requests with their response code
This commit is contained in:
parent
29d688543d
commit
5129bb57b6
2 changed files with 5 additions and 6 deletions
|
@ -54,14 +54,15 @@ function logConsole(page) {
|
|||
|
||||
function logXHRRequests(page) {
|
||||
let buffer = "";
|
||||
page.on('request', req => {
|
||||
page.on('requestfinished', async (req) => {
|
||||
const type = req.resourceType();
|
||||
if (type === 'xhr' || type === 'fetch') {
|
||||
buffer += `${req.method()} ${req.url()} \n`;
|
||||
const response = await req.response();
|
||||
//if (type === 'xhr' || type === 'fetch') {
|
||||
buffer += `${type} ${response.status()} ${req.method()} ${req.url()} \n`;
|
||||
// if (req.method() === "POST") {
|
||||
// buffer += " Post data: " + req.postData();
|
||||
// }
|
||||
}
|
||||
//}
|
||||
});
|
||||
return {
|
||||
logs() {
|
||||
|
|
2
start.js
2
start.js
|
@ -54,8 +54,6 @@ async function runTests() {
|
|||
await acceptServerNoticesInviteAndConsent(page, noticesName);
|
||||
process.stdout.write('done\n');
|
||||
|
||||
throw new Error('blubby');
|
||||
|
||||
const room = 'test';
|
||||
process.stdout.write(`* creating room ${room} ... `);
|
||||
await createRoom(page, room);
|
||||
|
|
Loading…
Reference in a new issue