I’ve tried everything but I can’t find the solution to this. I have watched video tutorials and still, I got nothing. I’ve looked arround in forums and still don’t get why the test is failing.
My code goes as follows:
text const Browser = require(‘zombie’);
Browser.site = ‘https://boilerplate-mochachai.goncamarolopes.repl.co’;
suite(‘Functional Tests with Zombie.js’, function() {
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 “surname” : “Colombo” - write your e2e test…’, function(done) {browser .fill('surname', 'Colombo') .pressButton('submit', function() { browser.assert.success(); browser.assert.text("span#name", "Cristoforo"); browser.assert.text("span#surname", "Colombo"); browser.assert.element("span#dates", 1); done(); }); }); // #6 test('Submit the surname "Vespucci" in the HTML form', function (done) { browser.fill('surname', 'Vespucci').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(); }); });
});
});
This is the error it keeps throwing at me:
"1) Functional Tests with Zombie.js
“Famous Italian Explorers” form
submit “surname” : “Colombo” - write your e2e test…:
AssertionError [ERR_ASSERTION]: No open window with an HTML document
at Browser.field (node_modules/zombie/lib/index.js:598:5)
at Browser.fill (node_modules/zombie/lib/index.js:646:24)
at Context. (tests/2_functional-tests.js:93:10)
at process.processImmediate (node:internal/timers:476:21)
- Functional Tests with Zombie.js
“Famous Italian Explorers” form
Submit the surname “Vespucci” in the HTML form:
AssertionError [ERR_ASSERTION]: No open window with an HTML document
at Browser.field (node_modules/zombie/lib/index.js:598:5)
at Browser.fill (node_modules/zombie/lib/index.js:646:24)
at Context. (tests/2_functional-tests.js:104:15)
at process.processImmediate (node:internal/timers:476:21)"
I’ve read the two last challenges may have a bug and should be skipped but the post was from 3 years ago.
Any help would be greatly appreciated.
Challenge: Quality Assurance and Testing with Chai - Run Functional Tests Using a Headless Browser II
Link to the challenge: