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

Tell us what’s happening:

I am having a similar issue as others. All my tests pass up to the last two. I get “AssertionError [ERR_ASSERTION]: No open window with an HTML document”. I am running locally using vs code. Here is my github repo for this. GitHub - Tntragan/mochachai.

Any help would be appreciated. Thank you.

###Your project link(s)

solution: http://localhost:3000

Your browser information:

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

Challenge Information:

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

You should not call done in the browser.visit method, just pass it as a callback.

Also, if you get a bind EINVAL 0.0.0.0 error use 0.0.0.0 instead of localhost for the Browser.site URL.

Browser.site = "http://0.0.0.0:3000";
2 Likes

I had sent a reply to refute what you said about the “done()” call because I had tried that before and got an error. But when I changed my Browser.site URL to the one you suggested and I removed the parentheses it passed. So now I am editing my reply to say your a genius. Thank you for the help. When I only changed the parentheses I couldn’t pass the previous test, but if I implemented both of your changes everything works. Thank you so much. I appreciate the help.

1 Like

BTW, I made a PR to fix the URL issue. I had an issue open about it, that I forgot about. I added a note about the done callback as well. Hopefully, that will help.

1 Like

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