I’ve passed all challenges Including Run Functional Tests using a Headless Browser II. But it’s Run Functional Tests using a Headless Browser telling me I’m failing the test.
test('submit "surname" : "Colombo" - write your e2e test...', function(done) {
// fill the form...
// then submit it pressing 'submit' button.
//
// in the callback...
browser
.fill('surname', 'Colombo')
.pressButton('submit', function(){
/** YOUR TESTS HERE, Don't forget to remove assert.fail() **/
// pressButton is Async. Waits for the ajax call to complete...
// assert that status is OK 200
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()''
});
//assert.equal('span#dates', 1);
//
});