Improved www.ttss.krakow.pl
Jacek Kowalski
2018-06-03 fc8d60517033c7de6115d9d56bb43a8a7b279a3f
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) {
9e9b25 30     casper.start('http://127.0.0.1:8080/#!en', function() {
JK 31         test.assertTitleMatches(/departures/i, 'Page title: ...departures...');
15df3c 32     });
JK 33     
34     casper.wait(200, function() {
35         test.assertSelectorHasText(
e35419 36             '[data-translate=header_line]',
9e9b25 37             'Line',
JK 38             'Translation: Linia -> Line'
15df3c 39         );
JK 40     });
41     
42     casper.run(function() {
43         test.done();
44     });
45 });