Hello all, welcome to the test Entity Framework Learning Series. Let's first take a dig at the introduction of test engine, what test engine is why we need it? What are the advantages of test engine over some other frameworks, I have created a very small document for you. So you can also refer it whenever you like. And let's go over it to just take an introduction. So test engine is a testing framework inspired from J unit and n unit, when more functionalities added to make it, execution more efficient and powerful.
It is also an open source open source technology. It eliminates most of the limitations of older frameworks and actually gives the developers which means the test writers the ability to write more flexible and powerful test cases. It has a lot of things like annotations grouping dependent test cases, sequencing parameterizing data provides Just a lot of things it has and we will discuss everything in detail. What are the benefits of testan G, we can actually generate logs also using the stingy annotations, which is really good. They make the code very efficient and really easy to manage. We can generate HTML reports also using test Angie.
We can group test cases, depending on the features of the application. And we can also put the test cases in a particular order that we want to run. We can run test cases in parallel also, and we can provide data to the test cases from external files also. So all these things are really great. What are some annotations used? Interestingly, there are a lot but we'll discuss some important ones.
As I said before, sweet this annotation will run once before all the test methods in a test suite and we will learn a In following lectures for a test suite is what a test case is and what a test tag is. We will learn everything but test classes, we will learn all those things definitely in a lot more detail. So to just understand some benefits and what these annotations are, we we'll take a quick look after sweet is exactly similar to before sweet. The only difference is it shows by the name that it runs once after the complete suite is done at the red before sweet. This annotation will run once before each test tag. So it's not the test method.
It's the test tag and we will see that in the lectures. Same thing with after test. It will run once after each test tag in the XML file. Before classes, probably the easiest one for you to understand right now. So there's always a test class and there are a lot of test methods inside a test class. So, before class annotation, if we annotate any method with before class annotation, that method will run once before any of the method executes in the test class.
And same thing goes by after class if we annotate any method with at the rate after class annotation, that method will execute once after all the methods in the test class are executed. And before method and after method are also similar. The only difference is any method be annotated with at the rate before method and after method will execute once before each test method inside a test class. So the only difference between before class and before methods before class will execute only once in a test class and Before method will execute once before each method. So, if you have 10 methods 10 test methods in a test class, then this method will execute 10 times Same thing happens with after method also, after a test this is the main annotation. Any method that you annotate with accurate test annotation will be considered as a test case.
What are some benefits of using annotations? So, it helps to identify the method that it is interested in by looking at the annotation. So, by looking at the annotations test and you know if it's a test method, or if it's a before class or if it's after class and those kind of things. So, because of this method names are not restricted to any pattern or format. You can just name them anything, which makes it easy for you to understand what the test method is doing. We can pass additional parameters to annotation We can enable and disable the test methods also.
And annotations are strongly typed. So compiler will flag any mistakes right away. So we don't run the faulty code, we will know if something is wrong and we can fix it before trying to run it. And test classes no longer need to extend anything. So such as test case for j unit three. So basically in j unit three, we had to extend test case class to create j unit test classes.
So right now with annotations test it makes it really easy. So these are some introduction and advantages of using test ng G. And stay tuned for the next lecture. We will have a lot of fun we will learn every concept in detail, and I'll see in the next lecture. Thanks for attending this one. Thanks.