Some people will think about selenium, QTP but the “Testing tool” I mentioned are JUnit, TestNG, NUnit, Rspec, SpecFlow, Cucumber, … or you can find define of Unit Testing tool
The Testing tools is one of importance components of ~Automation Framework~.
We should have knowledge about Testing tool features, this post I will describe my experiences when I used them.
1. Test case components
There are 4 main components within a test case:
- Pre-conditions
- Main actions
- Expected results
- Clean/Clear test data
Based on this concept, Testing tool have functions/procedures to describe like:
-
For Pre-conditions have:
*JUnit/TestNG*: @BeforeSuite, BeforeClass, BeforeMethod
*NUnit* : [SetupFixture], [Setup]
*RSpec* : before[:all], before[:each]
-
For Test
*JUnit/TestNG*: @Test
*NUnit* : [Test]
-
For Clean/Clear Test
*JUnit/TestNG*: @AfterSuite, AfterClass, AfterMethod
*NUnit* : [TearDown]
*RSpec* : after[:all], after[:each]
2. Test events catcher
Test events catcher is very importance feature of testing tool that have you generate your customization reports.
- when using TestNG is [Listener interfaces](http://testng.org/doc/documentation-main.html#testng-listeners)
- when using UNuit is [Event Listener](https://github.com/nunit/docs/wiki/Event-Listeners)
- when using Rspec is called [base formatter](http://www.rubydoc.info/gems/rspec-core/2.6.4/RSpec/Core/Formatters/BaseFormatter)
- when using Cucumber is call [Formatter](https://github.com/cucumber/cucumber/wiki/Custom-Formatters)
3. Expected result
Testing tool have many assertion method to compare expected and actual result to make a test valid.
- TestNG have *AssertJUnit*
- NUnit have *Assert*
- RSpec have *expect().to*
- …