Unable to pass last test for Quality Assurance and Testing

MY code passes all the tests, yet “all tests should pass” does not. However, all of the tests pass in my local environment.

Screen Shot 2023-02-25 at 4.02.11 PM

Remedial solutions I’ve tried:

Live code is here: Glitch :・゚✧

Testing output on freeCodeCamp submission page:

Code:

const Browser = require('zombie');

suite('Functional Tests with Zombie.js', function () {

  Browser.site = 'http://localhost:3000/'; //set to local dev env
  const browser = new Browser();
  
  suiteSetup(function(done) {
    return browser.visit('/', done());
  });

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

   suite('"Famous Italian Explorers" form', function () {
    // #5
    test('Submit the surname "Colombo" in the HTML form', function (done) {
      browser.fill('surname', 'Colombo', async () => {
      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);
        done();
      })
    })
    });

    // #6
    test('Submit the surname "Vespucci" in the HTML form', function (done) {
      browser.fill('surname', 'Vespucci', async () => {
        browser.pressButton('submit', function(){
          browser.assert.success();
          browser.assert.text('span#name', 'Amerigo');
          browser.assert.text('span#surname', 'Vespucci');
          browser.assert.elements('span#dates', 1);
          done();
        })
      })
    });
  });
});

Any ideas?

Thanks,

-Wes

I can get your code to pass the last challenge, by making two modifications.

  1. Add the following to the bottom of your functional tests file:
after(function() {
  chai.request(server)
  .get('/')
});

As the tests crash the server, this reconnects.

  1. You need to remove the parentheses after the done.
suiteSetup(function(done) {
  return browser.visit('/', done());
});

Change those two things in your glitch and it should pass.

1 Like

Thank you! I knew it was something small.

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