Headless Browser Challenge I and II is not passing everything looks good

That is one step closer.
After updating that and run the test I got this

image

Forgot to add the parameters to your browser.fill() function :upside_down_face:

I fixed that. But the error logs are showing that there is an issue with even the example and the browser.fill() section.

  1. Functional Tests e2e Testing with Zombie.js “Famous Italian Explorers” form #example - submit the input “surname” : “Polo”:
    9:36 PM
    TypeError: browser.fill(…).pressButton is not a function
    9:36 PM
    at Context. (tests/2_functional-tests.js:272:41)
    9:36 PM
    9:36 PM
  2. Functional Tests e2e Testing with Zombie.js “Famous Italian Explorers” form submit “surname” : “Colombo” - write your e2e test…:
    9:36 PM
    TypeError: browser.fill(…).pressButton is not a function
    9:36 PM
    at Context. (tests/2_functional-tests.js:300:45)
    9:36 PM
    9:36 PM
  3. Functional Tests e2e Testing with Zombie.js “Famous Italian Explorers” form submit “surname” : “Vespucci” - write your e2e test…:
    9:36 PM
    TypeError: browser.fill(…).pressButton is not a function
    9:36 PM
    at Context. (tests/2_functional-tests.js:320:44)

Those are the same errors I got as well.

It’s confusing since the example is also getting that error.

Hey @gus1,

I used zombie version 4.2.1, which did not throw that error. Trying it in your project got the tests to pass as well.
I’ll do some digging to see if the syntax changed and if so, I’ll sumbit to have the example updated.

4.2.1 is the version used in the FCC boilerplate, by the way. :slight_smile:

Try changing your zombie version in package.json to ^4.2.1. That appears to fix the issue.

I had ^4.2.1 (which I know will upgrade to the latest because of the ^.

But after removing it. It worked!

Thank you so much for the help!!!

I am glad you were able to get it! :slight_smile:

1 Like

I tried changing it to 4.2.1.and it wouldn’t let me pass headless browser I but I was able to pass the second headless browser challenge

Nvm I fixed it the issue ! there was a typo error thank you for all of help!:slight_smile:

1 Like

Had similar issues with “Run Functional Tests using a Headless Browser I and II” and finally resolved it.

Firstly, as mentioned before, you need to add the link to your project under Browser.site:

  var Browser = require('zombie');
  Browser.site = 'LINK'; 
  suite('e2e Testing with Zombie.js', function() {

Secondly, you need to make sure that all curly brackets are properly closed and are enclosing exactly what they should. The following structure worked for me; I did not have to modify the package.json file.

suite('Functional Tests', function() {
  test('Asynchronous test #example', function(done){
  });
  suite('Integration tests with chai-http', function() {
    suite('GET /hello?name=[name] => "hello [name]"', function(){
      test('#example - ?name=John',  function(done){
      });
      test('Test GET /hello with no name', function(done){
      });
      test('Test GET /hello with your name',  function(done){
      });
    });
    suite('PUT /travellers', function(){
      test('#example - responds with appropriate JSON data when sending {surname: "Polo"}',  function(done){
      });
      test('send {surname: "Colombo"}',  function(done){
      });
      test('send {surname: "da Verrazzano"}', function(done) {
      });
    });
  });
  var Browser = require('zombie');
  Browser.site = 'LINK'; 
  suite('e2e Testing with Zombie.js', function() {
    const browser = new Browser();
    suiteSetup(function(done) {
      return browser.visit('/', done);
    });
    suite('"Famous Italian Explorers" form', function() {
      test('#example - submit the input "surname" : "Polo"', function(done) {
      });
      test('submit "surname" : "Colombo" - write your e2e test...', function(done) {
      });
      test('submit "surname" : "Vespucci" - write your e2e test...', function(done) {
      });
    });
  });
});