Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/tugkanboz/awesome-cursorrules/testing-fundamentalsgit clone --depth 1 https://github.com/tugkanboz/awesome-cursorrulesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/tugkanboz/awesome-cursorrules/testing-fundamentals)<a href="https://agentmods.dev/rules/tugkanboz/awesome-cursorrules/testing-fundamentals"><img src="https://agentmods.dev/badge/rules/tugkanboz/awesome-cursorrules/testing-fundamentals.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00026 | $0.01820 |
| Opus 5 | $0.00013 | $0.00910 |
| Sonnet 5 | $0.00005 | $0.00364 |
| Haiku 4.5 | $0.00003 | $0.00182 |
Grade A, and why
testing-fundamentals scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cypress Testing Fundamentals
Core Testing Principles
- Reliable Selectors: Use data attributes for stable element identification
- Smart Waits: Leverage Cypress's automatic waiting capabilities
- Test Isolation: Each test should be independent and repeatable
- Clear Assertions: Write descriptive assertions that explain expected behavior
Element Selection Excellence
// ✅ Best Practice - Use data-cy attributes
cy.get('[data-cy=login-button]').click()
cy.get('[data-cy=username-input]').type('[email protected]')
cy.get('[data-cy=password-input]').type('password123')
// ✅ Alternative - Use data-testid
cy.get('[data-testid=submit-form]').click()
// ✅ Accessible selectors
cy.get('[aria-label="Close dialog"]').click()
cy.get('button').contains('Save Changes').click()
// ❌ Avoid - Brittle CSS selectors
cy.get('.btn-primary.large-button:nth-child(2)').click() // Fragile
cy.get('#dynamic-id-12345').type('text') // IDs may change
Smart Waiting Strategies
// ✅ Wait for element to be visible and interactable
cy.get('[data-cy=submit-button]')
.should('be.visible')
.and('not.be.disabled')
.click()
// ✅ Wait for specific content
cy.get('[data-cy=user-name]')
.should('contain.text', 'John Doe')
// ✅ Wait for element to disappear (loading states)
cy.get('[data-cy=loading-spinner]').should('not.exist')
// ✅ Wait for API calls to complete
cy.intercept('POST', '/api/users').as('createUser')
cy.get('[data-cy=create-user-form]').submit()
cy.wait('@createUser').then((interception) => {
expect(interception.response.statusCode).to.equal(201)
})
// ✅ Custom wait conditions
cy.get('[data-cy=dynamic-content]').should(($el) => {
expect($el).to.have.length.at.least(1)
expect($el.text()).to.match(/Expected Pattern/)
})
Test Structure and Organization
describe('User Authentication Flow', () => {
beforeEach(() => {
// Set up consistent test state
cy.visit('/login')
cy.clearLocalStorage()
cy.clearCookies()
})
context('Valid Login Scenarios', () => {
it('should successfully log in with valid credentials', () => {
// Arrange
const userData = {
email: '[email protected]',
password: 'validPassword123'
}
// Act
cy.get('[data-cy=email-input]').type(userData.email)
cy.get('[data-cy=password-input]').type(userData.password)
cy.get('[data-cy=login-button]').click()
// Assert
cy.url().should('include', '/dashboard')
cy.get('[data-cy=welcome-message]')
.should('be.visible')
.and('contain.text', 'Welcome back!')
// Verify user data is loaded
cy.get('[data-cy=user-profile]')
.should('contain.text', userData.email)
})
it('should remember user when "Remember me" is checked', () => {
cy.get('[data-cy=email-input]').type('[email protected]')
cy.get('[data-cy=password-input]').type('password123')
cy.get('[data-cy=remember-me-checkbox]').check()
cy.get('[data-cy=login-button]').click()
// Verify login success
cy.url().should('include', '/dashboard')
// Simulate browser restart by clearing session
cy.clearCookies({ domain: null })
cy.visit('/login')
// Verify user is still remembered
cy.get('[data-cy=email-input]')
.should('have.value', '[email protected]')
})
})
context('Invalid Login Scenarios', () => {
it('should display error for invalid credentials', () => {
cy.get('[data-cy=email-input]').type('[email protected]')
cy.get('[data-cy=password-input]').type('wrongPassword')
cy.get('[data-cy=login-button]').click()
// Verify error handling
cy.get('[data-cy=error-message]')
.should('be.visible')
.and('contain.text', 'Invalid credentials')
// Verify user stays on login page
cy.url().should('include', '/login')
// Verify form state
cy.get('[data-cy=password-input]').should('have.value', '')
cy.get('[data-cy=email-input]').should('have.value', '[email protected]')
})
it('should validate required fields', () => {
// Test empty form submission
cy.get('[data-cy=login-button]').click()
cy.get('[data-cy=email-error]')
.should('be.visible')
.and('contain.text', 'Email is required')
cy.get('[data-cy=password-error]')
.should('be.visible')
.and('contain.text', 'Password is required')
})
})
})
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 240 lines · 26 tokens per session scan A bd68c40250b0
testing-fundamentals is a cursor rule published in the GitHub repository tugkanboz/awesome-cursorrules (20 stars, last pushed yesterday), licensed MIT. It adds 26 tokens to every session and 1,820 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
playwright
Playwright: e2e testing, page objects, fixtures, assertions.
cypress
Cypress: cy commands, selectors, fixtures, intercepts.
playwright
Playwright: e2e testing, page objects, fixtures, assertions.
cypress
Cypress: cy commands, selectors, fixtures, intercepts.
cursorrules
You are building an AI/ML project with Python. The project uses PyTorch for model training, handles data pipelines with proper validation, tracks experiments systematically, and follows production ML engineering practices. Code is type-hinted, tested, and reproducible.
unity-input
Guidelines for working with the New Input System in Unity 6.2.