Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 9532779

Browse files
committed
chore(test): fix wait time out error for async angular2 periodic increments test
1 parent 1dd6e33 commit 9532779

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

Diff for: spec/ng2/async_spec.js

+24-21
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,29 @@ describe('async angular2 application', function() {
5555
expect(timeout.$('.val').getText()).toEqual('10');
5656
});
5757

58-
it('should wait for a series of periodic increments', function() {
59-
var timeout = $('#periodicIncrement');
60-
61-
// Waits for the val to count to 1 and 2.
62-
var EC = protractor.ExpectedConditions;
63-
timeout.$('.action').click();
64-
browser.wait(EC.textToBePresentInElement(timeout.$('.val'), '1'), 3000);
65-
timeout.$('.cancel').click();
66-
67-
var text = timeout.$('.val').getText();
68-
browser.driver.sleep(3000);
69-
expect(timeout.$('.val').getText()).toEqual(text);
70-
71-
timeout.$('.action').click();
72-
browser.wait(EC.textToBePresentInElement(timeout.$('.val'), '3'), 6000);
73-
timeout.$('.cancel').click();
74-
75-
text = timeout.$('.val').getText();
76-
browser.driver.sleep(3000);
77-
expect(timeout.$('.val').getText()).toEqual(text);
78-
58+
describe('long async spec', function() {
59+
var originalTimeout;
60+
beforeEach(function() {
61+
originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL;
62+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
63+
});
64+
65+
it('should wait for a series of periodic increments', function() {
66+
var timeout = $('#periodicIncrement');
67+
68+
// Waits for the val to count 2.
69+
var EC = protractor.ExpectedConditions;
70+
timeout.$('.action').click();
71+
browser.wait(EC.textToBePresentInElement(timeout.$('.val'), '1'), 4000);
72+
timeout.$('.cancel').click();
73+
74+
var text = timeout.$('.val').getText();
75+
browser.driver.sleep(3000);
76+
expect(timeout.$('.val').getText()).toEqual(text);
77+
});
78+
79+
afterEach(function() {
80+
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
81+
});
7982
});
8083
});

0 commit comments

Comments
 (0)