Automattic / Automattic/dot-handy

How to smart navigate to `initialPath` when necessary?

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Currently, an action uses `initialPath` property just for checking whether it's time to run the sequence of Playwright script in its function body. It's safe and reasonable when the action depends the previous action to navigate to the right path for it. e.g. the series actions for the signup flow, [pick-free-domain](https://github.com/Automattic/dot-handy/blob/trunk/actions/pick-free-domain.js), [checkout](https://github.com/Automattic/dot-handy/blob/trunk/actions/checkout.js), etc.

However, for cases that we just want to go right in the correct path, we will need to navigate there explicitly. e.g. [close-account](https://github.com/Automattic/dot-handy/blob/trunk/actions/close-account.js) has this line:
```
await page.goto( getRootUrlFromEnv( extra.config.env ) + '/me/account/close' );
```
The downside is that these actions with explicit navigation won't be able to chain with other actions, making them inflexible.

How could we make it smarter when necessary?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the action handling around the `initialPath` property, then compare `actions/pick-free-domain.js`, `actions/checkout.js`, and `actions/close-account.js`. Trace how actions are chained and how Playwright navigation is currently performed. Done should mean the intended navigation behavior is defined for both chained and direct actions, with coverage for the relevant cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, playwright
Domain
testing, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.