Bug 37607

Summary: t/cypress/integration/ERM/DataProviders_spec.ts fails
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: Test SuiteAssignee: Matt Blenkinsop <matt.blenkinsop>
Status: Pushed to oldstable --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, lucas, matt.blenkinsop, paul.derscheid, wainuiwitikapark
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.04,23.11.09
Circulation function:
Bug Depends on: 37288    
Bug Blocks:    
Attachments: Bug 37607: Only default to manual form if we are editing
Bug 37607: Only default to manual form if we are editing

Description Katrin Fischer 2024-08-09 15:19:38 UTC
The test is failing on main and Jenkins/D12:

yarn cypress run --spec t/cypress/integration/ERM/DataProviders_spec.ts

  1 failing

  1) Data provider CRUD operations
       Should add provider:
     CypressError: Timed out retrying after 10000ms: `cy.wait()` timed out waiting `10000ms` for the 1st request to the route: `get-sushi-service`. No request ever occurred.

https://on.cypress.io/wait
      at cypressErr (http://localhost:8081/__cypress/runner/cypress_runner.js:75187:18)
      at Object.errByPath (http://localhost:8081/__cypress/runner/cypress_runner.js:75242:10)
      at checkForXhr (http://localhost:8081/__cypress/runner/cypress_runner.js:134821:84)
      at <unknown> (http://localhost:8081/__cypress/runner/cypress_runner.js:134844:28)
      at tryCatcher (http://localhost:8081/__cypress/runner/cypress_runner.js:1807:23)
      at Promise.attempt.Promise.try (http://localhost:8081/__cypress/runner/cypress_runner.js:4315:29)
      at whenStable (http://localhost:8081/__cypress/runner/cypress_runner.js:143192:68)
      at <unknown> (http://localhost:8081/__cypress/runner/cypress_runner.js:143133:14)
      at tryCatcher (http://localhost:8081/__cypress/runner/cypress_runner.js:1807:23)
      at Promise._settlePromiseFromHandler (http://localhost:8081/__cypress/runner/cypress_runner.js:1519:31)
      at Promise._settlePromise (http://localhost:8081/__cypress/runner/cypress_runner.js:1576:18)
      at Promise._settlePromise0 (http://localhost:8081/__cypress/runner/cypress_runner.js:1621:10)
      at Promise._settlePromises (http://localhost:8081/__cypress/runner/cypress_runner.js:1701:18)
      at Promise._fulfill (http://localhost:8081/__cypress/runner/cypress_runner.js:1645:18)
      at <unknown> (http://localhost:8081/__cypress/runner/cypress_runner.js:5450:46)
  From Your Spec Code:
      at Context.eval (webpack://koha/./t/cypress/integration/ERM/DataProviders_spec.ts:91:11)
Comment 1 Matt Blenkinsop 2024-08-09 16:09:32 UTC
Created attachment 170209 [details] [review]
Bug 37607: Only default to manual form if we are editing

This patch fixes an issue where the form to add a provder would automatically default to the manual form. This patch prevents this behaviour and restores the intended functionality.

Test plan:
1) Don't apply the patch
2) In ERM, click to add a new provider
3) Type something in the provider name search box
4) The input will change from a select to a text input and the button next to it will now say "Create from registry"
5) Apply patch
6) Yarn build and hard refresh the browser
7) Repeat steps 1-3, the form should work as intended and return results in the select box
Comment 2 Paul Derscheid 2024-08-09 16:14:48 UTC
Created attachment 170210 [details] [review]
Bug 37607: Only default to manual form if we are editing

This patch fixes an issue where the form to add a provder would automatically default to the manual form. This patch prevents this behaviour and restores the intended functionality.

Test plan:
1) Don't apply the patch
2) In ERM, click to add a new provider
3) Type something in the provider name search box
4) The input will change from a select to a text input and the button next to it will now say "Create from registry"
5) Apply patch
6) Yarn build and hard refresh the browser
7) Repeat steps 1-3, the form should work as intended and return results in the select box

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 3 Katrin Fischer 2024-08-09 16:49:21 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 4 Lucas Gass (lukeg) 2024-09-11 16:21:36 UTC
Backported to 24.05.x for upcoming 24.05.04
Comment 5 Fridolin Somers 2024-09-25 08:49:11 UTC
Pushed to 23.11.x for 23.11.09
Comment 6 Wainui Witika-Park 2024-09-27 02:27:14 UTC
Not backporting to 23.05.x unless requested