Quality Assurance and Testing with Chai - Simulate Actions Using a Headless Browser

Tell us what’s happening:
I thought that I followed the instructions exactly.

  1. Immediately after the Browser declaration, I added my specific site.
  2. At the root level of the functional tests suite, I instantiated a new instance of the Browser object.
  3. And I’m using the suiteSetup hook only once at the beginning of the test suite.

Why can’t I pass the test? My code is below. Does anybody know why?
Screen Shot 2023-01-27 at 2.00.34 PM

const Browser = require('zombie');
Browser.site = 'https://boilerplate-mochachai.technoaudrey.repl.co';


suite('Functional Tests with Zombie.js', function () {
  this.timeout(5000);
  const browser = new Browser();

   suiteSetup(function(done) {
  return browser.visit('/', done);
});
  

Your project link(s)

solution: boilerplate-mochachai - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Challenge: Quality Assurance and Testing with Chai - Simulate Actions Using a Headless Browser

Link to the challenge:

I had similar problems when I was working on this last year. There is some issue which I don’t understand about replit and zombie working together (or rather not working).

In the end, the solution was to run the tests locally.

Here’s a forum thread which eventually resolved my issues:

Try changing your url for Browser.site to ‘http://localhost:3000/’ (or whatever port your server is running on).

That one simple change makes all of my tests pass (on repl).

2 Likes

Thank you so much for sending that. I’ll try your suggestion.

I’m completely shocked and slightly confused that this fixed my problem. Thank you.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.