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

Tell us what’s happening:
Unable to pass the last 2nd level

The following is my repl solution for the last second requirement of this course but I’m confused that it doesn’t pass in the curriculum page but no problems found in my repl site.

What else I need to add in the code? I’m using Opera window.

Your project link(s)

https://replit.com/@vlchung/boilerplate-mochachai-1

I tried to use the same code in the glitchme website and still I cannot pass this level

https://boilerplate-mochachai-.glitch.me/

If cannot use the zombie assertion code, why is it still required in the curriculum course website?

solution: boilerplate-mochachai-1 - Replit

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 OPR/96.0.0.0

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

Link to the challenge:

There are two problems. First, your setup from the first headless test is not quite right as all the setup steps need to be done at the root level.

Second, you need some more done() calls. You need one for the test() callback and one for the browser.pressButton() callback.

I amended the url link and the result is all tests passed in replit console but my url replit link is not accepted in the curriculum webpage

  
const Browser = require('zombie');
Browser.site = 'http://localhost:3000/';
suite('e2e Tests with Zombie.js', function () {
  this.timeout(5000);
 const browser = new Browser()
   suiteSetup(function(done) {
     return browser.visit('/', done);
});

This can be your repl’s live web URL and it should work; it always does for me. I believe it should route to the same place as localhost should be relative to your repl but I always use the live URL.

According to the previous challenge directions I linked above, this has to be at root level. This looks like you have it inside a suite() (unless you’ve added another suite() layer to the boilerplate).

To get the fCC tests to work you’ll have to have everything working with your repl. Then, start your repl in one tab and the tests immediately in another tab. There is another solution offered that adds an after() hook, but I’ve not had success with that method.

Nevermind. I passed all the test. Not sure why. Maybe because of the way it is coded in javascript. If out of proper placement of code, the who script will not be accepted in the curriculum website.