Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
titiritero página.evaluar en módulo.exportaciones

Solo trato de limpiar el código, así que decidí crear una nueva función e importarla en main.js Creo un nuevo a.js y muevo todo desde "it ( () => {})" a este archivo y aquí comienza mi problema. Page.evaluate simplemente no funciona, trato de console.log , alerta algo pero no funcionó. Entonces, ¿alguien podría ayudarme a limpiar ese desastre?

PD: cuando ponemos el código de a.js a main.js, todo está bien.

principal.js:

 const puppeteer = require('puppeteer'); const pti = require('puppeteer-to-istanbul'); const a= require('./a'); describe("test", async () => { (...) it ('a.js', async ()=>{ await a(page); a.js const a = async (page) => { const 1= '#1' await page.waitForSelector(1, {visible: true}) await page.click(1) await page.evaluate(async () => { let value = "Z" let clientPicker = document.querySelector('button[data-id="ctl00_CPH_Content__V_BPS_BankiProdukt__Q__Miejscowosc"]'); clientPicker.click(); let listOption = clientPicker.parentNode.querySelectorAll('li a > span') Array.from(listOption).find(item => item.innerText == value).click() }); (...) } module.exports = a;

RESUELTO: Tuve que agregar /* istanbul ignore next */

 await page.evaluate(/* istanbul ignore next */ () => {
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!