Skip to content

v1.4.1 — Exact POM imports & factory-function extraction

Choose a tag to compare

@cport1 cport1 released this 16 Apr 16:47
· 11 commits to main since this release

What changed

Fixes the two issues Sravya reported from PR #3347:

1. Class name mismatch in imports

The LLM was renaming POM classes in imports — e.g., import { Investigations } instead of import { InvestigationsPage }. The prompt now shows exact, copy-pasteable import statements:

Before (v1.4.0):

### InvestigationsPage (from '../../pages/investigations/investigations.po')
Methods: goto(), ...

After (v1.4.1):

### InvestigationsPage
`import { InvestigationsPage } from '../../pages/investigations/investigations.po';`
Methods: goto(), ...

The IMPORTANT section now explicitly says: "Copy the import statements EXACTLY as shown — do NOT rename, abbreviate, or alias class names."

2. Factory-function element groups

The InvestigationsPage POM uses a pattern where element groups are factory functions:

elements = {
  getSummaryElements: () => {
    const getSelectStatus = (): Locator => this.page.getByTestId('status-btn');
    return { getSelectStatus };
  },
}

The scanner now extracts these with qualified names like getSummaryElements().getSelectStatus, so the LLM knows both the group accessor and the individual locators inside it.

Also extracts nested object locators: v3Elements.getDashboardGrid for v3Elements: { getDashboardGrid: (): Locator => ... }.