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

Tell us what’s happening:
Im having the TypeError: bind EINVAL 0.0.0.0

Your code so far

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

suite('Functional Tests with Zombie.js', function () {
  this.timeout(5000);
  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').then(() => {
            browser.pressButton('submit', () => {
                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) {
      assert.fail();

      done();
    });
  });
});

Your browser information:

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

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

Link to the challenge:

1 Like

Try using 0.0.0.0 instead of localhost

2 Likes

That worked, thank you
I tried 127.0.0.1 and it works too

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