Improved www.ttss.krakow.pl
Jacek Kowalski
2017-04-12 78b244c053dcb72321ee788bb24164a84cd6f377
commit | author | age
15df3c 1 casper.test.begin('Stop name autocompletion', 4, function(test) {
JK 2     casper.start('http://127.0.0.1:8080/', function() {
3         test.assertTitleMatches(/^TTSS\s/, 'Page title: TTSS...');
4     });
5     
6     var autocomplete_pairs = [
7         ['bag', 'Teatr Bagatela'],
8         ['d g', 'Dworzec Główny'],
9         ['świę', 'Plac Wszystkich Świętych'],
10     ];
11     
12     autocomplete_pairs.forEach(function(value) {
13         casper.then(function() {
14             this.sendKeys('#stop-name', value[0], {reset: true});
15         }).wait(200, function() {
16             test.assertSelectorHasText(
17                 '#stop-name-autocomplete > option',
18                 value[1],
19                 'Autocomplete: ' + value[1]
20             );
21         });
22     });
23     
24     casper.run(function() {
25         test.done();
26     });
27 });
28
29 casper.test.begin('Translation engine', 2, function(test) {
30     casper.start('http://127.0.0.1:8080/#!pl', function() {
31         test.assertTitleMatches(/odjazdy/i, 'Page title: ...odjazdy...');
32     });
33     
34     casper.wait(200, function() {
35         test.assertSelectorHasText(
36             '[data-translate=header_lines]',
37             'Linie',
38             'Translation: Lines -> Linie'
39         );
40     });
41     
42     casper.run(function() {
43         test.done();
44     });
45 });