I’m working on the Functional Tests Using a Headless Browser challenge on the QA course and I keep running into a persistent issue. Despite having a fully functioning test that:
Submits the surname “Colombo”
Returns a 200 status
Outputs the correct values inside , , and
The test suite still fails with vague or incorrect feedback like:
“You should assert that the headless browser request succeeded.”
Any solution to this?
Where is the .then() in the second test? Compare the first and second tests.
I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
Please post your code with the .then, it would be better if you posted all your code, I would suggest posting a repo.
To be clear, browser.fill() either must be supplied a callback, or it will return a promise. You are doing neither in the code you posted.
But you have also added browser.visit code inside the first test, and that shouldn’t be there. It only goes in the suiteSetup code from the previous step, do not remove or change the code from the previous step.