Consistent naming conventions improve code readability, maintainability, and make it easier for team members to understand and navigate the test automation framework. This guide establishes naming standards for all components of the Makers BTG Tests framework.
All naming should prioritize clarity and business readability over technical brevity.
#language:esCaracterística: <Clear business description> @<appropriate-tags> Esquema del escenario: [<Scenario Type>] <Business-readable description> Dado <precondition in business language> Cuando <action in business language> Entonces <expected outcome in business language>
Feature description should be clear and business-focused:
✅ “Generación de reportes desde la web de Chronos”
public class GeneracionReporteSteps { // Gherkin: "el usuario ingresa a la web de Chronos" @Dado("el usuario ingresa a la web de Chronos") public void el_usuario_ingresa_a_la_web_de_chronos() { // Implementation } // Gherkin: "ingrese los datos del reporte {string} para la compañia {string} segun la fecha {string}" @Cuando("ingrese los datos del reporte {string} para la compañia {string} segun la fecha {string}") public void ingrese_los_datos_del_reporte_para_la_compañia_segun_la_fecha( String reporte, String compania, String fecha) { // Implementation } // Gherkin: "se genera el reporte {string} de manera exitosa" @Entonces("se genera el reporte {string} de manera exitosa") public void se_genera_el_reporte_de_manera_exitosa(String reporte) { // Implementation }}
Cucumber automatically generates method name suggestions based on the Gherkin step text. Use these suggestions as a starting point.
public class ReporteConstants { public static final String URL_BASE = "https://chronos.btg.com"; public static final int TIMEOUT_SEGUNDOS = 30; public static final String FORMATO_FECHA = "yyyy-MM-dd";}
@reportes @generacionEsquema del escenario: [Happy Path] Generacion exitosa de reporte@login @autenticacionEscenario: [Happy Path] Login exitoso con credenciales validas@consulta @saldo @apiEscenario: [Happy Path] Consulta de saldo mediante API
Avoid creating too many tags. Stick to standard tags and add feature-specific tags only when necessary for test filtering.
Combine general and specific tags for flexible filtering:
@test @reportes @generacion @smokeEsquema del escenario: [Happy Path] Generacion exitosa de reporte
This allows running:
All tests: @test
All report tests: @reportes
Only generation tests: @generacion
Smoke suite: @smoke
Tag Placement
Place tags at the appropriate level:
@reportesCaracterística: Generación de reportes desde la web de Chronos @test @smoke Esquema del escenario: [Happy Path] Generacion exitosa de reporte @test @regression Esquema del escenario: [Error] Fallo con datos invalidos
Feature-level tags apply to all scenarios. Scenario-level tags are specific.
# ✅ GoodEsquema del escenario: [Happy Path] Generacion exitosa de reporteEscenario: [Error] Fallo al generar reporte con fecha invalidaEscenario: [Negative] Rechazo de reporte sin permisosEscenario: [Edge Case] Generacion de reporte en limite de mes# ❌ BadEscenario: test reporteEscenario: prueba 1Escenario: validar_que_el_reporte_se_genera_correctamente
Scenario names should be understandable by non-technical stakeholders. They serve as living documentation.
// Main test runnerpublic class CucumberRunner { }// Smoke test suitepublic class SmokeTestRunner { }// Regression test suitepublic class RegressionTestRunner { }// Feature-specific runnerpublic class ReportesTestRunner { }
public class LoginPage { public void ingresarCredenciales(String usuario, String password) { }}public class ReportePage { public void seleccionarReporte(String reporteId) { }}public class DashboardPage { public void navegarAReportes() { }}