fix(testing): Fixed race condition in WebWorker and Routing tests
This commit is contained in:
@ -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() {
|
||||
|
Reference in New Issue
Block a user