mercredi 16 décembre 2015

Using Zombie.js for testing, how do you get the html that is shown on the page instead of the html the server sends initially?

I have the following code...

var Browser = require('zombie');

browser = new Browser();
var url = 'http://myURL.com';

describe('Loads pages', function () {

  before(function(done) {
    return browser.visit(url,done)
  });

  it("Zombie Nexus returns code 200 on load", function(done) {
    // expect(browser.assert.status(200));
    console.log(browser.query('#page-title').innerHTML);
    done();
  });
}

...eventually I will need to assert that the value in the console.log is equal to something specific. The problem is when I log the value I get a blank and if I log the using browser.query('body').innerHTML it shows me the body from the original HTML instead of the HTML shown after the browser runs its scripts. Is there a way to get that processed HTML?

Aucun commentaire:

Enregistrer un commentaire