Remix.run Logo
littlecranky67 2 days ago

I assume you do not use TypeScript but JavaScript? With TS your POs are basically discoverable with source-code completion and statically typed.

   await page.getStartedLink.click()
   expect(page.installationHeadline).toBeVisible()
Is much more readable, and on typing "page." you will see what props on your PO are available.

Another note on your specific example: You are probably in the US and only have a single-language project. I am a Frontend Contractor in Europe and for the past 10 years didn't have a single project that was single language, hence the "hasText" selector would always be off-limits. Instead, very often we used the react-intl identificator as text content for code execution - which would make the above example look much more unreadable without POs, while with POs the code looks the same (just your PO looks different).