Improved www.ttss.krakow.pl
Jacek Kowalski
2020-11-03 27187eda97ab63cea0f004f596854cd0e91a4155
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
module.exports = {
    'Stop name autocompletion': function(browser) {
        browser.url('http://127.0.0.1:8080/');
        browser.getTitle(function(title) {
            this.assert.ok(title.includes('TTSS'));
        });
 
        var autocomplete_pairs = [
            ['baga', 'Teatr Bagatela'],
            ['d g', 'Dworzec Główny'],
            ['świę', 'Plac Wszystkich Świętych'],
            ['św g', 'Św. Gertrudy'],
            ['św.g', 'Św. Gertrudy'],
        ];
        autocomplete_pairs.forEach(function(value) {
            browser.clearValue('#stop-name');
            browser.setValue('#stop-name', value[0]);
            browser.pause(200);
            browser.expect.element('#stop-name-autocomplete > option:first-child').to.be.present.before(1000);
            browser.expect.element('#stop-name-autocomplete > option:first-child').text.to.include(value[1]).before(1000);
        });
    },
    'Translation engine': function(browser) {
        browser.url('http://127.0.0.1:8080/#!en');
        browser.pause(200);
        browser.getTitle(function(title) {
            this.assert.ok(title.includes('departures'));
        });
        browser.expect.element('[data-translate=header_line]').text.to.include('Line');
    },
};