How to Prepare HTML Code and other Configurations for Cucumber Tests?
Implementation of Acceptance Tests in Guri
Overview of Acceptance Testing
- The discussion begins with an introduction to implementing acceptance tests for the Guri application, focusing on three specific invitations from a repository related to simple test implementations.
Marking HTML Elements for Testing
- The first step involves marking HTML elements in the graphical interface so they can be referenced in tests. For instance, buttons need identifiable names within the HTML code.
- An example is provided where an input field for entering a student's name is labeled as "name box," allowing it to be easily referenced in test code.
- Similarly, another input field for capturing a student's CPF (Cadastro de Pessoas Físicas - Brazilian individual taxpayer registry identification) is designated as "cpf box" to facilitate its reference during testing.
Structuring Data Representation
- The transcript discusses how previously existing code lists registered students in a table format. Each row contains columns for student names and CPFs, which are now named "name list" and "cpf list" respectively.
- This naming convention allows testers to refer directly to these elements when writing tests, ensuring clarity and precision in identifying data points within the user interface.
Preparing HTML for Automation
- Additional preparations include marking links that will be interacted with during tests. For example, a link leading to the student component is labeled simply as "alunos," enabling straightforward referencing when simulating clicks in automated tests.
Configuration Adjustments for Test Execution
- Beyond HTML preparation, adjustments are made to configuration files necessary for executing tests using the Cucumber tool. Specific file types and directories are identified for organizing test specifications effectively.