Skip to content

feat: enrich DSL with rich ElementSelector and new Maestro features#1

Open
RamboWasReal wants to merge 2 commits into
mainfrom
feat/improve-maestro-integration-audit
Open

feat: enrich DSL with rich ElementSelector and new Maestro features#1
RamboWasReal wants to merge 2 commits into
mainfrom
feat/improve-maestro-integration-audit

Conversation

@RamboWasReal

Copy link
Copy Markdown
Owner

Summary

This PR implements the main improvements identified in the recent audit of react-native-preflight for simplifying usage and integrating new Maestro capabilities.

Changes

Rich Element Selectors

  • tap, see, notSee, longPress, doubleTap, copyTextFrom now accept full ElementSelector objects:
see({ id: 'submit', text: 'Valider', enabled: true, below: 'Titre' })
tap({ point: '50%, 50%' })

New Test Primitives

  • doubleTap(selector)
  • eraseText(count?)
  • pressKey(key)
  • extendedWaitUntil({ visible?, notVisible?, timeout? })
  • assertTrue(condition)
  • setLocation(lat, lng)
  • copyTextFrom(selector) / pasteText() / setClipboard(text)
  • assertScreenshot(nameOrOptions) (native Maestro visual regression with cropOn and thresholdPercentage)

launchApp Options

launchOptions: {
  clearState: true,
  permissions: { notifications: 'allow' },
  stopApp: true,
}

Other

  • Full support in YAML generator (scanner + emitter)
  • Updated README with new capabilities
  • 100% backward compatible

Verification

  • All tests pass (yarn test, yarn test:cli, yarn test:babel)
  • TypeScript clean

This addresses the key findings from the audit regarding richer Maestro integration and reducing the need for raw().

…tives

- Add ElementSelector with support for id/text/relative/enabled/etc
- Update TestStep + testHelpers (tap/see/longPress/doubleTap + eraseText, pressKey, extendedWaitUntil, assertTrue, setLocation, copy/paste/setClipboard, assertScreenshot)
- Rich emission in stepToYaml
- Support launchOptions on ScenarioConfig (clearState, permissions, stopApp...)
- Native assertScreenshot + cropOn support
- Updated scanner and README
…tractTextWithAI)

- New helpers powered by LLM for visual + text assertions
- assertWithAI("description of what should be visible")
- assertNoDefectsWithAI() for quick visual smoke checks
- extractTextWithAI(query) to pull text via vision model
- Full support in scanner and YAML emitter
- Documented in README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant