Quality Assurance and Testing with Chai - Run Functional Tests Using a Headless Browser

Tell us what’s happening:

I’m working on the Functional Tests Using a Headless Browser challenge on the QA course and I keep running into a persistent issue. Despite having a fully functioning test that:

Submits the surname “Colombo”

Returns a 200 status

Outputs the correct values inside , , and

The test suite still fails with vague or incorrect feedback like:

“You should assert that the headless browser request succeeded.”
Any solution to this?

###Your project link(s)

solution: http://localhost:3000

Your browser information:

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

Challenge Information:

Quality Assurance and Testing with Chai - Run Functional Tests Using a Headless Browser

can you share your code please?

Okay, here:

const Browser = require('zombie');
Browser.site = 'http://127.0.0.1:3000/';


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



  suite('"Famous Italian Explorers" form', function () {
    // #5
    test('submit the  "Colombo" in the HTML form', function (done) {
     browser .visit('/', function () {
      browser.fill('surname', 'Colombo').then(function () {
      browser.pressButton('submit', function () {
        browser.assert.success();
        browser.assert.text("span#name", "Cristoforo");
        browser.assert.text("span#surname", "Colombo");
        browser.assert.elements('span#dates', 1);
          browser.visit('/', done);
      });
    });
  });
});
  });
  
    suite('"Famous Italian Explorers" form', function () {
    // #6
    test('Submit the surname "Vespucci" in the HTML form', function (done) {
      browser.fill('surname', 'Vespucci')
      browser.pressButton('submit', function () {
        browser.assert.status(200);
        browser.assert.text('span#name', 'Amerigo');
        browser.assert.text('span#surname', 'Vespucci');
        browser.assert.elements('span#dates', 1);
        done();
      });
    });
  });
});

Where is the .then() in the second test? Compare the first and second tests.


I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

It is not even about that, I was just comparing different method to see which will work, but done of them is working

Please post your code with the .then, it would be better if you posted all your code, I would suggest posting a repo.


To be clear, browser.fill() either must be supplied a callback, or it will return a promise. You are doing neither in the code you posted.

But you have also added browser.visit code inside the first test, and that shouldn’t be there. It only goes in the suiteSetup code from the previous step, do not remove or change the code from the previous step.