Skip to content

jasp402/Cypress-craft

Repository files navigation

CypressCraft Logo

馃摝 CypressCraft

We had fun creating this app. So you can have fun trying.

What is CypressCraft?

It is a library for nodeJS distributed via NPM. In essence, it is a Cypress extension (unofficial - created by the community). Which concentrates the best practices of E2E testing and API services: multiple libraries, design patterns and code organization. This library is characterized by the integration of BDD using Cucumber and Gherkin, advanced design patterns such as Page Object Model (POM) and Factory Pattern, and Singleton Pattern specifically adapted and refined to work with the versatile nature of Cypress.

It also has the ability to manage multiple environments, dynamic data, and a structure designed specifically for managing APIs. This integration not only improves automated test setup, but also facilitates a more organized and maintainable test code structure. It provides a clear template to follow when building test cases.


CypressCraft Logo

Why Cypress Craft?

This library was designed especially for automation enthusiasts: With Cypress-Craft we try to redefine the way you write tests for API AND E2E.

As test automation professionals, many of us have explored the depths of Cypress, discovering both its strengths and limitations. Cypress shines in a variety of FrontEnd (E2E) testing scenarios, but it also has its limitations, especially when it comes to non-native functionality, such as handling API tests or integrations with cucumber and Gherkins, handling multiple environments or managing dynamic data.

This library not only shares the desire to simplify the integration process with cucumber and improve the API testing experience. But it also shares our experience of many years. Trying to improve and simplify processes. Inside the world of automation.


CypressCraft key innovations include:

  • Optimization for API Testing:

    Although Cypress was not originally designed with a focus on API testing, we have fine-tuned and optimized its use for this purpose, ensuring a smooth and effective experience.
  • Management of Multiple Environments:

    CypressCraft efficiently handles multiple test environments, allowing easy transition and configuration between different test contexts.
  • Data Centralization:

    We have centralized the management of data, both dynamic and fixed, through specialized classes that control data from fixtures, thus improving the consistency and reusability of data in tests.
  • Flexibility in Frontend and Backend:

    The sub-framework is designed to automatically adjust to API or frontend projects as needed, implementing highly optimized design patterns.

CypressCraft is the ideal solution for development and QA teams looking to minimize time and effort in the process of creating automations, while maintaining high standards of quality and efficiency. With the latest version of Cypress as a foundation, CypressCraft represents a significant evolution in the world of test automation.

Table of Contents

Introduction

Welcome to CypressCraft, an advanced sub-framework designed to revolutionize the way E2E and API testing is performed using Cypress. Developed by a team with more than four years of experience at Cypress, this sub-framework emerges as a comprehensive solution to overcome common challenges in test automation and maximize efficiency in software development.

CypressCraft extends Cypress' capabilities beyond its primary focus on E2E testing, tailoring it for optimal performance in API testing. With meticulous integration of design patterns such as the Page Object Model (POM) and Factory Pattern, CypressCraft not only simplifies the creation of automated tests but also makes them more maintainable and scalable.

This sub-framework is specially designed for teams looking for agility and precision in their testing, offering advanced features such as handling multiple environments, data centralization, and flexibility to adjust to API or frontend projects. Whether you're just getting started with Cypress or are an automated testing veteran, CypressCraft is here to enrich your experience and take your testing to the next level.

Characteristics

CypressCraft est谩 equipado con una serie de caracter铆sticas potentes y optimizaciones dise帽adas para hacer que tus pruebas sean m谩s eficientes y efectivas. Aqu铆 hay una mirada a las principales caracter铆sticas que hacen de CypressCraft una herramienta indispensable para la automatizaci贸n de pruebas:

Optimizaci贸n para Pruebas de API con Cypress: A pesar de que Cypress se centra principalmente en pruebas E2E, CypressCraft lo extiende para proporcionar soporte robusto y eficiente para pruebas de API.

Integraci贸n de Patrones de Dise帽o Avanzados: Implementamos patrones de dise帽o como POM y Factory Pattern para estructurar mejor las pruebas, mejorar la reutilizaci贸n del c贸digo y facilitar el mantenimiento.

Manejo de M煤ltiples Ambientes: CypressCraft permite una f谩cil configuraci贸n y transici贸n entre diferentes entornos de prueba, lo que lo hace ideal para pruebas en etapas de desarrollo, pruebas y producci贸n.

Centralizaci贸n de Datos: Ofrecemos una soluci贸n centralizada para gestionar tanto datos din谩micos como fijos, lo que aumenta la eficiencia y reduce la redundancia.

Adaptabilidad para Frontend y API: Dise帽ado para ser flexible, CypressCraft se adapta autom谩ticamente a proyectos de API o frontend, lo que permite a los equipos concentrarse en la l贸gica de prueba sin preocuparse por la configuraci贸n de la herramienta.

Interfaz de Usuario Intuitiva y Documentaci贸n Completa: CypressCraft no solo es potente sino tambi茅n f谩cil de usar, con una interfaz intuitiva y documentaci贸n completa que gu铆a a los usuarios a trav茅s de todas sus funcionalidades.

Compatibilidad con la 脷ltima Versi贸n de Cypress: Nos mantenemos al d铆a con las 煤ltimas actualizaciones de Cypress, asegurando que los usuarios de CypressCraft siempre tengan acceso a las 煤ltimas caracter铆sticas y mejoras en seguridad.

Requirements

Para aprovechar al m谩ximo las capacidades de CypressCraft, es importante asegurarse de que tu sistema cumpla con los siguientes requisitos previos:

Cypress Versi贸n Compatible: CypressCraft est谩 dise帽ado para funcionar con las versiones m谩s recientes de Cypress. Aseg煤rate de tener instalada la 煤ltima versi贸n de Cypress en tu sistema.

Node.js y npm: Dado que Cypress es una herramienta basada en Node.js, necesitar谩s tener Node.js y npm (Node Package Manager) instalados. Recomendamos usar la versi贸n LTS (Long Term Support) m谩s reciente de Node.js.

Navegadores Compatibles: Para pruebas E2E, aseg煤rate de tener instalados los navegadores compatibles con Cypress, como Chrome, Firefox, Edge, entre otros.

Entorno de Desarrollo: Un entorno de desarrollo adecuado para JavaScript/TypeScript, con editores como Visual Studio Code, Sublime Text o Atom, es recomendable para una mejor experiencia de codificaci贸n.

Conocimientos B谩sicos: Un entendimiento b谩sico de Cypress, pruebas E2E, y pruebas de API es beneficioso para utilizar efectivamente CypressCraft.

installation

Sigue estos pasos para instalar CypressCraft en tu proyecto y comenzar a aprovechar sus potentes caracter铆sticas para pruebas automatizadas:

Instalar Cypress: Antes de instalar CypressCraft, aseg煤rate de tener Cypress instalado en tu proyecto. Si a煤n no lo has hecho, puedes instalar Cypress con npm ejecutando el siguiente comando en tu terminal:

bash Copy code npm install cypress --save-dev Agregar CypressCraft: Una vez que Cypress est茅 instalado, puedes agregar CypressCraft a tu proyecto. Ejecuta el siguiente comando para instalar CypressCraft:

bash Copy code npm install cypresscraft --save-dev Este comando a帽adir谩 CypressCraft como una dependencia de desarrollo en tu proyecto.

Verificar la Instalaci贸n: Tras la instalaci贸n, puedes verificar que CypressCraft se haya instalado correctamente revisando tu archivo package.json o ejecutando el siguiente comando:

bash Copy code npm list --depth=0 Configuraci贸n Inicial: Para la configuraci贸n inicial, puedes seguir las instrucciones proporcionadas en la secci贸n Configuraci贸n de este documento.

bash Copy code

Ejemplo de comando de instalaci贸n

npm install tu-sub-framework Configuraci贸n Explica c贸mo configurar el sub-framework despu茅s de la instalaci贸n. Incluye detalles sobre archivos de configuraci贸n, variables de entorno, etc.

Uso

Ofrece ejemplos de c贸mo usar el sub-framework para diferentes casos de uso (E2E, API). Puedes incluir fragmentos de c贸digo o enlaces a ejemplos m谩s detallados.

Patrones de Dise帽o Implementados

Detalla los patrones de dise帽o utilizados y c贸mo estos benefician al usuario del sub-framework.

Manejo de Entornos

Describe c贸mo el sub-framework gestiona m煤ltiples entornos de prueba y cualquier configuraci贸n relacionada.

Manejo de Datos

Explica c贸mo se centralizan y gestionan los datos, tanto din谩micos como fijos, dentro del sub-framework.

Contribuir

Invita a otros a contribuir al proyecto y explica c贸mo pueden hacerlo. Puedes incluir instrucciones para realizar pull requests, normas de codificaci贸n, etc.

Licencia

Indica la licencia bajo la cual se distribuye el sub-framework.

Contacto

Proporciona informaci贸n de contacto o enlaces a perfiles de redes sociales o profesionales para aquellos que deseen comunicarse contigo.