Closed semteacher closed 3 months ago
General workflow improved in https://github.com/Wunderbyte-GmbH/moodle-local_shopping_cart/commit/af6f7b888270203f27e250c0211e2a4917e7f3f1 But in case of Behat tests special "remedy" required at the end of the last test which use credits
## Force credits to 0 to avoid potential issues in other tests
And the following "local_shopping_cart > user credits" exist:
| user | credit | currency |
| user1 | 0 | EUR |
And I log out
The following issue registered for the behat tests:
Analysis show that it caused by:
at this step balance == remainingcredit == 0 but once we tried to set data
by getting data from cache - remainingcredits has been restored to previous value I have tried to fix this way
but it does not work for some reasons...
Potential problem - it could "renew" credits for the same user after being paid back.
Manually I was unable reproduce that case. But I still worried if I missed something during manual tests...
by now - 5 behat tests fails at 1st run because of above issue but than all passed OK during 2nd run...
Temporary decisioin by @georgmaisser: "leave it for now. It's a reminder that we should look into this once again."
PS: I have created a custom step to reset credits cache It works OK and no behat error. But it destroy credit cache explicitly and in test only... So - original issue not solved yet.