# Probar E2E

{% hint style="info" %}
Esta sección está actualmente en Progreso (WIP).
{% endhint %}

Esta sección describe cómo los desarrolladores probarán la base de código relacionada con las pruebas e2e.

## Stack de pruebas

Todas nuestras pruebas de UI DEBEN realizarse usando [Cypress](https://www.cypress.io/) como los principales frameworks de pruebas con [Synpress](https://github.com/Synthetixio/synpress) para soporte de wallet. El código de las pruebas DEBE escribirse usando [Typescript](https://www.typescriptlang.org/) y ejecutarse usando [ts-jest](https://github.com/kulshekhar/ts-jest) para tener soporte de comprobación de tipos.

## Estructura de directorios

Las nuevas pruebas DEBEN colocarse en un `tests/e2e` directorio, en la ruta raíz. Los archivos se nombrarán según el flujo que estarán probando, es decir, si el archivo de pruebas e2e va a probar el `Collection Publication` flujo, el nombre del archivo DEBE ser `collection-publication.spec.cy.ts`.

## Con qué frecuencia se ejecutarán

Programadas vía GitHub Actions. Frecuencia por determinar.

## Qué probar

* Las interacciones de usuario más relevantes en las dApps (Publicaciones de Items, Compras de NFTs, etc.)

## Cómo probar

Todas nuestras pruebas DEBEN seguir el estilo semiestructurado de **Given-When-Then** (GWT).

El siguiente ejemplo:

1. **Given** un usuario visita `https://example.cypress.io`
2. **When** hace clic en el enlace etiquetado `type`
3. Y escribe "<fake@email.com>" en el `[data-testid="action-email"]` input
4. **Luego** la URL debería incluir `/commands/actions`
5. Y el `[data-testid="action-email"]` input tiene "<fake@email.com>" como su valor

Debería escribirse como:

```jsx
describe('Given a user visits https://example.cypress.io', () => {
  beforeEach(() => {
    cy.visit('https://example.cypress.io')
  })

  describe('when clicks the link labeled type', () => {
    beforeEach(() => {
      cy.contains('type').click()
    })

    describe('and type an email into the action-email input', () => {
      beforeEach(() => {
        // Get an input, type into it
        cy.get('.action-email').type('fake@email.com')
      })

      it('Then the url should include /commands/actions', () => {
        // Should be on a new URL which
        // includes '/commands/actions'
        cy.url().should('include', '/commands/actions')
      })

      it('and the action-email input value should contain the typed email', () => {
        //  Verify that the value has been updated
        cy.get('.action-email').should('have.value', 'fake@email.com')
      })
    })
  })
})
```

## Probar contratos

Para probar smart contracts, consulte la documentación de Solidity Standards.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.decentraland.org/contributor/contributor-es/guias-para-colaboradores/testing-standards/testing-e2e.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
