Functional Test
Last updated
Last updated
Functional testing is a black-box testing method to check the functionalities of a system at a high level without thinking about the internal code. Normally, the company uses this level of testing to check the expected functionalities in different demos depending on the team.
The idea is to have the most complete demo possible to check each component, event, and functionalities in general and run all tests created or the tests with the most level of value (smoke test) against each change in the code. In this way, it is easier to check if some of the functionalities change or fail due to the change implemented.
The process to follow at this level is the following:
Design the scenarios or test cases with their steps.
Validate if the test cases are correct and work as expected.
Create in Azure DevOps the test cases designed and validated in the previous steps.
Not all test cases can be automated, and because of it, it is necessary to have the test cases registered in some place, like Azure DevOps, to have the possibility to apply those tests in a manual way. However, other test cases can be automated, and consequently, some standards need to be followed.
The established standards to create automated functional tests in the company are the following:
Any project related to functional testing must use the entire library created by the Quality Mate Team. (See QualityMate Documentation)
It is important to follow the good practices to use the Quality Mate library, for example, use “validate” instead of "assert", not create extra classes to use functionalities that already exist in Quality Mate, etc.
The structure of the project should be one folder to include the page objects and another to include the test cases. Any other folder is valid, but it is necessary to follow the basic structure mentioned before.
Each page object should represent only one window, view, form, or page of the application and the components inside them to maintain the order and logic of the structure.
Each test must document in the log each significant group of steps. Using the next code provided by QualityMate:
To avoid extra code and improve the performance in the tests, it is necessary to use the ID of the component to automate the name of any control. If the control does not have an ID, it is valid to use the selector, the first option to use is the CSS selector and XPath Selector as the last option.
Follow the basic good practices to create any test case. (See Good practices).
Document the test case using the basic tags and summaries. (See Test Documentation)
The next examples are a reinterpretation with the standards of the example provided by QualityMate. Here is the original example.
It is valid to add any other NuGet or dependency in the project depending on the necessity.
Some teams create a base class with common steps to reuse in the other test cases and avoid repeated code.
Related to the last point, sometimes it is better to write methods with the steps in the test class and use those methods in the "Execute" in order to improve the readability and maintainability.