Skip to content

V1.4.0 — SAP Ariba Angular form automation + headless resilience

Choose a tag to compare

@lorisunjunbin lorisunjunbin released this 22 Jul 13:29
· 47 commits to master since this release

PETP V1.4.0 — SAP Ariba Angular form automation, plus resilience for headless / background runs.

This release focuses on driving SAP Ariba's Angular Material supplier-registration forms end-to-end in headless mode, and on making silent "green but did nothing" failures observable.

✨ New Selenium processors (SAP Ariba Angular forms)

  • SELECT_YESNO — picks the 是/否 radio of a yes/no md-radio-group, located by a fuzzy label match and selected by visible text (Ariba mislabels both buttons "否"). Accepts 是/否, yes/no, true/false, 1/0.
  • SELECT_TREE_DROPDOWN — cascading tree picker (>-separated 1–4 level path, fuzzy/case-insensitive match, check_from_level to skip a leading "All" root).
  • SELECT_MULTI_DROPDOWN — multi-select checkbox dropdown; find-scroll-check done in a single atomic execute_script to defeat the Angular virtual-scroller's stale-reference / scroll-drift mis-clicks.
  • SELECT_SINGLE_DROPDOWN — type-ahead single select; opens the list, fuzzy-matches the option, clicks once (list self-closes).
  • DATE_PICKER — drives the Angular Material calendar for readonly date inputs that reject send_keys; navigates via the year view and matches the day cell by its locale-independent English aria-label (e.g. July 20, 2026).
  • Form feeders & upload — bank-info / contact-info form feeders and a file-upload processor, built on shared form helpers.

🧰 Shared Selenium helpers (deduplication)

  • SeleniumUtil.click_with_fallback — unified native → move → JS click ladder (Angular Material buttons need native click; JS click as last resort avoids coordinate hit-tests in headless).
  • SeleniumUtil.xpath_literal — single source for xpath string escaping, replacing the copy-pasted _xpath_literal across four processors.

🧭 Failure diagnostics

  • timeout_msg (FIND_THEN_CLICK / FIND_THEN_KEYIN) — an optional business message appended to the raised exception when a locator times out (or a click is intercepted) and skip_timeout_error is no. Supports expressions against data_chain plus the special {timeout} variable, e.g. "Can not find the supplier {supplier_name} in {timeout} seconds." Plumbed cleanly: expression2str gained an extra_locals seam (runtime-only vars layered over data_chain without mutating it), and the message is resolved lazily only on the failure path.
  • [NOOP] soft-skip logging — any step that completes without doing its work (element not found under skip_timeout_error=yes, condition_fn false, intercepted-and-skipped click, iframe switch that never happened) now emits a greppable [NOOP] <Processor>: <reason> warning via Processor.log_noop. Converted across the Ariba processors and feeders.

🌐 Headless / background robustness

  • Per-Execution browser language — GO_TO_PAGE gains browser_lang, so locale-sensitive sites (Ariba) render in the requested language in headless mode. Resolution order: explicit arg → PETP_BROWSER_LANG env → zh-CN. Ignored in headed mode.
  • Iframe switching uses element presence (not Selenium visibility), fixing hangs when switching into iframes in headless mode.
  • portable/ runtime sync — sync_portable.py copies engine + processors + an allowlisted set of executions into the portable unit and pushes the code parts to configured external target dirs (code only; never webdriver / download / log / config).

✅ Tests

New unit tests for expression2str extra_locals, the timeout_msg / log_noop / fail_or_skip helpers, and headless browser_lang resolution.


Full changelog: V1.3.1...V1.4.0