mardi 28 novembre 2017

Perform assertions on new tab in zombie.js

I'm trying to test a webpage with Zombie.js In my test case I want to click a button, which will open a new tab, an the check that the new page contains a certain text. At the moment I have this:

browser.click("button .btn");
assert.strictEqual(browser.tabs.length, 2);
browser.tabs.current = browser.tabs[1];
browser.assert.text("#status", "This text should exits");

Everything works correctly when clicking the button, and, as expected, a new tab is added (checked by the assert), however, when executing I get this error:

AssertionError [ERR_ASSERTION]: No open window with an HTML document

My best guess is that I'm trying to check the text before the new tab is done loading. I have no idea how to wait for it to load or if I'm using tabs in zombie.js correctly.

Thanks

Aucun commentaire:

Enregistrer un commentaire