Improved www.ttss.krakow.pl
Jacek Kowalski
2017-04-15 adaa1f628f04a6af247e142edbea679578b90fef
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(
e35419 36             '[data-translate=header_line]',
JK 37             'Linia',
38             'Translation: Line -> Linia'
15df3c 39         );
JK 40     });
41     
42     casper.run(function() {
43         test.done();
44     });
45 });