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

my test cases have passed but there is still 1st test case that says “All test case should pass” has not passed. Can anyone tell what is the problem ?

solution: Glitch :・゚✧

Your browser information:

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

Challenge Information:

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

It is failing the

  • You should assert that the element span#dates exist and its count is 1.

test for me.

The method you should be using is elements not element.

The former takes a count argument because there can be elements (plural) but the latter can not as it is only an element it is looking for so a count argument doesn’t make sense.

docs

assert.element(selection, message)

assert.elements(selection, count, message)

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