Nils Diewald | a898dac | 2015-05-06 21:04:16 +0000 | [diff] [blame] | 1 | use Mojo::Base -strict; |
| 2 | use lib '../lib', 'lib'; |
| 3 | use Test::More; |
| 4 | use Test::Mojo; |
| 5 | |
| 6 | # Test the documentation |
| 7 | |
| 8 | my $t = Test::Mojo->new('Kalamar'); |
| 9 | |
Akron | ccd71a4 | 2017-06-30 18:09:19 +0200 | [diff] [blame] | 10 | # Embedding |
Nils Diewald | a898dac | 2015-05-06 21:04:16 +0000 | [diff] [blame] | 11 | $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 Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame] | 18 | ->text_is('h1 span', 'KorAP: Poliqarp+') |
| 19 | ->element_exists('li.folded.active') |
| 20 | ->text_is('li.folded.active a', 'Poliqarp+'); |
Nils Diewald | a898dac | 2015-05-06 21:04:16 +0000 | [diff] [blame] | 21 | |
| 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 Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame] | 27 | ->element_exists_not('header') |
| 28 | ->element_exists('li.folded.active') |
| 29 | ->text_is('li.folded.active a', 'Poliqarp+'); |
Nils Diewald | a898dac | 2015-05-06 21:04:16 +0000 | [diff] [blame] | 30 | |
Akron | ccd71a4 | 2017-06-30 18:09:19 +0200 | [diff] [blame] | 31 | # 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 Diewald | a898dac | 2015-05-06 21:04:16 +0000 | [diff] [blame] | 57 | |
| 58 | done_testing(); |