Need recommendations for reliable headless browser solution for automated testing and CI/CD pipeline

I need help finding a dependable headless browser setup for automated testing of my Angular application.

I’ve been researching different approaches and built a test suite using Selenium with Protractor and Jasmine. Everything worked perfectly during local development, but when I tried to run tests headlessly in our continuous integration environment, things fell apart. PhantomJS was my first choice but it’s been extremely unstable and causes random failures.

I’m open to switching frameworks and rewriting parts of my test code if needed. Here’s what I absolutely need (listed by importance):

  1. Headless execution on our CI system - We use Windows with TeamCity, though we might switch to Mac later
  2. Local testing capability - Must work on my Windows machine with standard browsers like Chrome and Firefox
  3. Cloud testing integration - Would be nice to connect with services like BrowserStack or Sauce Labs

I’ve spent way too much time trying to make PhantomJS stable. The idea is solid but the execution feels unreliable. I’ve looked at other headless browser options but haven’t actually tested them yet.

Is there a proven solution that meets these requirements? I’m relatively new to JavaScript testing and Angular automation, so any guidance would be helpful.

Thanks in advance for your suggestions!

puppeteer is deff the way to go! its way more stable than phantomjs, and since google maintains it, its always up to date. i’ve had great success integrating it into my ci/cd setup, no issues lately!

Had the exact same PhantomJS nightmare about a year ago. Ditched Selenium for Playwright and haven’t looked back. Playwright handles multiple browsers natively and headless mode is rock solid. Perfect for Windows + TeamCity since it bundles its own browser binaries - no messy installations. Yeah, you’ll need to rewrite some test code, but the migration wasn’t terrible. The CI integration is fantastic and debugging blows Protractor out of the water. Been running it in production for months - zero random failures.

Chrome headless has been rock solid for me. You’re already using Selenium, so just swap to ChromeDriver with headless flags - keep everything else the same. I switched from PhantomJS two years ago and those random test failures vanished completely. Chrome headless runs the actual Chrome engine, so you get way better compatibility than PhantomJS ever gave you. For TeamCity, just install Chrome on your build agents and update your WebDriver config. Also works great with BrowserStack if you want that option down the road.