forked from angular/protractor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathasync_spec.js
32 lines (27 loc) · 1.03 KB
/
async_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
describe('async angular1/2 hybrid using ngUpgrade application', function() {
beforeEach(function() {
browser.get('/hybrid');
});
it('should set browser flag via config', function() {
expect(browser.ng12Hybrid).toBe(true);
});
it('should be able to click buttons and wait for $timeout', function() {
var rootBtn = $$('my-app button').first();
expect(rootBtn.getText()).toEqual('Click Count: 0');
rootBtn.click();
expect(rootBtn.getText()).toEqual('Click Count: 1');
var ng2Btn = $$('ng2 button').first();
expect(ng2Btn.getText()).toEqual('Click Count: 0');
ng2Btn.click();
expect(ng2Btn.getText()).toEqual('Click Count: 1');
var ng1Btn = $('ng1 button');
expect(ng1Btn.getText()).toEqual('Click Count: 0');
ng1Btn.click();
expect(ng1Btn.getText()).toEqual('Click Count: 1');
});
it('should use the flag on the browser object', function() {
browser.ng12Hybrid = false;
browser.get('/ng2'); // will time out if Protractor expects hybrid
browser.ng12Hybrid = true;
});
});