Keep getting this error - Simulate Actions Using a Headless Browser

When i run the code i get this error

solution: https://replit.com/@ggrass1585/boilerplate-mochachai#tests/2_functional-tests.js

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

Challenge: Simulate Actions Using a Headless Browser

Link to the challenge:

You are missing the .then() on the first browser.fill.


But the 502 is just Replit being weird. It fails for me as well sometimes but it should work at some point if you keep trying. I might also suggest trying a timeout of 5000 (that is the default in the boilerplate code).


browser.debug() output when it works

Functional Tests with Zombie.js
zombie Opened window https://boilerplate-mochachai-new.lasjorg.repl.co/  +0ms
zombie GET https://boilerplate-mochachai-new.lasjorg.repl.co/ => 200 +131ms
zombie Loaded document https://boilerplate-mochachai-new.lasjorg.repl.co/ +34ms
zombie GET https://boilerplate-mochachai-new.lasjorg.repl.co/client.js => 200 +34ms

browser.debug() output when it doesn’t work (502 bad gateway)

Functional Tests with Zombie.js
zombie Opened window https://boilerplate-mochachai-new.lasjorg.repl.co/  +0ms
zombie GET https://boilerplate-mochachai-new.lasjorg.repl.co/ => 502 +393ms
zombie Loaded document https://boilerplate-mochachai-new.lasjorg.repl.co/ +175ms
zombie Error: Server returned status code 502 from https://boilerplate-mochachai-new.lasjorg.repl.co/

but now i get another error

22 passing (5s)
  1 failing

  1) Functional Tests with Zombie.js
       "before all" hook in "Functional Tests with Zombie.js":
     Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/runner/boilerplate-mochachai/tests/2_functional-tests.js)
      at listOnTimeout (internal/timers.js:554:17)
      at processTimers (internal/timers.js:497:7)

Not sure why, but you remove code you shouldn’t have.

This is now missing from your code:

  suite('Headless browser', function () {
    test('should have a working "site" property', function() {
      assert.isNotNull(browser.site);
    });
  });

When I add that back it passes all the tests for me.

thanks for helping me it passed all the test

1 Like