Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications

Categories

🎓 Certifications
🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
CheatGrid
HomeAboutTopicsPricingMy VaultStatsPractice TestsCertifications
LVLEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

Cypress Cheat Sheet

Cypress Cheat Sheet

Back to Developer Tools
Updated 2026-04-29
Next Topic: Debugging in Python and VSCode Cheat Sheet

Cypress is a JavaScript-based end-to-end testing framework built specifically for modern web applications. Unlike traditional testing tools that run outside the browser, Cypress executes in the same run-loop as your application, enabling automatic waiting, real-time reloading, and time-travel debugging. The Cypress platform now extends beyond the open-source App into Cypress Cloud — offering Test Replay, Flake Detection, Smart Orchestration, Cypress Accessibility, UI Coverage, and AI-powered features including Studio AI, cy.prompt(), and Cloud MCP for AI coding assistants. The framework supports E2E testing, component testing for React, Vue, Angular, and Svelte, and API testing, making it a comprehensive solution for validating modern web applications at every layer.

What This Cheat Sheet Covers

This topic spans 24 focused tables and 188 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Core Navigation and Query CommandsTable 2: Action CommandsTable 3: AssertionsTable 4: Network Requests and API TestingTable 5: Fixtures and Test DataTable 6: Aliases and VariablesTable 7: Waits, Timeouts, and Retry LogicTable 8: Hooks and Test OrganizationTable 9: Browser and Window ManipulationTable 10: Storage and SessionsTable 11: Custom CommandsTable 12: Environment Variables and ConfigurationTable 13: Debugging ToolsTable 14: Time ManipulationTable 15: Spies, Stubs, and MocksTable 16: Tasks and Node IntegrationTable 17: Component TestingTable 18: CI/CD and Headless ModeTable 19: Advanced SelectorsTable 20: Cross-Origin TestingTable 21: Plugins and PreprocessorsTable 22: Accessibility TestingTable 23: AI-Powered TestingTable 24: Best Practices and Anti-Patterns

Table 1: Core Navigation and Query Commands

Every Cypress test starts by loading a page and then reaching into the DOM to grab the elements you care about. These are the building blocks — cy.visit() to navigate, cy.get() and cy.contains() to locate, and a family of traversal helpers (.find(), .parent(), .siblings(), .eq()) that let you walk from one element to its neighbours. What sets them apart from plain jQuery is built-in retry: a query keeps re-running until the element appears or the timeout hits, so timing flakiness rarely bites you.

CommandExampleDescription
cy.visit()
cy.visit('/login')
• Loads the specified URL in the test browser
• accepts relative or absolute paths and waits for page load events.
cy.get()
cy.get('[data-cy="submit-btn"]')
• Queries DOM elements using CSS or jQuery selectors
• automatically retries until elements appear or timeout.
cy.contains()
cy.contains('button', 'Submit')
• Finds element of specific type containing text
• more precise when both element type and text are provided.
cy.find()
cy.get('.form').find('input')
• Searches for descendant elements within previously queried parent
• similar to jQuery's .find().
cy.within()
cy.get('form').within(() => {
cy.get('input').type('text')
})
• Scopes all subsequent commands within a parent element
• useful for form contexts or component isolation.
cy.eq()
cy.get('li').eq(2)
• Selects element at specific index from matched set
• zero-based indexing.
cy.first()
cy.get('li').first()
Returns the first element from a matched set.
cy.last()
cy.get('li').last()
Returns the last element from a matched set.

More in Developer Tools

  • Cursor IDE Cheat Sheet
  • Debugging in Python and VSCode Cheat Sheet
  • AI-LLM Code Generation Cheat Sheet
  • File Formats Cheat Sheet
  • Notepad++ Cheat Sheet
  • Sublime Text Cheat Sheet
View all 55 topics in Developer Tools