Hi, I’m struggling with the “Quality Assurance and Testing with Chai - Run Functional Tests using a Headless Browser II” challenge. My code seems ok so far, but in order to pass, I need to write an assertion that expects ‘failed’ to equal ‘passed’:
// running tests
expected ‘failed’ to equal ‘passed’
// tests completed
How would I do this?
This is my glitch code.
This is the code that I have written:
chai.request(server)
.put('/travellers')
.send({surname: "Vespucci"})
.end(function(err, res){
// fill the form, and submit.
// assert that status is OK 200
browser.assert.success(res.status, 200);
// assert that the text inside the element 'span#name' is 'Amerigo'
browser.assert.text('span#name', 'Amerigo');
// assert that the text inside the element 'span#surname' is 'Vespucci'
browser.assert.text('span#surname', 'Vespucci');
// assert that the element(s) 'span#dates' exist and their count is 1
browser.assert.element('span#dates', 1);
assert.fail();
done();
});
});```
![Capture|608x500](upload://w2X4BUDkbJ3Le2fmXrVUT0XZcCh.png)
https://imgur.com/6Hrt8MJ
Anyone please advise how to pass this exercise :slight_smile: