Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Shopping Cart History / Ledger for Cancellations #74

Open
1 of 2 tasks
eynimeni opened this issue Jun 4, 2024 · 4 comments
Open
1 of 2 tasks

Test Shopping Cart History / Ledger for Cancellations #74

eynimeni opened this issue Jun 4, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@eynimeni
Copy link
Contributor

eynimeni commented Jun 4, 2024

Hello @semteacher

I've made two more video for you because we kindly ask you to write new behat tests in order to check if all values and behaviours of booking and cancellations are executed as intended.

Please create scenarios with different settings, as also mentioned in the video.
You can find the videos here:

https://we.tl/t-YSZyk8BUq7

(We know a bug for users booking & cancelling for themselves, please ignore this for the moment. )

Validation of ledger table in:

  • behat tests
  • phpunit tests
@semteacher semteacher added the enhancement New feature or request label Jun 4, 2024
@semteacher semteacher moved this to Todo in Shopping Cart Jun 4, 2024
@semteacher
Copy link
Collaborator

  1. We already have number of tests for cashier feature. Those tests could be extended to verify statuses (final or intermediate) on the ledger (report) page. It will slightly violate Moodle's approach for behat (1 feature per test) but will significantly save execution time.
  2. Should ledger (report) statuses has to be tested for cashier feature only? Or I can try to add it to other test (where it is possible)?

@eynimeni
Copy link
Contributor Author

Hi @semteacher ,
sorry for the late replay.
It's ok if we add the functionality to existing tests.
So if it hasn't been done yet, please proceed.

semteacher added a commit that referenced this issue Nov 8, 2024
…e when rounding of discounts disabled but consumption enabled (#74)
semteacher added a commit that referenced this issue Nov 8, 2024
@semteacher
Copy link
Collaborator

@eynimeni @georgmaisser
I have added validation of ledger table's data for all behat tests.
Have serious doubts about if it will make sence to do it in the phpunit now:

  • only few phpunit related to this feature already exist (costcenter credits)
  • ledger table has been constructed directly in the report.php. So, I am not sure how to obtain that data in phpunit (cannot make class call). Suppose I can call /local/shopping_cart/report.php using curl - but I will need parse HTML response to validate data... Not sure it will be effective but, definitely, will take time... (Actually - I rather have to create many phpunit tests there 1st)

@eynimeni
Copy link
Contributor Author

Dear @semteacher ,

thank you for your work and comments!
A refactoring of report.php is under construction at the moment, so it makes no sense to write extensive tests for the exisiting one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants