When I move focus to "fieldLabel" field

Resolve a form field by label → placeholder → role=textbox → [name]/#id.
Uses Playwright's ready-made semantic locators (getByLabel, getByPlaceholder,
getByRole) with .or() fallbacks — matches the accessibility-first lookup
chain recommended by https://playwright.dev/docs/locators.
/
function resolveField(page, field) {
return page.getByLabel(field).or(
page.getByPlaceholder(field)
).or(
page.getByRole('textbox', { name: field })
).or(
page.locator([name="${field}"], #${field})
).first();
}

/**
Move keyboard focus to a field by label, name, or id.

Step pattern

When (I |we )*move focus to "([^"]*)" field

Examples

Example #1
When I move focus to "Title" field
Example #2
When I move focus to "Body" field
Example #3
When I move focus to "Email" field
Example #4
When I move focus to "Search" field
Example #5
When I move focus to "Username" field
Example #6
When I move focus to "Password" field
Example #7
When I move focus to "First name" field
Example #8
When I move focus to "Last name" field
Example #9
When I move focus to "Description" field
Example #10
When I move focus to "Phone" field