I have a problem with the zombie.js testing base and the Google Maps API.
I have a simple zombie.js that loads the home page and tries to click the Sign In link. However, when I look at what returns to the HTML home page (from the point of view of the zombie.js browser object), I only see this in the body section:
<body>
<script src="https://maps.gstatic.com/intl/en_us/mapfiles/api-3/9/12/main.js" type="text/javascript"></script>
</body>
If I remove javascript Google Maps from the original page, everything will be fine and I will get the full section. Requesting another page that does not use the map API also works fine.
I see a related question here, but the workaround is not fully described: https://github.com/assaf/zombie/issues/250
Can someone help me with a complete workaround?
Here is the zombie.js code:
suite('Zombie Sign In', function() {
test('Home page should have sign-in link', function(done) {
var browser = new Browser();
browser.debug = true;
browser.authenticate().basic(conf.basicAuth.username, conf.basicAuth.password);
browser.visit(conf.baseURL, function(e, browser) {
console.log(browser.html());
browser.clickLink("Sign In", function() {
browser.text("title").should.eql('my title');
done();
});
});
});
});
source