schickling/chromeless

Cannot run wait selector after using `.evaluate()`

IAMtheIAM opened this issue · 0 comments

I confirm an issue with waiting for elements occurs after running .evaluate, The wait fails after

    const screenshot = await chromeless
        .setViewport({width: 1920, height: 1080, scale: 1})
         .goto('https://www.mylogin.com')
         .evaluate(() => {            doSomething(); })    <---- comment this out and it works
        .click('a.signin')
        .wait(2000)
        .type('username', 'input[name="username"]')
        .type('password', 'input[name="password"]')
        .press(13)
        .screenshot();

Results in

Error: wait("input[name="username"]") timed out after 10000ms

With the evaluate line removed, the screenshot and whole express works fine.