Hello Lars;
I've abandoned all Protractor and all Karma/Jasmine work in favor of Cypress. Cypress is a direct 1 to 1 replacement for Protractor but overlaps into the Unit Test layer due to its ability to intercept and alter all incoming and outgoing HTTP requests.
Cypress majorly reduces the dependency issues found in all Angular Unit Test frameworks, because it runs in the browser! No more client side mocking, no more major hunting down dependencies.
I understand there's a Goolge Cypress-like clone, which I haven't tried yet. Maybe someday I'll get there.
As always it comes down to what you want to test. Protractor uses Selenium to talk to a browser (so you could test browser support) cypress has their own chrome runtime. Because of complexity and runtime overhead I want to have as little end to end tests as possible (smoke test). If you test all layers and a test breaks, the reason can be in every one of these layers and the infrastructure. If tests become flacky, its better to have none at all, because you will get less confident depending on them.
Unit tests have a different purpose. They validate the logic of the function under test. They are fast, independent, stable. You can execute thousands of unit tests or a handful of cypress/selenium tests.
Personally I would do a manual smoke test instead of automating a fragile jenga tower. And once the software is mature enough build a ton of unit tests, maybe even property based tests.
Hello damoeb;
I was a test manager of a team of 35 people in three continents for 7 years, (at one time). I am very familiar with testing methods and terminology.
The problem I kept seeing then, was that the traditional concepts of Unit Testing, E2E, and even Smoke testing are off-base today. All have very specific definitions which managers or product owners feel is the "right" one. Unfortunately most of them are not developers and are under the assumption their understanding of those definitions are only what they think they are, with no need to communicate that understanding.
Those old definitions are over 20+ years old. Since then, new tools such as Cypress have crossed the line from only E2E to overlapping with Unit Test and Smoke Test ability. It's a true one-stop-shop.
Cypress does not need, as you know; the huge Protractor and Selenium set up. It's simply a browser driver (similar to Selenium) which allows http request interception. This allows for creating unit tests by altering the data.
It's fast, complete, and requires only a small ramp up time to get going. Unfortunately it's based on JQuery, but for the goodness it has, I am easily able to overlook that part.
My motto "In 2021; Just say no to Karma/Jasmine or Protractor/Selenium"
👨🏫 Co-Founder of This is Learning, Organizer of AarhusJS
✍️ Writer, Speaker, FOSS Maintainer 📗 Author
🏆 Microsoft MVP 🌟 GitHub Star
🌊 Nx Champion 🦸 Angular Hero of Education
Hello Lars;
I've abandoned all Protractor and all Karma/Jasmine work in favor of Cypress. Cypress is a direct 1 to 1 replacement for Protractor but overlaps into the Unit Test layer due to its ability to intercept and alter all incoming and outgoing HTTP requests.
Cypress majorly reduces the dependency issues found in all Angular Unit Test frameworks, because it runs in the browser! No more client side mocking, no more major hunting down dependencies.
I understand there's a Goolge Cypress-like clone, which I haven't tried yet. Maybe someday I'll get there.
As always it comes down to what you want to test. Protractor uses Selenium to talk to a browser (so you could test browser support) cypress has their own chrome runtime. Because of complexity and runtime overhead I want to have as little end to end tests as possible (smoke test). If you test all layers and a test breaks, the reason can be in every one of these layers and the infrastructure. If tests become flacky, its better to have none at all, because you will get less confident depending on them.
Unit tests have a different purpose. They validate the logic of the function under test. They are fast, independent, stable. You can execute thousands of unit tests or a handful of cypress/selenium tests.
Personally I would do a manual smoke test instead of automating a fragile jenga tower. And once the software is mature enough build a ton of unit tests, maybe even property based tests.
Hello damoeb;
I was a test manager of a team of 35 people in three continents for 7 years, (at one time). I am very familiar with testing methods and terminology.
The problem I kept seeing then, was that the traditional concepts of Unit Testing, E2E, and even Smoke testing are off-base today. All have very specific definitions which managers or product owners feel is the "right" one. Unfortunately most of them are not developers and are under the assumption their understanding of those definitions are only what they think they are, with no need to communicate that understanding.
Those old definitions are over 20+ years old. Since then, new tools such as Cypress have crossed the line from only E2E to overlapping with Unit Test and Smoke Test ability. It's a true one-stop-shop.
Cypress does not need, as you know; the huge Protractor and Selenium set up. It's simply a browser driver (similar to Selenium) which allows http request interception. This allows for creating unit tests by altering the data.
It's fast, complete, and requires only a small ramp up time to get going. Unfortunately it's based on JQuery, but for the goodness it has, I am easily able to overlook that part.
My motto "In 2021; Just say no to Karma/Jasmine or Protractor/Selenium"
Thanks for discussing, everyone. Just wanted to make you all aware that there are plenty of options for end-to-end testing:
I was wanting to look into Puppeteer a while back, today I found this on their site:
How to intercept an HTTP request in Puppeteer
They too can intercept inbound and outbound requests ✔️
I don't know yet if the data can be changed, but the workflow can be altered.