Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can use Cypress to test an Ionic app’s browser-rendered interface, including mobile-sized layouts and web user journeys. Start the app with ionic serve, point Cypress at the local server, and write end-to-end tests for the flows that matter. Cypress does not run a shipped native iOS or Android app: use native-device testing as well when a feature depends on hardware, a native plugin, or platform runtime behavior.

What Cypress can—and cannot—test in an Ionic app

Cypress runs tests in a browser. That makes it useful for Ionic’s web UI: navigation, forms, overlays, responsive layouts, and other browser-rendered behavior. Cypress describes its mobile-app support this way: “Cypress will never be able to run on a native mobile app, but we can test some functionality of mobile web browsers and test mobile applications that are developed in a browser, such as with the Ionic framework.” Cypress FAQ

  • Use Cypress E2E tests for user journeys through the running Ionic app.
  • Use Cypress component tests to mount a component in a real browser and test its states and behavior in isolation.
  • Use native execution as well for camera access, fingerprint authentication, native plugin integration, device-specific behavior, or platform performance and security concerns.

A browser viewport set to phone dimensions checks responsive presentation; it is not a physical phone or native WebView test.

How to test an Ionic app with Cypress

1. Start the Ionic development server

From the project directory, run:

ionic serve

The Ionic CLI starts a local server for browser development and testing and watches for file changes. Check the current Ionic serve options for project-appropriate settings such as host, browser, HTTPS, or configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Yojaro 4Pack Silicone Suction Phone Case Mount, Silicon Adhesive Smartphones Stand Sticky, Hands-Free Phone Accessories Holder for Selfies and Videos (Black & White & Translucent & Light Pink)
  • 【Strong Adsorption】The inspiration of the silicone phone suction case comes from the adhesive force of the octopus. Each suction cup phone mount is 3.15 inches long and 2.17 inches wide, with 24 independent suction cups providing a stronger and more stable suction force, so you don't have to worry about your phone falling during use.
  • 【Back of Phone Suction Grip】Remove the adhesive film on the phone suction cup and stick it on the phone case. You can then fix the phone on any smooth surface, which is very convenient. (The phone suction cup cannot be removed and reused after being attached to the phone case. It is recommended to attach it to a regular phone case, not a valuable one.)
  • 【Widely Used】Our non-slip silicone phone sticky grip mount attaches to almost any flat phone case and make it compatible with common mobile phones such as iPhone and Android.You can shoot, watch videos or video calls in the kitchen, gym, dance studio, bathroom and other places.
  • 【Capture the Wonderful Picture】Whether you are a TikTok creator or just like to share videos and photos, this phone suction cup can help you hands-free capture wonderful videos and photos for sharing with friends.
  • 【Note】You can fix the phone suction cup on a smooth surface such as a mirror or glass. If necessary, wipe the suction cup with a damp cloth to obtain stronger suction. Before releasing your hand, make sure the phone is firmly fixed. (Not applicable to rough walls, wooden surfaces, and other uneven surfaces)

2. Install and open Cypress

Follow Cypress’s current installation instructions to add Cypress as a development dependency, then open it. The Launchpad guides you through setting up E2E or component testing. For E2E tests, the application server should be running before Cypress visits the app.

3. Configure the app URL and visit it

Set the app’s local address as the Cypress base URL using the configuration format supported by your installed Cypress version. Then visit the application in a spec:

describe('Ionic app', () => {
  it('opens the home screen', () => {
    cy.visit('/');
    cy.contains('Home').should('be.visible');
  });
});

The Ionic and Cypress tutorial shows the basic idea, but it dates from July 8, 2020 and uses an older cypress.json configuration pattern. Use it for the testing concepts, not as a current configuration file to copy verbatim.

Rank #2
Apple EarPods Headphones with USB-C Plug, Wired Ear Buds with Built-in Remote to Control Music, Phone Calls, and Volume
  • SUPERIOR COMFORT — Unlike traditional circular ear buds, the design of EarPods is defined by the geometry of the ear. Which makes them more comfortable for more people than any other ear bud–style headphones.
  • HIGH-QUALITY AUDIO — The speakers inside EarPods have been engineered to maximize sound output and minimize sound loss, which means you get high-quality audio.
  • BUILT-IN REMOTE — EarPods with USB-C plug also include a built-in remote that lets you adjust the volume, control the playback of music and video, and answer or end calls with a pinch of the cord.
  • COMPATIBILITY — Works with all devices that have a USB-C port.
  • INTEGRATED MICROPHONE — A built-in microphone precisely captures your voice while you’re on the phone, taking a FaceTime call, or summoning Siri — so you’re always heard loud and clear.

4. Set a mobile-sized viewport

Set viewport dimensions globally in Cypress configuration or per test with cy.viewport(). For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
it('shows the mobile layout', () => {
  cy.viewport(390, 844);
  cy.visit('/');
  cy.get('[data-cy="mobile-menu"]').should('be.visible');
});

Choose dimensions relevant to the layouts your application supports. Cypress also accepts named device presets; consult the cy.viewport() API for current options. A preset or width-and-height pair changes the browser viewport only—it does not test native touch input or guarantee behavior on a particular device.

5. Make the starting state predictable

Tests are easier to trust when they do not depend on leftovers from a previous run. Control the state your app uses for onboarding, authentication, or preferences before visiting the screen. The Ionic example sets a tutorial flag in Ionic Storage and includes commands to show or skip onboarding; that key is specific to its sample app. Adapt the setup to your own storage and architecture rather than assuming the same key exists.

Rank #3
PopSockets Adhesive Phone Grip, Holder- Black
  • Secure Hold: Our PopSockets adhesive phone grip gives your cell phone a secure, comfortable hold in hand to help prevent drops while texting, taking photos, or scrolling on the go. Designed to stick firmly to most phone cases and devices.
  • Hands-Free Made Easy: Easily turn your PopSocket into a phone stand to prop up your phone anywhere, perfect for watching videos, video calls, or following recipes. A must-have phone holder that keeps your device secure and ready for anything.
  • Compatibility: Works with all phones, tablets, and Kindles. Sticks best to smooth, hard plastic cases and may not adhere to silicone or textured cases. Easily swap your PopTop to change up your style.
  • Black PopSockets: Simple, refined, and endlessly versatile. A timeless essential for any phone.
  • Travel Must-Have for People On the Go: A must-have travel accessory for flights, flying, airports, air travel, airplanes, planes, international trips, cruises, and long travel days. Key gadget for your airport haul, travel accessories and must-haves.

Where possible, expose stable selectors such as data-cy attributes. Assert user-visible outcomes after an action—for example, that a page, favorite state, or message appears—instead of treating a successful click as proof the feature worked.

6. Cover representative user journeys

Prioritize the flows that cross meaningful parts of the app: onboarding, navigation, searching, saving an item, and changing a theme are examples shown in the Ionic tutorial. Keep each test focused on observable behavior and reset any state that would otherwise make the result order-dependent.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to test swipes in Cypress

For a browser-side interaction path, Cypress can dispatch mouse events through a custom command. The Ionic tutorial selects the active slide, triggers mousedown, mousemove, and mouseup, and invokes the command to advance the onboarding flow. Cypress also notes in its FAQ that swiping can be mimicked with custom commands.

Rank #4
360° Rotating Stainless Steel Phone Tether Tab (Silvery 3-Pack) - Universal for iPhone & Other Phones (Fits Wristbands/Necklaces/Crossbody Straps)
  • [360 ° Flexible Rotation Design] Comes with a rotatable lanyard ring that supports 360 ° free rotation, effectively solving the problem of twisted and tangled lanyards
  • [Wide compatibility] The ultra-thin 0.02-inch design does not block the charging port at all, and both wired and wireless charging can be used directly without removing the pad. Compatible with most smartphones such as iPhone, compatible with various wristbands, lanyards, crossbody straps, and keychains
  • [Durable and Portable Material] Premium rust-resistant stainless steel material with good flexibility, which not only avoids scratching the phone case, but also has excellent anti rust and anti fading performance
  • [Multi scenario Practical] Paired with a lanyard or wristband, hands-free use can be achieved. The phone is within reach and not easily dropped, ideal for daily commuting and outdoor activities. Suitable for full coverage phone cases, does not support half coverage phone cases
  • [Quality Service] If you find any damage or other issues with the product upon receipt, please contact us immediately. We will handle it quickly
// Illustrative browser-event pattern; adapt the selector and coordinates
// to the app's own component and interaction behavior.
Cypress.Commands.add('swipeLeft', (selector) => {
  cy.get(selector)
    .trigger('mousedown', { which: 1, pageX: 300, pageY: 200 })
    .trigger('mousemove', { which: 1, pageX: 100, pageY: 200 })
    .trigger('mouseup');
});

it('advances the onboarding slide', () => {
  cy.visit('/');
  cy.swipeLeft('[data-cy="active-slide"]');
  cy.get('[data-cy="next-slide"]').should('be.visible');
});

This is browser-event simulation, not native touch injection. It can exercise the web interaction logic but does not prove that a device’s gesture recognizer, touch handling, or native implementation works.

Choose E2E, component, and native tests by the behavior

Test approach Execution target Best suited to Does not establish
Cypress E2E Running Ionic app in a browser Important journeys across app screens and integrations Native app behavior or hardware/plugin operation
Cypress component testing Component mounted in a real browser Component states and interactions in isolation That full-app navigation and integration work
Native test execution Native iOS or Android app/device stack Platform runtime, device, and native plugin behavior Not specified as a single universal test method; Ionic’s reference example discusses WebdriverIO and Appium

Cypress documents component testing configuration separately from E2E testing. Ionic’s end-to-end testing reference example treats native iOS and Android execution as a distinct coverage path and names WebdriverIO and Appium in its example.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If the task is capturing a page image rather than testing an Ionic interaction, ScreenshotNeo provides a screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP, or PDF; it is not a replacement for Cypress tests or native-device testing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anteel 2 Pack Silicone Suction Cup Phone Case Mount Double Sided, Hands-Free Silicon Phone Grip with Higher Suction Power for Selfies and Videos, Non Slip Phone Accessories (LightPink&White)
  • 【PKYAA Double Sided Silicone Suction Phone Case Mount】PKYAA With Double Sided 40 Strong and Reliable individual suction cups, PKYAA provides a thicken and upgraded universal silicon suction mount for your phone.
  • 【Friendly to Content Creators】If you are a content creator or an online influencer, you can create videos anywhere with this suction mount completely hands free with this silicone cell phone mount for cases.
  • 【HANDS-FREE & Adhere to Mirrors】This Double Sided silicone suction phone case mount allows you to stick your phone to the mirror easily. No longer holding your phone in one hand to watch video tutorials while making up.
  • 【Strong Grip on the Smooth Surface】You can easily hang your phone anywhere with a smooth surface. All you do is you clean off your phone and smooth surface. It is STURDY and it not only sticks to mirrors, it also sticks to windows, it sticks to refrigerators, tiles and other clean, flat surfaces.
  • 【Press Down Firmly Every 30 Minutes】Use your palm or fingers to press the phone down firmly and check it's secure before letting go. Apply even pressure for a few seconds to allow the suction cup to adhere properly. To maintain the grip and prevent accidental falls, it's a good practice to periodically reapply pressure to the suction cup.

Example cURL request (replace the URL with the page to capture):

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. It removes supported cookie and consent banners, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers identifying the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

Sign up free for 1,000 screenshots a month—no card required.

Troubleshooting Cypress with Ionic

The test cannot reach the app

  • Confirm ionic serve is still running and note the address it prints.
  • Make sure Cypress’s configured base URL matches that address, including the port and any path prefix.
  • Start the server before running E2E tests, as Cypress’s guidance expects the app to be available when visiting it.

A test passes on desktop but not at a mobile viewport

  • Set the viewport before visiting or interacting with the page so the app lays out at the intended dimensions.
  • Check that assertions target the mobile layout’s actual visible controls and that responsive navigation has finished rendering.
  • Remember that the test is still running in a browser; use native execution if the failure depends on a device runtime.

Onboarding or other state makes results inconsistent

  • Reset or seed the app’s own storage and session state as part of test setup.
  • Do not copy the tutorial’s Ionic Storage key unless your application uses that same key.
  • Avoid relying on test order to establish state; each test should arrange the preconditions it needs.

A swipe test does not advance the UI

  • Verify that the selector points to the active slide and that the component responds to the mouse events being dispatched.
  • Adjust event coordinates and sequencing to match the browser interaction implemented by your app.
  • If the concern is actual touch recognition on iOS or Android, test on the native execution path rather than treating synthetic mouse events as proof.

A browser test passes but a native feature fails

Cypress’s browser run cannot validate native plugin integration or hardware features such as camera and fingerprint authentication. Add tests using the native app/device stack appropriate to the project; Ionic’s reference example discusses WebdriverIO and Appium as options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can Cypress test an Ionic app in a browser without building the native app?

Yes. Run the Ionic web app with `ionic serve` and use Cypress E2E or component testing against the browser-rendered application.

Does a Cypress mobile viewport test run on a real phone?

No. `cy.viewport()` changes the browser window dimensions; it is a responsive-layout check, not a physical-device run.

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.