Skip to content

Commit

Permalink
some slight improvements to notes search functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-jones committed Nov 8, 2023
1 parent 844f590 commit b8419cd
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions doajtest/testbook/administrative_search/journals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,34 +134,45 @@ tests:
results:
- A new browser window opens containing the edit form for the journal
- step: Click "Unlock and Close"

- title: Test notes searchable for admin and not for public
context:
role: admin
steps:
- step: In the admin search, select Journal search, search for a journal and click on the "Edit Journal" button to edit the journal
path: /admin
results:
- The journal edit form is displayed
- step: Add a note to a journal record by clicking on the "Add" button in the "Notes" section of the journal record and click on "save" button to save the new note
- step: Add a note to a journal record by clicking on the "Add" button in the "Notes" section of the journal record. Add a distinctive note
whose text is unlikely to appear in a journal title or other metadata. Then click on "save" button to save the new note
results:
- The note is added to the journal record
- step: Go to the admin journal search again and search for the journal you added the note with the words given in the note
path: /admin
results:
- The journal record is displayed in the search results
- step: Search for the journal from public search page with same words given in the note
- step: Search for the journal from public search page with the distinctive words from the note
path: /search/journals
results:
- The journal record is not displayed in the search results
- step: Search for the journal from api search with same words given in the note
- step: Go to the API documentation page
path: /api/docs
- step: Scroll to the section "Search" > "Search journals" and click on the row to expand it.
- step: in the section "search_query" enter the distinctive words from the note you created, then click on the "Try it Out!" button at the bottom of the section
results:
- The journal record is not displayed in the search results

- title: Test notes not searchable for public
context:
role: anonymous
steps:
- step: Search for the keyword which is given in a notes.
- step: go to the public journal search
path: /search/journals
- step: Search for the distinctive word you entered into a note in the previous test.
results: No results displayed
- step: Modify the search url to add the notes keyword and the default field 'admin.notes.note' and then hit the url
results: Error message displayed
- step: Modify the search url in the following way. Add the text '%2C"default_field"%3A"admin.notes.note"' in the URL bar immediately after where it says '"default_operator"%3A"AND"'.
This is to attempt to trick the public search into allowing you to search on notes.
results: An error message displayed

- title: Test notes searchable for Editor
context:
Expand Down Expand Up @@ -198,11 +209,11 @@ tests:
- step: Search for the keyword which is given in a notes in an application
results: The application is displayed in the search results

- title: Test notes not searchable for public journal,article
- title: Test notes not searchable for fixed query widget (joint journal/article search)
context:
role: anonymous
steps:
- step: Do a url search for the keyword which is given in a notes for journal,article index. Ex: <host url>/query/journal,article/_search?&source={"query":{"query_string":{"query":"Test Note","default_operator":"AND"}},"size":"20"}&ref=fqw
- step: 'Do a url search for the keyword which is given in a notes for journal,article index. Ex: <host url>/query/journal,article/_search?&source={"query":{"query_string":{"query":"Test Note","default_operator":"AND"}},"size":"20"}&ref=fqw'
results: No results displayed
- step: Modify the search url to add the notes keyword and the default field 'admin.notes.note' and then hit the url
results: Error message displayed

0 comments on commit b8419cd

Please sign in to comment.