Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

SeeTraffic & Grabbing network traffic not working

Aperta
#4,524 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
testing

Direzione di ricerca

Inizia riproducendo il problema con la configurazione WebDriver fornita e le chiamate a seeTraffic e grabRecordedNetworkTraffics. Esamina startRecordingTraffic e RequestPostDataObject in helper/network/utils.js, incluso l’uso indicato alla riga 101. Il lavoro è completato quando il traffico registrato contiene campi response valorizzati e seeTraffic valuta correttamente requestPostData invece di passarlo incondizionatamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What are you trying to achieve?

I am trying to use seeTraffic and grabRecordedNetworkTraffics functions. grab* function is returning array with empty values or each field. seeTraffic is always passing because it is not able to assert on 'requestPostData'

What do you get instead?

for grabRecordedNetworkTraffics I am getting empty values like below:

for seeTraffic, it is always passing.

As per my analysis,

  1. For grabRecordedNetworkTraffics, startRecordingTraffic() always returning data with _response = null. Which is causing grabRecordedNetworkTraffics to return empty values.

  2. For seeTraffic API call, I found that variable 'RequestPostDataObject' inside helper/network/utils.js is stringified but it is being used as object at line number 101 in the file.

Provide console output if related. Use --verbose mode for more details.

I grab recorded network traffics 
Network traffic [
  { url: '', response: { status: '', statusText: '', body: '' } },
  { url: '', response: { status: '', statusText: '', body: '' } }
]
    I stop recording traffic 
  ✔ OK in 15331ms
I.amOnPage(`http://localhost:3000`);
  
    I.startRecordingTraffic();
    I.click('[data-testid="capture-button"]');
    I.wait(3);
    I.seeTraffic({
        name: 'random', // not sure what to put here
        url: 'http://localhost:3000/mock-data',
        // parameters: { key: 'value' },
        requestPostData: {
            operations: [
                {
                   //some data
                },
            ],
       }     
    });
    const networkTraffic2 = await I.grabRecordedNetworkTraffics();
    console.log('Network traffic', networkTraffic2);
Details

I am trying to assert some network API payload so that I can ensure, on submitting a form it is sending the correct data.

  • CodeceptJS version: 3.6.3-beta.2
  • NodeJS Version: 20.16.0 /16.14.2
  • Operating System: Mac
  • puppeteer || webdriverio || testcafe version (if related) webdriverio
  • Configuration file:
 helpers: {
        WebDriver: {
            url: getBaseUrl(),
            browser: 'chrome',
            windowSize: '1366x768',
            desiredCapabilities: {
                chromeOptions: {
                    args: [
                        ...webDriverAdditionalArgs,
                        '--no-sandbox',
                        '--unexpectedAlertBehavior=accept',
                        '--unhandledPromptBehavior=accept',
                    ],
                },
Lingua principale
JavaScript
Stelle
4.2k
Fork
756
Merge medio
2g 9h
PR unite (30g)
16

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codeceptjs/CodeceptJS

Tutte le issue di codeceptjs/CodeceptJS

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.