/
lib_spec.js
43 lines (35 loc) · 1.37 KB
/
lib_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
var util = require('util');
describe('no ptor at all', function() {
it('should still do normal tests', function() {
expect(true).toBe(true);
});
});
describe('protractor library', function() {
var ptor = protractor.getInstance();
it('should wrap webdriver', function() {
ptor.get('app/index.html');
expect(ptor.getTitle()).toEqual('My AngularJS App');
});
it('should export custom parameters to the protractor instance', function() {
expect(ptor.params.login).toBeDefined();
expect(ptor.params.login.user).toEqual('Jane');
expect(ptor.params.login.password).toEqual('1234');
});
it('should allow a mix of using protractor and using the driver directly',
function() {
ptor.get('app/index.html');
expect(ptor.getCurrentUrl()).
toEqual('http://localhost:8000/app/index.html#/http')
ptor.driver.findElement(protractor.By.linkText('repeater')).click();
expect(ptor.driver.getCurrentUrl()).
toEqual('http://localhost:8000/app/index.html#/repeater');
ptor.navigate().back();
expect(ptor.driver.getCurrentUrl()).
toEqual('http://localhost:8000/app/index.html#/http');
});
it('should export other webdriver classes onto the global protractor',
function() {
expect(protractor.ActionSequence).toBeDefined();
expect(protractor.Key.RETURN).toEqual('\uE006');
});
});