Skip to main content

Angular's E2E Testing Framework - Why is it called Protractor?

The Angular Ecosystem

Angular is an amazing framework. It enables us to build modern web apps easily. Yes we can build a modern web app with just HTML + CSS + JavaScript, maybe with a dash of jQuery 😉 But Angular just makes it whole lot easier.

Users today's web apps to be fast, well designed, offline-capable, secure and a delightful. Since Angular is a opinionated framework, it forces you to make the right choices. Today Angular is not just a web framework. it has created its own ecosystem.

As you might have guessed, I am a Angular fanboy 😎. But one thing I'm not a fan of is writing test cases 😛 I started learning about software testing in late 2019, because I asked to setup unit + E2E testing for one of our projects. What I learned was, Angular come with Karma + Jasmine setup (for unit testing) out of the box. But it has built a specialized E2E testing framework called Protractor. But I couldn't figure out why they called it Protractor of all things. Later it dawned on me 💡 My eureka moment! The clue was hidden in the framework's name all along.

Protractor - Angular's custom E2E framework

The Mystery

In HTML we use chevrons to denotes tags. Chevrons are also called... you guessed it! Angular brackets. So that's how the framework's name came to be. Now the word angular itself is derived from the word angle. We have all been introduced to angles in our math classes. We were also taught how to measure angles using a particular tool. That's right, the tool is called protractor!

We can measure angles using a protractor. And similarly we can measure the "correctness" of our code with E2E testing. So that's why the name was chosen. Pretty smart if you ask me 💻

Comments

  1. Such a deep thought behind naming! Nicely explained. I am sure now, "google" would also not be as meaningless as it sounds.

    ReplyDelete
    Replies
    1. Moral of the story: everything has a reason 🧐

      Delete

Post a Comment

Share your thoughts...

Popular Posts

Why I Started Blogging

It's been almost 5 years since I started blogging. This is the 30th post being published. That means over the course of 5 years, I've written 6 posts per year. Although 30 is much less than I would have liked, this is one of those pet projects I have continued even after the honeymoon phase. Today I want take some time and discuss why I started this blog in the first place. I was in my 3rd year of engineering studies when I started out. I had already developed a keen interest towards programming and tech in general by then. Having a blog seemed liked a cool idea. There were couple of more reasons to go ahead with this idea. That's what we are here to discuss today. Setting up a blog seemed like a technically challenging task. I wanted to know how to setup a blog with comments, advertisements and with a custom domain. It sounded like a great way to acquire new skills and learn new things along the way. Back then I didn't know anyone who shared my enthusiasm for tech

The State of Video Streaming Services in India [Part 2: The Aftermath]

It's been a year since I published my post about the state of video streaming services in India (which can be found  here ). I wrote how media companies were trying to get a piece of that market. A lot has changed in a year. For starters, Hotstar has received a revamp and it works on my Kubuntu system now. Prime Video remains the best option for most people. Many more services have launched. Ozee has rebranded itself as Zee5. But a few things have stood the test of time. Netflix's pricing is as expensive as it was a year ago. Yes, that was sarcastic. Now there are lot of streaming services to choose from. Here's a list of some of the popular ones. Amazon Prime Video Hotstar Netflix YouTube Zee5 Eros Now Spuul Voot Hoichoi ALTBalaji Hooq JioCinema / JioTV Sony LIV YuppTV BIGFlix The list goes on and on. It is said that competition is good for the consumer. More the competition, more the aggressive pricing, more the benefit for the consumer. Just lo

Notifications, Not Ads

Notifications on our smartphones are pretty common these days. Notifications are designed to provide the user with helpful information and alerts. For example, a reminder notification, an email notification, a download-in-progress notification. According to Google, Notifications provide short, timely, and relevant information about your app when it’s not in use. Source: Material Design | Notifications It's a useful feature offered by modern mobile operating systems. An average smartphone user gets many, many notifications each day. Some of 'em are useful, some of 'em are less so. Many are intruding in nature. The issue is that developers have started to abuse the notification framework. They are using notifications to serve ads and promotions which gets pretty annoying pretty quickly. These notifications are neither timely nor helpful. And almost none of apps allow you to opt out from this crap. The only thing you can do is block all notificat

Dear edX!

Dear edX, I was in my 2nd year of college when you came to life. And I was ecstatic! No, not to be in college (LOL) but to have finally found my calling. Computer programming. I was browsing through all the resources I could find. Codecademy courses mainly. And right at that moment, you arrived. Your parents hail from the Harvard University and from the MIT. So of course you received my attention. Also, you had an unique selling point: free certificates. This was huge! No one else was doing it. It seemed you were actually trying to help students learn new skills and show off to the world. I was stoked to enroll into the course developed world's top professors. The free certificates were a big motivator to complete the courses. The first course I enrolled into was developed by The Linux Foundation. I have taken several courses since then. Some were on computer programming, some were about a country's history and some provided advice on career growth and personal finance. 2

How to Automate NPS Contributions - A Step by Step Guide with Screenshots

Introduction The National Pension System is a great financial product for creating your retirement kitty. With contribution of just ₹5000 per month, you can accumulate more than a crore! I am a NPS subscriber (through NSDL eNPS) myself. If you have read my previous post  regarding EPF you know I like NPS for the following reasons. 60 year lock-in period Additional tax exemption under section 80CCD (1B) Choice of various assets classes Choice of pension fund managers Option to change your asset allocation or pension fund manager Low cost of fund management Transparency & organization structure Good customer support Online account opening and management Multiple exit options at retirement Screenshot from  Pension Calculator | NPS Trust Some Not So Great Things NPS is far from