The Problem: Timeouts and Masked Failures
The item-selection step waited for the autocomplete options to become visible and timed out. Playwright reported the option elements as present in the DOM but hidden, even though the correct text had been entered. A silent fallback also pressed Enter whenever that wait failed, so some runs carried on without proving that the intended item had been selected.
Investigation Process
- Step 1 — Read the failure: The timeout output showed the option element resolving repeatedly as hidden
- Step 2 — Inspect the page: The options were in the DOM with
aria-selectedset, but hidden by CSS - Step 3 — Compare interaction methods:
fill()sets the value without firing key events;type()and key presses do - Step 4 — Check the framework behavior: Frappe's autocomplete (Awesomplete) reveals its dropdown in response to keyboard input events
- Step 5 — Review the test code: A try/catch fallback pressed Enter when the visibility wait failed, hiding the failure
- Step 6 — Root cause: The test's interaction did not match how the autocomplete works, and error suppression hid the consequences
Solution: Targeted Fix in the Item-Selection Step
The fix changed how the test interacts with the autocomplete when selecting an item:
- Type the search text key by key with a 50 ms delay (the repository calls
locator.type()), so the autocomplete receives real key events - Wait for the listbox with a Locator (
locator.waitFor({ state: 'attached' })) rather than for it to be visible, because the options can be hidden by CSS - Select the option with ArrowDown and Enter, as a user would
- Remove the silent fallback, so a failed selection surfaces as a failure
What I would change next: locator.type() is deprecated in current Playwright in favour of
locator.pressSequentially(), and the step still ends with a fixed 500 ms pause
(waitForTimeout) instead of a web-first assertion such as
expect(cell).toHaveText(...) on the selected item. I have not changed the repository code: the hosted
instance is offline, so I cannot re-run the suite to confirm a change is safe.
Outcome and Limits
After the change, the suite passed in GitHub Actions (five successful runs on 4 September 2026), and the repository's execution report records repeated passing local and CI runs.
Limits: This fix covers the item-selection step. Customer-field selection in the Quotation and Sales Order page objects uses a different pattern and was not part of this investigation. GitHub Actions logs are not viewable without a GitHub sign-in, and CI is configured with retries, so a passing run does not by itself show that no test needed one. The hosted ERPNext test instance the suite runs against is no longer available (checked 22 October 2026; the latest run, #7, failed for that reason), so the suite cannot be re-run today and the last green result is historical.