-
Notifications
You must be signed in to change notification settings - Fork 0
/
todo-spec.js
44 lines (38 loc) · 1.26 KB
/
todo-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
describe('Protractor Demo App', function() {
var size = element(by.model('size'));
var probability = element(by.model('probability'));
var algorithm = element(by.model('algorithm'));
var seed = element(by.model('seed'));
var goButton = element(by.id('gobutton'));
var latestResult = element(by.binding('mark'));
beforeEach(function() {
browser.get('http://localhost:8080');
//browser.get('http://ghostblog-213388.euw1-2.nitrousbox.com:8080/');
});
var algorithmArr = [0, 1, 2, 3, 4];
// var sizeArr = ["medium"];
// var probabilityArr = [[0.1]];
//
var sizeArr = ["small","medium", "large"];
var probabilityArr = [[0.1, 0.44, 0.49], [0.1, 0.2, 0.37], [0.05, 0.1, 0.2]];
// var sizeArr = ["large"];
// var probabilityArr = [[0.05, 0.1, 0.2]];
// var probabilityArr = [[0.05]];
var num;
it("do the test", function() {
for(var s=0; s<sizeArr.length; s++) {
for(var p=0; p<probabilityArr[s].length; p++) {
for(var a=0; a<algorithmArr.length; a++) {
add(algorithmArr[a], sizeArr[s], probabilityArr[s][p]);
}
}
}
});
function add(a, s, p) {
algorithm.sendKeys(a);
size.sendKeys(s);
probability.sendKeys(p);
goButton.click();
expect(latestResult.getText()).toEqual('ok');
}
});