MY code passes all the tests, yet “all tests should pass” does not. However, all of the tests pass in my local environment.
Remedial solutions I’ve tried:
- Submitting on repl.it and glitch.me
- Single and double quotes, vice versa
- Updating my functions to async and .then
- Press the button a second time as mentioned here
- Using different urls for zombie: http://localhost:3000/ & https://rainbow-charm-bag.glitch.me
Live code is here: Glitch :・゚✧
Testing output on freeCodeCamp submission page:
Code:
const Browser = require('zombie');
suite('Functional Tests with Zombie.js', function () {
Browser.site = 'http://localhost:3000/'; //set to local dev env
const browser = new Browser();
suiteSetup(function(done) {
return browser.visit('/', done());
});
suite('Headless browser', function () {
test('should have a working "site" property', function() {
assert.isNotNull(browser.site);
});
});
suite('"Famous Italian Explorers" form', function () {
// #5
test('Submit the surname "Colombo" in the HTML form', function (done) {
browser.fill('surname', 'Colombo', async () => {
browser.pressButton('submit', function(){
browser.assert.success();
browser.assert.text('span#name', 'Cristoforo');
browser.assert.text('span#surname', 'Colombo');
browser.assert.elements('span#dates', 1);
done();
})
})
});
// #6
test('Submit the surname "Vespucci" in the HTML form', function (done) {
browser.fill('surname', 'Vespucci', async () => {
browser.pressButton('submit', function(){
browser.assert.success();
browser.assert.text('span#name', 'Amerigo');
browser.assert.text('span#surname', 'Vespucci');
browser.assert.elements('span#dates', 1);
done();
})
})
});
});
});
Any ideas?
Thanks,
-Wes