33
44context ( 'Function Documentation' , ( ) => {
55 before ( ( ) => {
6- // Creat Index before running test
6+ // Generate function documentation before running tests
7+ cy . timeout ( 10000 ) ;
78 cy . request ( {
8- url : 'http://127.0.0.1:8080/exist/rest/db/ apps/fundocs/modules/reindex.xql ' ,
9+ url : 'http://127.0.0.1:8080/exist/apps/fundocs/regenerate ' ,
910 auth : {
1011 user : 'admin' ,
1112 password : ''
1213 }
1314 } )
14- . its ( 'body' )
15- . should ( 'equal' , '{ "status" : "ok", "message" : "Scan completed! " }' )
15+ . then ( ( response ) => {
16+ expect ( response ) . to . have . property ( 'status' )
17+ expect ( response . status ) . to . equal ( 200 )
18+ expect ( response . body ) . to . have . property ( 'status' )
19+ expect ( response . body . status ) . to . equal ( 'ok' )
20+ } )
21+ // .its('body')
22+ // .should('equal', "{ status: 'ok', message: 'Scan completed! ' }")
1623 } )
1724
1825 beforeEach ( ( ) => {
@@ -34,7 +41,7 @@ context('Function Documentation', () => {
3441 it ( 'should find article with extended markdown contents and code highlighting' , ( ) => {
3542 cy . get ( '#query-field' )
3643 . type ( 'file:sync{enter}' )
37- cy . get ( '.function-head > h4 ' )
44+ cy . get ( '.function-head' )
3845 . should ( 'exist' )
3946 . click ( )
4047 cy . url ( )
@@ -64,7 +71,7 @@ context('Function Documentation', () => {
6471 . click ( )
6572 // check module from fundocs itself
6673 cy . get ( '#modules' )
67- . contains ( 'http://exist-db.org/xquery/docs ' )
74+ . contains ( 'http://exist-db.org/apps/fundocs/generate ' )
6875 . click ( )
6976 cy . get ( '.module' )
7077 . should ( 'exist' )
0 commit comments