In this episode, you’re going to take a dive into using selenium for full system testing or acceptance testing, sometimes those two words get interchanged. This is an important type of test for pretty much any application.
In test-driven development, you have different layers of testing. Just like an onion architecture, you have different layers of code. You have the inner code and then you layer on additional code to the outside as you get closer to interfaces.
The same thing in testing, you have unit tests, which test your core and every method of every class. You should have a unit test that doesn’t depend on interfaces, doesn’t depend on external dependencies. You have integration tests that make sure that every one of these interfaces does work with the outside world, whether it be a database or a web service, you want to make sure that your application knows how to call those interfaces. Those are integration tests.
Code Sample: https://github.com/jeffreypalermo/onion-architecture-dotnet-6/
Unit tests don’t call outside of their own memory spaces or their own process. Integration tests do call from your application process to some other process. The simplest form is just your code calling a database.
Full system tests take all the pieces of the application and the dependencies that you interface with. It runs the complete application and executes a particular feature or function.
In this episode, you’re going to take that style and add on to the example we’ve been using in previous episodes and add a selenium test. We will talk about the ins and outs of full system acceptance testing using selenium. Selenium is just a tool.
What’s important is that you know how to create these full system tests that run an application just like they’re intended to be run in production. Whatever the method of using the application is, you need full system tests that cover everything that is to be supported. If it is a screen used by users, you must pop open the screens and touch them. If data comes from place A to place B in your system, you will design a full system test that runs that to make sure that it works.
This is going to be super quick, drinking from the fire hose, but after this, you are going to be able to add Selenium to your application and start creating full system tests- technical type tests or acceptance tests that are more user scenario based.