Test is passing on repl but failing on freecodecamp page

Tell us what’s happening:

The test is passing on the repl but it is failing on challenge submission page.
I don’t understand the error.

Your code so far

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()’
});


Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; SM-A515F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.116 Mobile Safari/537.36 EdgA/45.09.4.5079.

Challenge: Run Functional Tests using a Headless Browser
Repl Link:https://repl.it/@bablu41951/boilerplate-mochachai#tests/2_functional-tests.js
Link to the challenge:
https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-and-testing-with-chai/run-functional-tests-using-a-headless-browser

Hello there,

Seeing as the test is timing out, you are most likely going to get useful information from:

  1. The browser console on the /learn page.
  2. The REPL.it console

The time out error suggests there is an issue with your app. Specifically, the connection between freeCodeCamp, and your app.

Look for related errors in the consoles, then report back here, if you are still stuck.

Hope this helps

I checked every line, there are no errors in the console and reloaded freecodecamp submission page
https://boilerplate-mochachai.bablu41951.repl.co

This is what I see in the browser console:
image

Also, I am unable to get the api endpoint:
https://boilerplate-mochachai.bablu41951.repl.co/_api/get-tests?type=functional&n=4

So, it might be useful updating the version of cors in your package.json to the latest stable release.

Hope this helps

I did that ,
added a stable version but its not working and repl is upgraded to latest version

Repl Version update prevented the working of the tests[headless browser],after the reload page accepted successfully

  • passed the test