Skip to content

[ADD] website_sale_hide_all_prices: characterization tests - #529

Open
fw-bot-adhoc wants to merge 1 commit into
ingadhoc:20.0from
adhoc-dev:20.0-19.0-t-76641-loa-10630-fw
Open

fw-bot-adhoc wants to merge 1 commit into
ingadhoc:20.0from
adhoc-dev:20.0-19.0-t-76641-loa-10630-fw

Conversation

@fw-bot-adhoc

Copy link
Copy Markdown

Characterization tests for website_sale_hide_all_prices in 19.0. They are the regression net for the migration to 20.0. The module code is not changed.

Tarea: https://www.adhoc.inc/odoo/project.task/76641

What is covered

Every scenario runs with the setting on and off, so each check also proves it looks at the right place.

  • Payment mail (test_payment_mail.py): the order notification mail is not sent while prices are hidden.
  • Hidden prices (test_hidden_prices.py): shop grid, product page, comparison page, cart, checkout summary (delivery form hidden), the website_hide_all_prices flag in the frontend session, and the wishlist.
  • Quotation checkout (test_quotation_checkout.py):
    • /shop/request_quotation leaves the cart as a draft quotation without transaction, resets the session cart and redirects to /request-quotation;
    • /shop/confirmation sends back to it;
    • with the setting off, checkout keeps the payment step;
    • the address form: an invalid address keeps the native error, and a valid one ends in the quotation request.

Evidence

  • Green: --test-tags /website_sale_hide_all_prices: 0 failed, 0 error(s) of 5 tests (11 subtests), about 7.4 s.
  • Red: each protected code path was broken on purpose and the expected assert failed (11 breaks), for example:
    • without the mail return: 1 != 0;
    • without the address-submit rewrite: '/shop/checkout?try_skip_step=true' != '/request-quotation';
    • without the delivery form rule: 'd-none' not found.
  • No fixed dates. pre-commit is clean.
  • Size: +225 lines in 5 files, against 239 lines of module Python.

Declared, not tested

  • What the JS hides on its own (configurator price badges, the "added to cart" notification, the comparison row) needs a tour.
  • A batch that mixes orders from a website with the setting on and orders without it: the mail is skipped for the whole batch. That is a bug, and it will be fixed apart.

Finding

With the setting on, some prices stay in the HTML and are only hidden with d-none: the wishlist price, the delivery form and the payment status. The tests lock that 19.0 behavior as it is.

Forward-Port-Of: #521

Cover how 'hide all prices' behaves in 19, with the setting on and off:
the payment mail is not sent, no shop page shows the product price (grid,
product page, comparison, cart, checkout and wishlist), the frontend
session gets the flag, and checkout ends in a quotation request instead
of a payment, also from the address form.

X-original-commit: a3485d3
@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@fw-bot-adhoc

Copy link
Copy Markdown
Author

@ALopez-Adhoc @augusto-weiss this PR targets 20.0 and is the last of the forward-port chain.

To merge the full chain, use

@roboadhoc r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@fw-bot-adhoc

Copy link
Copy Markdown
Author

@ALopez-Adhoc @augusto-weiss this forward port of #521 is awaiting action (not merged or closed).

2 similar comments
@fw-bot-adhoc

Copy link
Copy Markdown
Author

@ALopez-Adhoc @augusto-weiss this forward port of #521 is awaiting action (not merged or closed).

@fw-bot-adhoc

Copy link
Copy Markdown
Author

@ALopez-Adhoc @augusto-weiss this forward port of #521 is awaiting action (not merged or closed).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants