More documentation, clean up tests
diff --git a/t/api-v0.1.t b/t/api-v0.1.t
index 6295421..4d8a560 100644
--- a/t/api-v0.1.t
+++ b/t/api-v0.1.t
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More;
+use Test::More skip_all => 'No remote tests';
use Test::Mojo;
use Mojo::JSON;
use Mojo::ByteStream 'b';
@@ -29,7 +29,8 @@
->status_is(200)
->json_is('/0/managed', Mojo::JSON->true)
->json_is('/0/name', 'Wikipedia')
- ->json_is('/0/description', 'Die freie Enzyklopädie');
+# ->json_is('/0/description', 'Die freie Enzyklopädie')
+ ;
# Get resources - query
$t->get_ok($url->clone->path('query'))
@@ -85,7 +86,6 @@
my $tx = $t->ua->build_tx('TRACE', $url->clone->path('search')->query({ q => 'contains(<s>, [orth=Test])', ql => 'poliqarp'}));
$tx = $t->ua->start($tx);
-#{"@context":"http://ids-mannheim.de/ns/korap/json-ld/v0.1/context.jsonld","query":{"@type":"korap:group","operation":"operation:position","frame":"frame:contains","operands":[{"@type":"korap:span","key":"s"},{"@type":"korap:token","wrap":{"@type":"korap:term","layer":"orth","key":"Test","match":"match:eq"}}]},"collections":[{"@type":"korap:meta-filter","@value":{"@type":"korap:term","@field":"korap:field#corpusID","@value":"WPD"}}],"meta":{}}
$t->tx($tx)
->json_is('/@context', 'http://ids-mannheim.de/ns/KorAP/json-ld/v0.2/context.jsonld')
->json_is('/query/@type', 'korap:group')
@@ -94,10 +94,4 @@
->json_is('/query/operands/0/key', 's')
->status_is(200);
-#$t->get_ok()
-# ->content_is('')
-# ->status_is(200);
-
-
-
done_testing;
diff --git a/t/basic.t b/t/basic.t
index 7511236..7810313 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -6,7 +6,7 @@
my $t = Test::Mojo->new('Kalamar');
$t->get_ok('/')
->status_is(200)
- ->text_is('title', 'KorAP')
- ->text_like('h1 span', qr/Korpusanalyseplattform/i);
+ ->text_is('title', 'KorAP - Corpus Analysis Platform')
+ ->text_is('h1 span', 'KorAP - Corpus Analysis Platform');
done_testing();
diff --git a/t/doc.t b/t/doc.t
index 476d4bf..1b06146 100644
--- a/t/doc.t
+++ b/t/doc.t
@@ -14,14 +14,18 @@
->element_exists('main.tutorial')
->element_exists('header')
->element_exists('aside nav')
- ->content_is('');
+ ->text_is('h1 span', 'KorAP: Poliqarp+')
+ ->element_exists('li.folded.active')
+ ->text_is('li.folded.active a', 'Poliqarp+');
$t->get_ok('/doc/ql/poliqarp-plus?embedded=true')
->status_is(200)
->text_like('title', qr/poliqarp/i)
->element_exists('aside.active')
->element_exists('main.tutorial')
- ->element_exists_not('header');
+ ->element_exists_not('header')
+ ->element_exists('li.folded.active')
+ ->text_is('li.folded.active a', 'Poliqarp+');
done_testing();
diff --git a/t/non-blocking-api.t b/t/non-blocking-api.t
index d4dcc72..d2055e1 100644
--- a/t/non-blocking-api.t
+++ b/t/non-blocking-api.t
@@ -1,7 +1,6 @@
-
use Mojo::Base -strict;
use lib '../lib', 'lib';
-use Test::More;
+use Test::More skip_all => 'No remote tests';
use Test::Mojo;
use Mojo::URL;
use Benchmark qw/:hireswallclock/;
@@ -82,7 +81,7 @@
my $matchtemplate = <<'MATCHTEMPLATE';
<p id="api"><%= search->api %></p>
<p id="api_request"><%= search->api_request %></p>
-<p id="search-result"><%= search->results->first->{docID} %></p>
+<p id="search-result"><%= search->results->first->{docID} . '.' . search->results->first->{textID} %></p>
MATCHTEMPLATE
@@ -92,6 +91,7 @@
$c->search->match(
corpus_id => $c->param('corpus_id'),
doc_id => $c->param('doc_id'),
+ text_id => $c->param('text_id'),
match_id => $c->param('match_id'),
foundry => '*',
sub {
@@ -163,11 +163,11 @@
->status_is(200)
->text_is('#search-resource', 'Wikipedia');
-
# http://10.0.10.14:6666/corpus/WPD/WWW.04738/p265-266
$t->get_ok(Mojo::URL->new('/matchinfo')->query({
corpus_id => 'WPD',
- doc_id => 'WWW.04738',
+ doc_id => 'WWW',
+ text_id => '04738',
match_id => 'p265-266'
}))
->status_is(200)
diff --git a/t/remote.t b/t/remote.t
index e08bba2..30156ea 100644
--- a/t/remote.t
+++ b/t/remote.t
@@ -1,32 +1,29 @@
use Mojo::Base -strict;
use lib '../lib', 'lib';
-use Test::More;
+use Test::More skip_all => 'No remote tests';
use Test::Mojo;
my $t = Test::Mojo->new('Kalamar');
$t->get_ok('/')
->status_is(200)
- ->text_is('title', 'KorAP')
- ->text_like('h1 span', qr/Korpusanalyseplattform/i)
+ ->text_is('title', 'KorAP - Corpus Analysis Platform')
+ ->text_like('h1 span', qr/KorAP - Corpus Analysis Platform/i)
;
# Check paging
$t->get_ok('/?q=test')
- ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"')
- ->text_like('#total-results', qr/\d+ matches$/)
- ->element_exists('[title=Alignment]')
+ ->text_like('h1 span', qr/KorAP: Find "test"/i)
+ # ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"')
+ ->text_like('#total-results', qr/\d+$/)
->text_is('#pagination a[rel=self] span', 1)
;
# Check paging
$t->get_ok('/?q=test&p=2')
- ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"')
- ->text_like('#total-results', qr/\d+ matches$/)
+ # ->text_is('pre.query.serial span', 'JSON-LD Serialization for "test"')
+ ->text_like('#total-results', qr/\d+$/)
->text_is('#pagination a[rel=self] span', 2)
;
-# $t->get_ok('/tutorial?testing=1')
-# ->text_like('div.test p.pass', qr/Pass: [1-9]/)
-# ;
-
-done_testing();
+done_testing;
+__END__