From b8419cd1a3ad66b41dfa36e9723c64a5537529b9 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Wed, 8 Nov 2023 14:30:04 +0000 Subject: [PATCH] some slight improvements to notes search functional tests --- .../administrative_search/journals.yml | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/doajtest/testbook/administrative_search/journals.yml b/doajtest/testbook/administrative_search/journals.yml index 0d11716340..03b6e4123b 100644 --- a/doajtest/testbook/administrative_search/journals.yml +++ b/doajtest/testbook/administrative_search/journals.yml @@ -134,23 +134,31 @@ 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 @@ -158,10 +166,13 @@ tests: 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: @@ -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: /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: /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