# anshita-bhasin/click-actions-in-cypress architecture

> Architecture diagram of the GitHub repository anshita-bhasin/click-actions-in-cypress, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anshita-bhasin/click-actions-in-cypress
- Repository: https://github.com/anshita-bhasin/click-actions-in-cypress

## Overview

##### Project type and purpose
- This is an open-source Cypress test automation guide, focused exclusively on demonstrating a variety of click-action patterns (basic, coordinate, position, keyboard-modified, double-click, right-click, event triggers).
- It runs on Node.js (v18+), uses Cypress v10+, and can execute tests either locally or on LambdaTest’s Cypress Cloud Grid via the lambdatest-cypress CLI.

##### File structure
- Root level
– package.json & package-lock.json: metadata and dependencies (cypress, lambdatest-cypress-cli)
– cypress.config.js: central Cypress configuration
– base_reporter_config.json: reporter settings for LambdaTest runs
– lambdatest-config.json & lambdatest_run.json: cloud grid credentials and run settings
– custom_support_file.js: any additional custom initialization
- cypress/
– e2e/cypress_click_actions/*.cy.js: test spec files, each illustrating one click pattern
– fixtures/example.json: sample test data
– support/commands.js & e2e.js: custom commands, global hooks, polyfills

##### README for additional insights
- Describes local execution: “npx cypress run”
- Describes cloud execution with lambdatest-cypress CLI: initialization, JSON config structure, run command
- Mentions best practices, selector strategies, and handling hidden elements

a. Main components
1. Developer / CI Environment (Node.js + NPM)
2. NPM Modules
- Cypress Core
- LambdaTest CLI plugin
3. Test Runner
- Reads cypress.config.js
- Loads test specs (cypress/e2e)
- Loads support layer and fixtures
4. Browser Instances
- Local Chrome/Firefox (headless or headed)
- Remote browsers in LambdaTest Cloud Grid
5. Application Under Test (any web app loaded by tests)
6. Reporter / Results
- Console output
- LambdaTest dashboard & smart_ui screenshots
b. Relationships & interactions
- Developer → npm install → NPM Modules
- Developer/CI → npx cypress run or lambdatest-cypress run → Test Runner
- Test Runner → loads config & support → executes specs → drives Browser → interacts with SUT → emits events → assertion library validates outcomes
- Browser → returns DOM/events → Runner → Reporter → outputs to console and/or LambdaTest
c. Architectural patterns & principles
- Separation of concerns: configuration (JSON/JS), test specs, support/hooks, fixtures
- Plugin pattern: Cypress plugins for extensibility, LambdaTest integration
- Modular test design: one spec per click scenario
d. Key technologies
- Node.js, NPM
- Cypress testing framework
- lambdatest-cypress CLI plugin
- JSON-based configuration files

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Developer/CI Environment"
        Dev["Developer/CI Environment"]:::actor
        PKG["package.json"]:::config
        LOCK["package-lock.json"]:::config
    end

    Dev -->|npm install| CYPModules["NPM Modules"]:::runtime
    Dev -->|view docs| README["README.md"]:::doc

    subgraph "NPM Modules"
        Core["Cypress Core"]:::runtime
        LTCLI["LambdaTest CLI plugin"]:::runtime
    end

    CYPModules --> Core
    CYPModules --> LTCLI

    Core --> Runner["Cypress Test Runner"]:::runtime
    LTCLI --> Runner

    subgraph "Runner Configuration"
        CFG["cypress.config.js"]:::config
        SupportInit["custom_support_file.js"]:::config
    end

    Runner --> CFG
    Runner --> SupportInit

    subgraph "LambdaTest Config"
        LTConfig["lambdatest-config.json"]:::config
        LTRun["lambdatest_run.json"]:::config
        ReporterCFG["base_reporter_config.json"]:::config
    end

    Runner --> LTConfig
    Runner --> LTRun
    Runner --> ReporterCFG

    subgraph "Test Specs"
        BClick["basic-click.cy.js"]:::code
        WaitClick["click-and-wait.cy.js"]:::code
        CoordClick["click-on-coordinates.cy.js"]:::code
        PosClick["click-on-position.cy.js"]:::code
        KbClick["click-with-keyboard.cy.js"]:::code
        OptClick["click-with-options.cy.js"]:::code
        DblClick["double-click.cy.js"]:::code
        RtClick["right-click.cy.js"]:::code
        Trigger["trigger-events.cy.js"]:::code
    end

    Runner -->|"loads specs"| BClick
    Runner --> WaitClick
    Runner --> CoordClick
    Runner --> PosClick
    Runner --> KbClick
    Runner --> OptClick
    Runner --> DblClick
    Runner --> RtClick
    Runner --> Trigger

    Runner --> Fixtures["example.json"]:::data

    subgraph "Support Layer"
        Commands["commands.js"]:::code
        Hooks["e2e.js"]:::code
    end

    Runner --> Commands
    Runner --> Hooks

    Runner --> BrowserLocal["Local Browser"]:::runtime
    Runner --> LambdaCloud["LambdaTest Cloud Grid"]:::external

    BrowserLocal -->|executes tests| SUT["Application Under Test"]:::external
    LambdaCloud -->|executes tests| SUT

    Runner --> ReporterConsole["Console Output"]:::code
    Runner --> LambdaDash["LambdaTest Dashboard"]:::external

    %% Click Events
    click PKG "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/package.json"
    click LOCK "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/package-lock.json"
    click Core "https://github.com/anshita-bhasin/click-actions-in-cypress/tree/main/node_modules/cypress"
    click LTCLI "https://github.com/anshita-bhasin/click-actions-in-cypress/tree/main/node_modules/lambdatest-cypress-cli"
    click CFG "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress.config.js"
    click SupportInit "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/custom_support_file.js"
    click ReporterCFG "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/base_reporter_config.json"
    click LTConfig "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/lambdatest-config.json"
    click LTRun "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/lambdatest_run.json"
    click BClick "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/e2e/cypress_click_actions/basic-click.cy.js"
    click WaitClick "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/e2e/cypress_click_actions/click-and-wait.cy.js"
    click CoordClick "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/e2e/cypress_click_actions/click-on-coordinates.cy.js"
    click PosClick "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/e2e/cypress_click_actions/click-on-position.cy.js"
    click KbClick "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/e2e/cypress_click_actions/click-with-keyboard.cy.js"
    click OptClick "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/e2e/cypress_click_actions/click-with-options.cy.js"
    click DblClick "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/e2e/cypress_click_actions/double-click.cy.js"
    click RtClick "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/e2e/cypress_click_actions/right-click.cy.js"
    click Trigger "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/e2e/cypress_click_actions/trigger-events.cy.js"
    click Fixtures "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/fixtures/example.json"
    click Commands "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/support/commands.js"
    click Hooks "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/cypress/support/e2e.js"
    click README "https://github.com/anshita-bhasin/click-actions-in-cypress/blob/main/README.md"

    classDef actor fill:#FFA07A,stroke:#333,stroke-width:1px;
    classDef runtime fill:#ADD8E6,stroke:#333,stroke-width:1px;
    classDef config fill:#FFD700,stroke:#333,stroke-width:1px,stroke-dasharray:5 5;
    classDef code fill:#FFB6C1,stroke:#333,stroke-width:1px;
    classDef data fill:#FFB6C1,stroke:#333,stroke-width:1px;
    classDef external fill:#90EE90,stroke:#333,stroke-width:1px;
    classDef doc fill:#D3D3D3,stroke:#333,stroke-width:1px;
```
