Products
Apr 23, 2023

Run Protractor Tests in Cypress: The Magic of EndBridge

Run your Protractor tests in Cypress — without rewriting them
Run Protractor Tests in Cypress: The Magic of EndBridge

The End is Near

August 2023 will see the end of life for Protractor. So what does that mean for the thousands of companies with end-to-end tests written in Protractor? Until now, you’ve only had two really poor choices:

  1. Stick with an old, archaic product
  2. Spend a ton of money and time migrating to something modern

Both of these choices have significant drawbacks, and nobody really wants to pick either option.

But now you have a third and infinitely better option.

EndBridge to the Rescue!

EndBridge allows you to run your Protractor tests in Cypress — without rewriting them! With EndBridge, it’s like Cypress now supports Protractor syntax. This means that with just a small amount of effort, you can remove Protractor from your toolchain, and have all your end-to-end tests running on a modern, performant, and feature-rich product: Cypress.

Show Me the Magic: How Does EndBridge Work?

Endbridge is an exercise in computer science wizardry. EndBridge takes your calls to Protractor and translates them into the equivalent calls in Cypress at runtime. You don’t have to go through and rewrite all your element() calls into cy.get() calls. You can leave them and just run them within Cypress. It’s truly like magic.

Of course the great part here is that your end to end tests can be “migrated” to Cypress in as little as an afternoon, and now you have all the benefits of using Cypress for your end-to-end tests.

With features such as:

  • Amazing speed improvements: Cypress is known for its fast execution speed, as it runs directly in the browser and can take advantage of features like parallelization and intelligent caching. On the other hand, Protractor is slower due to its reliance on the WebDriver API.
  • Visual inspection & debugging: Cypress offers a built-in Test Runner that provides a visual representation of your tests and allows you to see what’s happening in real-time. It also includes a debugger that lets you pause and inspect the state of your application during test execution. Protractor has a similar debugging capability but lacks the visual inspection feature.
  • Time traveling: Cypress has a unique feature called time-traveling, which allows you to “rewind” and “fast-forward” through the steps of a test, making it easier to debug and diagnose issues. Protractor does not have this feature.
  • Visual locator diagnostics: Cypress offers a feature called “Automatic Waiting” which waits for elements to appear and disappear on the page automatically. It also provides a visual locator tool that highlights the selected element in the browser, making it easier to verify that the correct element has been selected. Protractor does not offer this feature.
  • Screenshots: Cypress captures screenshots automatically whenever a test fails, making it easier to diagnose issues. Protractor also has this feature.
  • Cloud storage: Cypress provides cloud storage options for storing and sharing test results, which can be useful for teams working remotely. Protractor does not have this feature.
  • Videos of test failure: Cypress can record videos of test failures, which can be helpful for diagnosing issues. Protractor does not have this feature.

Implementing Endbridge means you can remove Protractor from your whole project.

How do you implement EndBridge?

Implementing EndBridge is straightforward, and involves the following steps:

  1. Install and configure Cypress in your project
  2. Install the EndBridge library through NPM
  3. Move your Protractor tests into the Cypress directories in the project, or point Cypress at your current Protractor tests
  4. Modify the import statement of each test to import EndBridge libraries instead of Protractor and WebDriver libraries
  5. Run your tests
  6. Address any issues
  7. Remove Protractor
  8. Get a promotion for saving your company hundreds of thousands of dollars!

It can’t be that easy, can it?

In general, it can be this easy, but as with all technology, nothing is ever 100%. Our support team will help you to address any of those issues, and modify your end-to-end tests to be fully compatible. Generally, you will have to touch less than 5% of your tests, and most adjustments are small. Our team can even make the changes for you!

How do I learn more?

If you’re interested in learning more about EndBridge or finding out pricing information, click here and set up a live demo of EndBridge today!

Happy testing!

. . .
About HeroDevs

HeroDevs partners with open-source authors to offer comprehensive solutions for sunsetted open-source software. Our Never-Ending Support products ensure businesses remain secure and compliant, even as their depended-upon open-source packages reach end-of-life. Alongside this, our elite team of software engineers and architects provides expert consulting and engineering services, assisting clients in migrating from deprecated packages and modernizing their technology stacks.

Article Summary
Transition your Protractor tests to Cypress effortlessly with EndBridge. Enjoy modern testing features without rewriting your existing tests.
Author
Joe Eames
Vice President of Strategic Partnerships
Related Articles
HeroDevs Champions Cybersecurity by Joining CISA’s Secure by Design Pledge
HeroDevs Signs CISA's Secure by Design Pledge to Join the Effort for a More Secure Web
HeroDevs Joins OpenJS Foundation’s Ecosystem Sustainability Program as First Partner
HeroDevs Partners with OpenJS Foundation to Ensure Open Source Sustainability and Security
Angular 15 End-of-Life: Navigate Migration, Tackle Breaking Changes, and Ensure Ongoing Support with HeroDevs
Ensuring Seamless Transition and Continuous Support Beyond Angular 15’s EOL