This repository was archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathtimeout_spec.js
58 lines (40 loc) · 1.6 KB
/
timeout_spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
describe('timeout possibilities', function() {
jasmine.getEnv().defaultTimeoutInterval = 33;
it('shoud pass - first test should not timeout', function() {
expect(true).toEqual(true);
});
it('should timeout due to webdriver script timeout', function() {
browser.driver.manage().timeouts().setScriptTimeout(55);
browser.get('index.html#/form');
browser.driver.executeAsyncScript(function() {
var callback = arguments[arguments.length - 1];
setTimeout(callback, 500);
});
expect(element(by.binding('greeting')).getText()).
toEqual('Hiya');
}, 5000); // The 5000 here sets the Jasmine spec timeout.
it('should fail normally', function() {
expect(false).toEqual(true);
});
it('should pass - tests in the middle should be unaffected', function() {
expect(true).toEqual(true);
});
describe('waitForAngular', function() {
it('should timeout and give a reasonable message', function() {
browser.driver.manage().timeouts().setScriptTimeout(55);
browser.get('index.html#/async');
var status = element(by.binding('slowHttpStatus'));
var button = element(by.css('[ng-click="slowHttp()"]'));
expect(status.getText()).toEqual('not started');
button.click();
expect(status.getText()).toEqual('done');
}, 5000); // The 5000 here sets the Jasmine spec timeout.
});
it('should timeout due to Jasmine spec timeout', function() {
browser.driver.sleep(1000);
expect(true).toBe(true);
});
it('should pass - previous timeouts should not affect this', function() {
expect(true).toEqual(true);
});
});