Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk7 min

How to Migrate from Protractor to Cypress

A practical staged migration from Protractor to Cypress, with Angular setup, command translations, retry guidance, side-by-side rollout, and CI notes.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Migrate from Protractor to Cypress in stages: add Cypress to your Angular workspace, port representative tests by their behavior, and run both suites side by side until Cypress coverage is dependable. Protractor reached end-of-life in August 2023, so existing users should plan a transition; the Protractor project website discourages new adoption and recommends migrating (Protractor project website).

Why move from Protractor to Cypress?

Protractor is deprecated and reached end-of-life in August 2023, according to the Protractor project website. Separately, Cypress’s migration guide notes that Protractor stopped being included in new Angular projects as of Angular 12. The Angular default change and Protractor’s end-of-life are distinct milestones.

As an Amazon Associate I earn from qualifying purchases.

A migration is not a command that converts an entire suite. Protractor and Cypress use different test interaction models, so the practical work is to preserve what each test verifies while rewriting how it finds elements, interacts with the page, waits, and asserts. Cypress’s migration guide documents setup and common command translations.

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

Inventory the suite before changing its runner

Make a simple map of the current coverage before altering workspace configuration. This is an implementation step, not a Cypress-generated conversion: the goal is to know what behavior must survive the move.

  • List user journeys covered by the suite and the important assertions each journey makes.
  • Identify shared page objects, helper functions, custom locators, and browser setup.
  • Mark uses of waitForAngular(), fixed delays, and other explicit waits; note what each wait is intended to ensure.
  • Record the current Angular CLI project, serve target, and CI commands so the new runner can use the right application and environment.
  • Choose a small, representative set of tests to port first, including interactions and asynchronous UI behavior.

Add Cypress to an Angular workspace

Recommended: use the Angular schematic

Cypress recommends adding its Angular schematic with:

ng add @cypress/schematic

According to the Cypress guide, the schematic installs Cypress, adds open and run scripts, and scaffolds base Cypress files and directories. It can also prompt to remove Protractor and configure Angular CLI’s default ng e2e target to use Cypress. Review those optional changes rather than accepting them automatically if you need Protractor during a staged migration.

Manual installation

The Cypress guide also documents manual package-manager installation. With this approach, ensure a separate process serves the Angular application while Cypress runs against it. The guide gives concurrently as one way to start the app and Cypress together; it is an optional helper, not a Cypress requirement. Because workspace scripts and serve targets differ, use the commands appropriate to your Angular project rather than copying a script without checking what it starts.

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

Translate tests by intent, not by search-and-replace

Protractor tests commonly use Selenium/WebDriver-style element operations. Cypress uses chained queries and commands. These guide examples show common starting-point translations; custom locators, helpers, and assertions still need a behavior-level review.

Protractor pattern Cypress pattern
element(by.css('#email-field')) cy.get('#email-field')
.sendKeys('text') .type('text')
Click a checkbox .check()
Uncheck a checkbox .uncheck()
Select an option .select('value')
Move an element into view .scrollIntoView()
Find text within a selector A Cypress query such as .contains(...)

A compact interaction example, based on the Cypress guide’s mappings:

// Protractor
 element(by.css('input')).sendKeys('my text')
 element.all(by.css('[type="checkbox"]')).first().click()

// Cypress
 cy.get('input').type('my text')
 cy.get('[type="checkbox"]').first().check()

After an interaction, assert the resulting application state that matters to the user. Do not assume a translated click or typing command alone preserves the original test’s intent. Cypress also points to Testing Library commands as an option for selecting elements.

Replace implicit waits with retryable conditions

Protractor suites may rely on waitForAngular() or arbitrary timeouts. Cypress retries DOM queries and waits for an element to become actionable, subject to its configured defaultCommandTimeout. In the Cypress guide’s approach, tests assert the expected rendered state instead of explicitly waiting for Angular.

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

For each old wait, ask what it was protecting against: a result appearing, a button becoming enabled, a route rendering, or some other observable condition. Prefer a retryable query followed by a specific assertion when that is the condition the test needs. Do not mechanically replace every delay with cy.wait(number); a fixed pause does not express the condition and can make a test unnecessarily slow or still unreliable. Cypress’s retry behavior is not a claim that every kind of asynchronous work in an application is automatically handled.

Can Protractor and Cypress coexist in the same app?

Yes. Cypress says teams do not have to replace all tests immediately and documents keeping Protractor tests in Angular CLI’s e2e directory while Cypress specs live in a sibling cypress folder. This lets a team introduce Cypress without making an all-at-once runner switch.

A low-disruption rollout

  1. Keep the existing Protractor suite and its CI job running while Cypress is introduced.
  2. Port one stable, valuable journey and check that its Cypress assertions cover the same user-visible behavior.
  3. Run the Cypress spec locally and in CI against the intended application environment.
  4. Compare the coverage and failure behavior of the new spec with the Protractor test it is meant to replace.
  5. Repeat for additional journeys; retire a Protractor test only after its Cypress counterpart is reliable in your team’s environment.

This sequence is a practical rollout recommendation built on the documented coexistence model; project-specific helpers, browsers, and CI configuration still determine the details.

Run Cypress locally and in CI

With the Angular schematic, the Cypress guide documents these commands:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • ng e2e
  • ng run {project}:cypress-open
  • ng run {project}:cypress-run

Replace {project} with the Angular CLI project name in your workspace. The guide also documents browser selection with --browser or a configured default browser. Confirm that the selected browser is available in the environment where the command runs.

For manual setup, the guide shows example cy:open and cy:run scripts that start the application and Cypress together. Adapt them to your serve command and whether the app is already running in CI; avoid starting a second server against a port already in use.

Optional recording and parallelization

If CI scaling or debugging needs justify it, Cypress’s guide shows running Cypress with --record --parallel and describes schematic options for parallel, record, and a recording key. It points to Cypress Cloud for recorded runs and describes Test Replay as a debugging capability for recorded runs. Recording and parallelization are optional workflow choices: evaluate the additional service configuration against your CI needs rather than making them a prerequisite for migration.

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

Troubleshooting migration problems

  • The Cypress command cannot reach the app: In a manual setup, verify that the Angular server is running and that Cypress targets the correct address. If a script starts both processes, check that it uses the workspace’s actual serve command.
  • ng e2e still invokes Protractor: The schematic can optionally redirect Angular CLI’s default E2E target. Check whether that option was selected and inspect the workspace target before assuming the command changed.
  • A translated interaction fails: Check whether the selector still identifies the intended element and whether the original locator or helper encoded additional behavior. The documented mappings are examples, not one-to-one replacements for every custom operation.
  • A test is flaky after removing a wait: Identify the observable state the old wait was intended to protect. Use a retryable query and assertion for that state where possible, rather than inserting an arbitrary fixed delay.
  • A browser run works locally but not in CI: Check the CI command, selected browser, application serve process, and project-specific environment. The Cypress guide documents browser selection, but the correct browser and setup depend on what the CI environment provides.
  • Recorded parallel runs do not start as expected: Confirm that recording is configured, the required recording key is available, and the run command includes the intended options. These are optional recorded-run settings, not required for ordinary local Cypress execution.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server, not a replacement for migrating or running E2E tests. It can be useful when a workflow also needs a clean screenshot of a page: cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed; and its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.

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

For example, this cURL request captures a website screenshot. See the ScreenshotNeo documentation for API details.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Learn about ScreenshotNeo, or sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Does Cypress convert a Protractor suite automatically?

The documented migration approach supplies setup guidance and command mappings; custom locators, helpers, and test assertions need to be reviewed and rewritten for their intended behavior.

Do I have to remove Protractor when adding Cypress?

No. Cypress documents running the suites side by side during a gradual migration.

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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.