Use Cypress UI interactions when a test needs to prove what a person can do; use an application action or small helper when you only need to establish test state. Cypress currently discourages shared page objects, but that is guidance for Cypress test organization—not a universal rule that every UI helper is harmful.
What is the difference?
A page object typically packages selectors and UI interactions behind an API shaped around a page or component. A test might call a page object’s login method, for example, rather than express each field and click inline.
As an Amazon Associate I earn from qualifying purchases.
An application action changes state through application logic rather than by reproducing the user interface. It can set up a logged-in user or create records needed by a test. More broadly, a small Cypress command or ordinary function can encapsulate repeated setup without becoming a page-shaped abstraction.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →How Cypress recommends organizing tests
Cypress’s current best-practices guidance lists sharing page objects, using the UI to log in, and not taking shortcuts as an anti-pattern. It recommends isolated tests, programmatic login where appropriate, and organizing specs around features and user flows rather than mirroring the application’s page hierarchy.
#1 Best Overall
This is an opinionated Cypress recommendation, not proof that all page-object patterns fail or that no focused UI helper can be useful. The practical concern is whether an abstraction hides the behavior a test is meant to verify or makes changes harder to trace.
Choose based on what the test claims
| Question | Page object or UI helper | Application action or setup helper |
|---|---|---|
| What does it control? | Usually selectors and interactions with a page or component. | Application model/API behavior, or a narrowly scoped Cypress command or function. |
| When does it fit? | When the UI behavior itself is part of the claim being tested. | When establishing preconditions that the test is not intended to validate. |
| What can it couple the test to? | Selectors and UI structure; use resilient data-* selectors for UI tests. |
The application’s internal interface, which is not the same as verifying its public UI route. |
| What is the main risk? | A large abstraction can obscure the steps and intent of a test. | Direct state changes can get ahead of application processing or bypass behavior that needs UI coverage. |
Drive the UI for user-visible behavior
If the assertion is that a person can complete a flow, perform that flow through the interface and assert its visible result. Keep enough of the real journey in the test to exercise the intended integration; a shortcut that prepares the starting state does not prove the remaining UI works.
Rank #2
Use shortcuts for setup
If logging in or creating records is merely repeated setup, programmatic setup, cy.request(), or an application action may be more suitable than replaying the UI in every test. Cypress’s recommendation to log in programmatically is an example of avoiding irrelevant repeated setup, not a direction to bypass all interfaces.
Keep the helper proportional
If behavior is useful across tests, a small custom command can be appropriate. If reuse is limited to one spec, a regular function—or inline steps—may be clearer. Keep the outcome assertion near the test that states the expected behavior rather than burying many actions and assertions inside a generalized helper.
Rank #3
Custom commands: a useful middle ground
Cypress supports custom commands for behavior desirable across tests, such as application setup or login, while cautioning against turning everything into a command. Its custom-command guidance favors commands that are composable and unopinionated, with few built-in assertions; it says calling code should choose when and how to assert. Simple local reuse can remain a normal function.
For commands shared across specs, Cypress documents placing them in the support file; see Writing and organizing Cypress tests. Keep the command’s responsibility narrow enough that readers can still see what the test sets up and what it verifies.
Rank #4
Synchronize application actions with observable results
Direct application calls can return before the application has finished processing the change. Gleb Bahmutov’s January 3, 2019 article on application actions recommends observing a consequence such as a DOM update, network traffic, or a method call rather than assuming the action is complete immediately.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesSome operations may not be available through an application method; in those cases, a request-based setup path or another supported mechanism may be needed. Choose a synchronization point that corresponds to the state the next test step actually needs.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Performance: treat published examples as examples
In the same 2019 article, Bahmutov reported one local TodoMVC example running in 17 seconds with application actions versus 34 seconds through the UI, using Cypress’s Electron browser. That is a single author’s result for a simple local example, not a general benchmark or a promise that app actions will halve another suite’s runtime. The choice should primarily follow test intent and clarity.
A practical decision checklist
- The claim is about user experience: drive the relevant UI and assert the visible outcome.
- The operation is only a precondition: consider programmatic setup,
cy.request(), or an application action the app supports. - Many specs need the same behavior: consider a small, composable custom command.
- Only one spec needs it: use a regular function or keep the steps local.
- The test targets UI: use stable
data-*selectors and retain enough real user flow to validate the intended integration. - A helper is growing: move assertions and behavior-specific decisions back toward the test so its intent remains legible.
Or skip the browser setup
For capturing website screenshots—not structuring Cypress tests—ScreenshotNeo offers a one-request screenshot API. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. It also provides an MCP server for AI agents, with tools including take_screenshot, get_page_info, and capture_pdf.
Example cURL request, with the API key supplied by you:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for the free plan.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




