lundi 1 février 2021

Mocha + Chai + Puppeteer Testing Response Hangs The Tests

it('Successfully Fetch Numbers',async(done)=>{
    page.on('response', response => {
        if (response.url().endsWith("allspecialnumbers"))
        {
         
            try {
                expect(response.status()).to.equal(200);
                done();

            }catch (err){
                console.log(err);
                done(err)

            }
        }
    })
    await page.$eval('#getsmsspecialnumbers_btn', el => el.click());
});

This tests hangs the code and on console the test is highlighted red without any error message. I am using chai, mocha and puppeteer

Aucun commentaire:

Enregistrer un commentaire