Openbravo Issue Tracking System - POS2
View Issue Details
0053548POS2POSpublic2023-09-26 10:382023-10-17 15:05
justin_patterson 
justin_patterson 
normalmajoralways
closedfixed 
5
 
 
No
0053548: Credit Sales tests
Cypress tests were failing in CI due to several discrepancies in data. The broken test has been backed out as has the broken sampledata, but the test should be re-added correctly. The specific problem is a race condition between cache creation and State messages. After the ticket is completed, the customer is updated (the used credit is changed).
This creates a message in the State to trigger the call to the CustomerLoader,
but the test is finished before that message is processed and the POS is reloaded as part of the next test. During that reload, there is a race condition in the creation of the cache because of that pending message, and the cache is corrupted
1) Set up a POS2-modules environment
2) Create a cypress test which completes a ticket but does not asset that the ticket has been completed in the back end
3) Create a test immediately following which searches for a Business Partner
4) The search should fail because the cache should not have been updated correctly
Force any test that completes a ticket to wait before the next test starts.
No tags attached.
blocks defect 0053342 closed andre_montenegro Fix viewOrdersOfCustomer Cypress test failure in CI 
Issue History
2023-09-26 10:38justin_pattersonNew Issue
2023-09-26 10:38justin_pattersonAssigned To => Retail
2023-09-26 10:38justin_pattersonTriggers an Emergency Pack => No
2023-09-26 10:40hgbotNote Added: 0155235
2023-09-28 12:17hgbotNote Added: 0155342
2023-10-03 09:42justin_pattersonDescription Updatedbug_revision_view_page.php?rev_id=26924#r26924
2023-10-03 09:42justin_pattersonProposed Solution updated
2023-10-03 09:46justin_pattersonDescription Updatedbug_revision_view_page.php?rev_id=26925#r26925
2023-10-03 09:46justin_pattersonSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=26927#r26927
2023-10-17 15:01aaroncaleroAssigned ToRetail => justin_patterson
2023-10-17 15:01aaroncaleroStatusnew => scheduled
2023-10-17 15:04hgbotNote Added: 0155952
2023-10-17 15:04hgbotNote Added: 0155953
2023-10-17 15:04hgbotNote Added: 0155954
2023-10-17 15:04hgbotResolutionopen => fixed
2023-10-17 15:04hgbotStatusscheduled => resolved
2023-10-17 15:04hgbotFixed in Version => 24Q1
2023-10-17 15:04hgbotNote Added: 0155955
2023-10-17 15:05aaroncaleroStatusresolved => closed
2023-10-17 15:05aaroncaleroFixed in Version24Q1 =>
2023-10-19 08:29andre_montenegroRelationship addedblocks 0053342

Notes
(0155235)
hgbot   
2023-09-26 10:40   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2117 [^]
(0155342)
hgbot   
2023-09-28 12:17   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.sampledata/-/merge_requests/57 [^]
(0155952)
hgbot   
2023-10-17 15:04   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.sampledata/-/merge_requests/57 [^]
(0155953)
hgbot   
2023-10-17 15:04   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.sampledata [^]
Changeset: 5a7d5eacf8ef0fe59b6d8ce5ffa4eb5d001a4596
Author: Justin Patterson <justin.patterson@openbravo.com>
Date: 17-10-2023 14:41:51
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.sampledata/-/commit/5a7d5eacf8ef0fe59b6d8ce5ffa4eb5d001a4596 [^]

Related to ISSUE-53548: Credit Sales Tests

---
M referencedata/sampledata/The_White_Valley_Group/OBC2_USER_ACTION_ACCESS.xml
---
(0155954)
hgbot   
2023-10-17 15:04   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/2117 [^]
(0155955)
hgbot   
2023-10-17 15:04   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 608ebf74b5ea4b28b65aa2cbe13ea214f31d81ec
Author: Justin Patterson <justin.patterson@openbravo.com>
Date: 17-10-2023 14:41:05
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/608ebf74b5ea4b28b65aa2cbe13ea214f31d81ec [^]

Fixes ISSUE-53548:Credit Sales tests
-Added logic to all tests that complete tickets to wait until ticket is
synchronized with the back office before proceeding to next test
-This fixes the race condition between cache creation and State message
which caused failure in proceeding tests
-Added tests for existence of Sell On Credit button as well as for full
approval flow in case credit minimum not met
-Imported creditSales.spec.js to runFeaturesSpecsPOS2.js
-Moved credit tests from ticket.spec.js to creditSales.spec.js
-Modified CreditSales.json fixture to include data for manual cash amount entry in credit test for prepayments

---
M web-jspack/org.openbravo.pos2/src-test/cypress/e2e/Features/creditSales.spec.js
M web-jspack/org.openbravo.pos2/src-test/cypress/e2e/Features/ticket.spec.js
M web-jspack/org.openbravo.pos2/src-test/cypress/fixtures/e2eFixtures/CreditSales.json
M web-jspack/org.openbravo.pos2/src-test/cypress/runAllSpecs/runFeaturesSpecsPOS2.spec.js
---