Browser text assertions with mocha/zombie.js not working

I can’t complete one of the last lessons in the Quality Assurance course: ’ Run Functional Tests using a Headless Browser’

Everything runs smoothly except for browser.assert.text(). I’ve tried changing the assertion to ‘.element’ and ‘.text’ and even ‘.element.text’ and have not succeeded. Here is the proposed solution, which also doesn’t work for me: freeCodeCamp Challenge Guide: Run Functional Tests using a Headless Browser

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

suite("e2e Testing with Zombie.js", function () {
  const browser = new Browser();
    suiteSetup(function(done) {
    return browser.visit('/', done);
  });
  suite('"Famous Italian Explorers" form', function () {
    // #5
    test('submit "surname" : "Colombo" - write your e2e test...', function (done) {
      browser.fill('surname', 'Colombo').pressButton('submit', function() {
        browser.assert.success();
        browser.assert.text('span#name', 'Cristoforo');
        browser.assert.text('span#surname', 'Colombo');
        browser.assert.element('span#dates', 1);

        done(); 
      });
    });
        

Your browser information:

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

Challenge: Run Functional Tests using a Headless Browser

Link to the challenge:

Welcome, nikkipeel.

This would be the same issue here:
Quality Assurance and Testing with Chai - Run Functional Tests using a Headless Browser. I can’t complete this. All tests are failed - General - The freeCodeCamp Forum

1 Like

The code provided in the example parentheses is not closed at the last line, you just have to close it and it’ll probably work:

test('#test - submit the input "surname" : "Polo"', function (done) {
  browser.fill('surname', 'Polo').pressButton('submit', function () {
    browser.assert.success();
    browser.assert.text('span#name', 'Marco');
    browser.assert.text('span#surname', 'Polo');
    browser.assert.element('span#dates', 1);
    done();
  });
}