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

In challenge #23 and #24 of Quality Assurance and Testing with Chai and Zombie, the challenges will not let me pass even though everything looks fine. I keep getting the errors:
“All tests should pass.
You should assert that the headless browser request succeeded.
You should assert that the text inside the element ‘span#name’ is ‘Amerigo’.
You should assert that the text inside the element ‘span#surname’ is ‘Vespucci’.
You should assert that the element ‘span#dates’ exist and its count is 1.”
And every time I think I’ve fixed it, it just says the same errors . I am stuck! Please help maybe I missed something!!

Your code so far

test(‘submit “surname” : “Colombo” - write your e2e test…’, function(done) {
// pressButton is ## Async ##.
// It waits for the ajax call to complete…
browser.fill(‘surname’, ‘Colombo’).pressButton(‘submit’, function() {
// assert that status is OK 200
browser.assert.success();
// assert that the text inside the element ‘span#name’ is ‘Cristoforo’
browser.assert.text(‘span#name’, ‘Cristoforo’);
// assert that the text inside the element ‘span#surname’ is ‘Colombo’
browser.assert.text(‘span#surname’, ‘Colombo’);
// assert that the element(s) ‘span#dates’ exist and their count is 1
browser.assert.element(‘span#dates’, 1);

        done();   // It's an async test, so we have to call 'done()''
      });
    // 
  });
    
  
  test('submit the input "surname" : "Vespucci"', function(done) {
    browser.fill("surname", "Vespucci").pressButton("submit", function() {
      //fill the form, and submit.
    // assert that status is OK 200
      browser.assert.success();
    // assert that the text inside the element 'span#name' is 'Amerigo'
      browser.assert.text('span#name', 'Amerigo');
    // assert that the text inside the element 'span#surname' is 'Vespucci'
      browser.assret.text('span#name', 'Vespucci');
    // assert that the element(s) 'span#dates' exist and their count is 1
      browser.assert.element('span#dates', 1);
    done();  // It's an async test, so we have to call 'done()''

  });
});

Challenge: Run Functional Tests using a Headless Browser

Link to the challenge:

Link to project:

Welcome, jadagilliam.

Would you mind posting a link to your project?

Sure!

Here is an issue. I am unsure if it is the issue:

 browser.assret.text('span#name', 'Vespucci');

Line 281ish.

Hope this helps

Thank you!

I fixed the errors you suggested it but it still gave me the same errors.

Do you have anything in the console (logs)?

Yes, I went back and fixed all of the previous exercises and viewed the logs again.
This was the error it gave me:

  1. Functional Tests e2e Testing with Zombie.js “before all” hook:

4:41 PM

Error: Server returned status code 403 from https://sincere-cone.glitch.me/

4:41 PM

at /rbd/pnpm-volume/1c1f1be6-b2a8-4778-b9d6-87d59991391f/node_modules/.registry.npmjs.org/zombie/4.3.0/node_modules/zombie/lib/document.js:764:39

4:41 PM

at process._tickCallback (internal/process/next_tick.js:68:7)

I am not sure what the issue is, but that version of Zombiejs is 2 major versions behind. Try going to your package.json and updating it.

I tried updating it and I get the same log
Functional Tests e2e Testing with Zombie.js “before all” hook:

Error: Server returned status code 403 from https://sincere-cone.glitch.me/

at /rbd/pnpm-volume/1c1f1be6-b2a8-4778-b9d6-87d59991391f/node_modules/zombie/lib/document.js:618:39

at process._tickCallback (internal/process/next_tick.js:68:7)

Could it be something going on between line 194 and 205?

I noticed that when I clicked the error it said “Project sincere-cone suspended: Violating Terms of Service. PBR”

Hello~!

I took a quick peek at your project and you seem to be missing the fcctesting.js file. I’m not sure if it is actually missing or if I am just unable to see it, but that is the file that allows the tests to run properly.

image

1 Like

It is missing thank you! So do I just add it in in the Add File section ?

Did you find the page you are missing I have the exact same errors?

Yep. Add it in the add file section, but you need the code that goes in that file. You can get that from the FCC glitch linked on the challenge page.

Just started a new project in Glitch and it is not there.

Screen Shot 2020-06-07 at 8.29.13 PM

Oops!

Looks like the boilerplate has been updated since the last time I did these challenges.
My apologies :sweat_smile:

Any other suggestions?

Can you share a link to your glitch?

Line 326 you have a typo:
browser.assert.text('span@surname', 'Vespucci');

Fixed that typo. But I am getting that issue for both zombie questions.

@gus1 and @jadagilliam,

I believe I have found the issue.
On line 232 of the functional-tests.js file, you should see Browser.site = "https://sincere-cone.gomix.me";

You need to replace that url with the url to your own glitch project. :slight_smile:

1 Like