Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 1 | use Mojo::Base -strict; |
| 2 | use lib '../lib', 'lib'; |
Nils Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame^] | 3 | use Test::More skip_all => 'No remote tests'; |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 4 | use Test::Mojo; |
| 5 | |
Nils Diewald | 2fe12e1 | 2015-03-06 16:47:06 +0000 | [diff] [blame] | 6 | my $t = Test::Mojo->new('Kalamar'); |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 7 | $t->get_ok('/') |
| 8 | ->status_is(200) |
Nils Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame^] | 9 | ->text_is('title', 'KorAP - Corpus Analysis Platform') |
| 10 | ->text_like('h1 span', qr/KorAP - Corpus Analysis Platform/i) |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 11 | ; |
| 12 | |
| 13 | # Check paging |
| 14 | $t->get_ok('/?q=test') |
Nils Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame^] | 15 | ->text_like('h1 span', qr/KorAP: Find "test"/i) |
| 16 | # ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"') |
| 17 | ->text_like('#total-results', qr/\d+$/) |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 18 | ->text_is('#pagination a[rel=self] span', 1) |
| 19 | ; |
| 20 | |
| 21 | # Check paging |
| 22 | $t->get_ok('/?q=test&p=2') |
Nils Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame^] | 23 | # ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"') |
| 24 | ->text_like('#total-results', qr/\d+$/) |
Nils Diewald | 034ea70 | 2015-01-16 19:41:52 +0000 | [diff] [blame] | 25 | ->text_is('#pagination a[rel=self] span', 2) |
| 26 | ; |
| 27 | |
Nils Diewald | a748b0e | 2015-05-19 22:54:06 +0000 | [diff] [blame^] | 28 | done_testing; |
| 29 | __END__ |