@@ -25,6 +25,16 @@ Use the repository's automation core instead of rediscovering test state manuall
...
@@ -25,6 +25,16 @@ Use the repository's automation core instead of rediscovering test state manuall
```
```
5. Patch Page Objects in `e2e/pages/` before patching tests when the problem is selector or navigation reuse.
5. Patch Page Objects in `e2e/pages/` before patching tests when the problem is selector or navigation reuse.
## Multi-Account Browser Rule
When creating or updating E2E cases that involve more than one logged-in tenant account, use the shared Chrome dual-account fixture instead of switching accounts in one page.
- Add `dual_account_pages` to the pytest function arguments.
- Construct each Page Object with its own page, for example `WanzhangguiOrderPage(wanzhanggui_page, ...)` and `WanyoujiFulfillmentPage(wanyouji_page, ...)`.
- Do not manually launch browsers or create contexts in tests. The fixture routes accounts to one Chrome browser with isolated BrowserContexts/windows and asserts that the contexts are distinct.
- Keep `E2E_DUAL_BROWSER` enabled. It is enabled by default; only single-account tests may opt out.