blob: b16e1d97ceb1a2fea8b05d354652e4e1d51bd211 [file] [log] [blame]
Nils Diewalda898dac2015-05-06 21:04:16 +00001use Mojo::Base -strict;
2use lib '../lib', 'lib';
3use Test::More;
4use Test::Mojo;
5
6# Test the documentation
7
8my $t = Test::Mojo->new('Kalamar');
9
Akronccd71a42017-06-30 18:09:19 +020010# Embedding
Nils Diewalda898dac2015-05-06 21:04:16 +000011$t->get_ok('/doc/ql/poliqarp-plus')
12 ->status_is(200)
13 ->text_like('title', qr/poliqarp/i)
14 ->element_exists('aside.active')
15 ->element_exists('main.tutorial')
16 ->element_exists('header')
17 ->element_exists('aside nav')
Nils Diewalda748b0e2015-05-19 22:54:06 +000018 ->text_is('h1 span', 'KorAP: Poliqarp+')
19 ->element_exists('li.folded.active')
20 ->text_is('li.folded.active a', 'Poliqarp+');
Nils Diewalda898dac2015-05-06 21:04:16 +000021
22$t->get_ok('/doc/ql/poliqarp-plus?embedded=true')
23 ->status_is(200)
24 ->text_like('title', qr/poliqarp/i)
25 ->element_exists('aside.active')
26 ->element_exists('main.tutorial')
Nils Diewalda748b0e2015-05-19 22:54:06 +000027 ->element_exists_not('header')
28 ->element_exists('li.folded.active')
29 ->text_is('li.folded.active a', 'Poliqarp+');
Nils Diewalda898dac2015-05-06 21:04:16 +000030
Akronccd71a42017-06-30 18:09:19 +020031# Languages
32$t->get_ok('/' => { 'Accept-Language' => 'de-DE, en-US, en' })
33 ->status_is(200)
34 ->text_is("title", "KorAP - Korpusanalyseplattform der nächsten Generation");
35
36$t->get_ok('/' => { 'Accept-Language' => 'en-US, en, de-DE' })
37 ->status_is(200)
38 ->text_is("title", "KorAP - Corpus Analysis Platform");
39
40
41# Pages
42$t->get_ok('/doc/ql/poliqarp-plus' => { 'Accept-Language' => 'en-US, en, de-DE' })
43 ->status_is(200)
44 ->text_is("title", "KorAP: Poliqarp+")
45 ->text_is('main section > h3', 'Simple Segments');
46
47$t->get_ok('/doc/ql/poliqarp-plus' => { 'Accept-Language' => 'de-DE, en-US, en' })
48 ->status_is(200)
49 ->text_is("title", "KorAP: Poliqarp+")
50 ->text_is('main section > h3', 'Einfache Segmente');
51
52
53$t->get_ok('/doc/ql/annis' => { 'Accept-Language' => 'en-US, en, de-DE' })
54 ->status_is(200)
55 ->text_is("title", "KorAP: Annis QL");
56
Nils Diewalda898dac2015-05-06 21:04:16 +000057
58done_testing();