fix(testing): Fixed race condition in WebWorker and Routing tests

This commit is contained in:
Jason Teplitz
2015-07-30 10:47:32 -07:00
parent 5c21af95c7
commit eee2146735
2 changed files with 8 additions and 18 deletions

View File

@ -7,12 +7,6 @@ function waitForElement(selector) {
browser.wait(EC.presenceOf($(selector)), 10000);
}
// returns a promise that resolves in the given number of milliseconds
function wait(time) {
var promise = new Promise((resolve, reject) => { setTimeout(resolve, time); });
return promise;
}
describe('routing inbox-app', function() {
afterEach(verifyNoBrowserErrors);
@ -69,8 +63,9 @@ describe('routing inbox-app', function() {
waitForElement('#item-10');
element(by.css('#item-10')).click();
waitForElement('#record-id');
browser.wait(wait(500), 600);
expect(element(by.css('#record-id')).getText()).toEqual('ID: 10');
var recordId = element(by.css("#record-id"));
browser.wait(protractor.until.elementTextIs(recordId, "ID: 10"), 5000);
expect(recordId.getText()).toEqual('ID: 10');
});
it('should navigate back to the email inbox page when the back button is clicked', function() {