Cypress Testing Framework

repository·develop·Indexed 13 days ago

https://github.com/cypress-io/cypress

A fast, easy, and reliable testing framework for anything that runs in a web browser, providing a modern developer experience for end-to-end, component, and integration testing. Includes specialized support for front-end frameworks like Angular via @cypress/angular and @cypress/angular-zoneless, as well as an Angular CLI schematic for automated setup and spec generation.

Tokens
80.3K
Snippets
270
Records
469
Agent score
99%

What's inside Cypress

  1. What is @cypress/mount-utils and when to use it

    develop

    The @cypress/mount-utils library provides shared types and utility functions for building Mount Adapters for component frameworks.

    Important: This package is intended exclusively for use within Cypress Component Testing. It is used internally by first-party adapters like @cypress/react, @cypress/vue, @cypress/svelte, and @cypress/angular to implement the cy.mount command.

  2. Overview of @packages/scaffold-config

    develop
    The @packages/scaffold-config package contains the logic used by launchpad to scaffold new Cypress projects. It automates the detection of component frameworks and bundlers, installs necessary dependencies, and generates a functional cypress.config.js file. It provides out-of-the-box support for popular code generators like Next.js and Vue CLI, and can also scaffold configurations for React and Vue projects using Vite or Webpack that were not created via a generator.
  3. Overview of Cypress CI/CD Pipelines

    develop

    The Cypress repository utilizes two primary systems for Continuous Integration and Continuous Deployment: CircleCI for testing, building, and releasing, and GitHub Actions for automation, security, and repository maintenance.

    CircleCI Usage

    CircleCI handles the heavy lifting of the development lifecycle through two main workflows:

    1. Pull Request Workflow: Triggered by PRs targeting develop or release/* branches (excluding drafts). It covers building, linting, unit testing, integration testing (across Chrome, Firefox, Electron, and WebKit), system testing, and validating framework integrations (React, Vue, Angular, etc.).
    2. Full Workflow: Triggered by pushes to develop or release/* branches. This includes the entire PR workflow plus multi-platform builds (Linux, macOS, Windows), binary creation via cypress-publish-binary, binary verification, and release preparation.

    GitHub Actions Usage

    GitHub Actions manages background tasks and repository health:

    • Automation: Daily updates for browser versions and V8 snapshot caches.
    • Security: Snyk scans (SCA and Static Analysis) on PRs.
    • PR Validation: Ensures PR titles follow conventional commit formats.
    • Maintenance: Automated triaging and stale issue management.
    • Compliance: Generation of Software Bill of Materials (SBOM) for releases.
  4. What is @tooling/packherd?

    develop

    Packherd is a utility designed to herd all dependencies reachable from a specific entry point and pack them into a bundle. It primarily handles the task of bundling application files and providing related metadata.

    It is part of a larger ecosystem where:

    • @tooling/packherd handles bundling and metadata.
    • @packages/packherd-require handles loading previously bundled modules and on-demand TypeScript transpilation with caching.
  5. What is Launchpad?

    develop

    Launchpad is the Vue 3 application rendered by Electron that serves as the visual user interface for Cypress. It is the application that opens when you run cypress open.

    Its primary responsibilities include:

    • Facilitating Cypress Cloud logins.
    • Guiding new users through onboarding (e.g., configuring Component Testing dev servers and installing dependencies).
    • Allowing users to select between E2E and Component testing modes.
    • Displaying a dismissible Welcome Screen for major Cypress releases.
  6. Overview of @tooling/v8-snapshot

    develop
    The @tooling/v8-snapshot package is a tool designed to prepare a bundle of application modules and their dependencies for snapshotting via the mksnapshot tool. This process allows modules to be snapshotted and subsequently embedded into a Cypress Electron application, improving startup performance by loading pre-instantiated modules from the heap.
  7. Use @packages/v8-snapshot-require to load Electron snapshots

    develop

    The @packages/v8-snapshot-require package is a tool designed to load snapshots for Electron applications that were created using @tooling/v8-snapshot.

    It works by providing snapshotted modules to @packages/packherd-require and helping locate those modules by deriving keys from module metadata. This allows the system to resolve modules without querying the file system, improving performance.

    When a module is requested, the tool follows this priority order:

    1. Exports: Attempts to load a fully initialized version of the module from the snapshot.
    2. Definitions: Falls back to a function that will initialize the module if exports are unavailable.
    3. File System: Finally falls back to loading the module from the file system via Node.js if the snapshot does not contain the required data.