A proper introduction to end-to-end testing or E2E is due. As I mentioned, there are many testing processes and methods for an application during development.
However, most of them only focus on one aspect of the app or software. End-to-end testing is slightly different from your typical functional or non-functional tests.
Scratch all that for a moment. Think of the whole flow of your software from a user's perspective (hence the reasoning behind the name end to end). Let's assume that we're talking about getting a user signed up to your site and getting them an account/identification.
In end-to-end testing, you would assess this whole workflow and ensure that everything runs fine in that test scenario. Moreover, it's not only limited to testing your codebase.
Instead, it also tests all of the external dependencies — be it a library you're dependent on or something else. Given this structure, end-to-end testing is also known as chain testing by many developers and testers.
These tests attempt to imitate real-life scenarios that a user may face. This replication of user experience and behavior makes it highly critical to ensure that the released build fulfills all expectations.
These tests are usually pretty chunky and require more time and resources to run (more on that later). First, let's look at an example of what an E2E test may look like, at least if this is your first rodeo.
The easiest way to explain something as complex as software testing is probably through an example, so let's imagine a use case.
Let's say you have some form of mailing service, and you want the features to be tested. What are the things that you would test?
You would want to get the users signed up or get them to log in first. Then, they should be able to send or check for emails, compose and send new ones, check different parts of the inbox, etc.
The flow could be like: getting to the site, signing up or logging in, checking for new emails, accessing folders like spam, sending replies and new emails, and correctly signing out once they're done.
An E2E test will check all of these things step by step and see whether all integrations are performing ideally. Of course, an actual test would be far more complex and include various intricacies. You'd also have to test the dependencies (for instance, checking whether the integration with the database is working well when you're fetching the user's credentials).
Given how vast this can be, how do you even know what your end-to-end test should look like? Let's get a glimpse of that too.
E2E tests are large and chunky. They can be hellish compared to the baby unit tests or API call tests. And hence, the question of importance is a rather crucial one to ask here.
In this messy who does what world of software design and development, things are done in many ways. But let's try to answer that question holistically.
Typically, QA professionals are the right people to get the E2E testing done. That's not just the case for an end-to-end test — they are the usually right people to get most software tests done. But that doesn't always have to be the case.
Now, it may not sound feasible for a small team to assemble a whole QA team. We see that even the devs sometimes do end-to-end testing in many cases. Many companies are now getting the developers to do it by default, regardless of their size.
There are opinions for and against this idea. Here are some reasons why people don't like it:
The first reason is that these are the same people who wrote the codebase for your software. That introduces the possibilities of a few things — one; they typically won't look at things from an end user's perspective, which is crucial for these tests.
Secondly, that position may open them up to personal biases (even though they may be unintentional). Therefore, having a neutral perspective on the whole thing can be helpful.
Another aspect is that these devs are already bearing a huge responsibility. Adding even more stuff to that burden is probably not the ideal step. It also reduces your team's efficiency in terms of getting the build out there as soon as possible (remember the crunch days?). The reason is straightforward — the devs would be spending a lot of time on QA testing.
However, there are arguments for devs doing these tests as well. That's partly because they know the codebase and every little intricacy within it. Another reason is that running end-to-end tests can give them a more significant incentive to do an even better job of writing better code from the very beginning.
Regardless of the opinions, it's evident that while QA professionals are one of the best people for E2E tests, the options aren't limited.
The when of end-to-end testing is quite crucial. These chunky tests take time to design, script, and run. Therefore, knowing when to do end-to-end tests can make the whole process more efficient.
Typically, you'll find a few tests done multiple times during the development cycle.
A helpful bit, in this case, would be the notion of the testing pyramid. It talks about pragmatically doing things — finishing the smaller and more focused tests first and climbing up the higher complexity and scope ladder.
For example, we should always do a unit test before moving on to integration testing. The rationale is straightforward — unit test verifies the smallest units of code in the software's codebase, and finding issues from a single unit would be very quick.
Following that same rationale, E2E testing should start after tests with lower coverage, but higher efficiency and speed are done. Otherwise, the E2E test would take more time, and resolving issues would take longer due to the broader test coverage.
We may not similarly do things as we did with development models like Waterfall. Nevertheless, we can still utilize that same testing pyramid principle to avoid redundancies and inefficiencies.
Firstly, we need to list all the essential features and functions that the users of your application would come across. The extensiveness of those functions and flows can differ depending on your application. You require a clear notion of how each function should work and how the relationships between them should be.
Sure, testers would love to test every little function that the end-users interact with. However, that's not feasible regarding resources and the time taken. That's why it's vital to know what to choose.
Many teams utilize user data to figure out what to test as well. But that does assume that you have a large enough userbase and the data required to help you with that.
Once the requirements are set, the next step is to get the test environment up and running according to those requirements.
Now that we have the groundwork laid out, we can build conditions on top of them. Testers should have a clear notion of how each of them should respond. A well-defined test is crucial for a quality application, so all test scenarios should be clearly defined and described.
After that, testers can move on to designing the test cases. They have to add the assumptions, pre-conditions, and required data — the usual deal.
The next step is to run the E2E test. The testing tool will go through all test scenarios to validate every crucial user function and return with insights.
Utilizing those insights is a crucial part as well. Testers need to track the test progress at regular intervals and have clear metrics to determine the application's success.
While both have their advantages, many testers opt for horizontal testing because of how much more control they can have over it.
These days, codeless testing tools are pretty huge. Many of them offer drag-and-drop features to script a whole test, and it's easy to see the appeal. It also allows non-technical testers to work on the test with ease. In those cases, these tools are much faster than the conventional options.
While all of that is great, it helps to remember that these tools cannot reach the same levels of complexity as conventional (code-based) testing tools. While most typical workflows are pretty easy to design with codeless tools, a highly-complex workflow requires granular control. Therefore, this decision depends on your project's requirements.
The automated testing market is growing more and more saturated every day, and we've got tons of options to pick from. Here are a few of them:
Since its inception, Cypress has managed to gain a considerable amount of popularity among testers for its unique design. Unlike most of the other tools here, this one focuses entirely on end-to-end testing. This tool is open-source, and it has been developing pretty quickly.
Writing tests with Cypress is pretty effortless, and it doesn't require any external dependencies either. It supports frameworks like Angular and React flawlessly and supports cross-browser testing. Devs who follow a test-driven development approach like this tool because of its real-time capability.
There's one caveat: it doesn't work on Safari yet. That can be a bummer for a lot of testers.
We've got a testing tool that focuses on BDD (behavior-driven development). This is another open-source tool, and it's written with Ruby. One of the best things about this tool is its simplicity and ease of usage.
It uses a language called Gherkin for test scripting. The fun bit about this language is that it's close to writing tests in English. As a result, even non-technical testers can learn to write the tests with Cucumber pretty quickly.
Selenium is one of the most well-known software testing tools out there. It has been around for a long time, and you can find packages for a plethora of languages, including JavaScript, Python, Java, and many more. This sort of versatility is very handy.
Furthermore, it has a long list of functions, making it easier for you to test all sorts of case scenarios. Selenium's test coverage is pretty impressive for that reason. It also allows for parallel execution, which is beneficial for extensive and frequent tests such as E2E tests.
Unlike Cypress, Testsigma covers a broader range of software tests (obviously including end to end testing). With its scalable automated testing, you can even integrate the testing between different parts of your application.
It allows for both cloud and offline deployment, which improves accessibility. The usage of AI also means that little changes won't break the test. This tool also supports cross-browser testing and parallel execution. It's also a suitable option if you go for data-driven testing.
E2E testing has made itself a crucial part of every little sprint when you're developing in agile.
Typically, we focus on a single unit or part of the software during each sprint. While that does mean that we're working on the codebase of a single component or sub-system, it does not mean that it won't affect the rest of the application. Therefore, it's paramount to test whether the rest of the product's workflow is running fine.
That's where end-to-end tests can come in to save the day. It's undoubtedly the efficient way to ensure that the whole system maintains the flow the way you want.
In this age of complex software design and quick iterations, end-to-end testing is one of the most efficient ways to keep your application running flawlessly. While these tests are comparatively chunkier and require more work to write, they're irreplaceable if you want to ensure a quality experience for the end-user.