I'm trying to wait for a promise resolution using Cucumber, Chai, and Protractor. Is there a way using Chai to wait for something (like a pageload) to occur before sending the callback?
I want something like:
browser.get(url).then(callback)
which I thought would be in Chai:
browser.get(url).should.be.fulfilled.and.notify(callback);
although when I do that, I'm just getting a timeout, but I see the page has loaded. I already have it setup with:
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
var expect = chai.expect;
var should = chai.should;
I don't want to check for something, I just want to make sure the page loads. From what I've seen most people just do:
browser.get(url);
callback();
and only use an assert
or expect
in a Gherkins Then clause, but I want to wait for the page to load in a Given or When.