Skip to content

e2e: hoist login/installApp/reloadBackend into helpers.ts and harden shared assertions #531

Description

@gonzalesedwin1123

The three Playwright specs under e2e/tests/ each carry their own near-verbatim copy of login() and installApp() (01-spp-starter-spmis.spec.ts, 02-spp-starter-farmer-registry.spec.ts, 03-spp-dci-compliance.spec.ts; spec 03 also adds reloadBackend()). Spec 01's login() additionally handles Odoo's avatar picker that appears once two accounts have logged in. A fourth spec would mean a fourth copy.

Proposed:

  • Move login, installApp and reloadBackend next to resetStack() in e2e/tests/helpers.ts, keeping spec 01's avatar-picker handling as the single implementation.
  • Fix the comment in installApp ("Remove all preset filter chips (there are two by default)") which contradicts the single .click() the code performs; Playwright strict mode would throw if two matched.
  • Reuse the pageerror collector introduced in spec 03 (uncaught errors during webclient mount) in the other two specs; it is the assertion that catches a component throwing at setup() (useService("rpc") no longer exists on Odoo 19 - latent crash in spp_change_request_v2 review panel and spp_dci_compliance security warning #450), which a blank page otherwise hides.
  • Spec 02 predates the "Adding new tests" rule in e2e/README.md and lacks the header comment block; add it.
  • Optional coverage for spec 03: the zero-warning path (turn the last two settings off, assert the item disappears) and clicking "View DCI Settings" to assert the System Parameters list opens with the dci.* rows.

Refs: #442 (e2e suite), #527 (spec 03).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions